Questions tagged [notation]

Notation refers to a specific way of writing various concepts, functions, etc. Usually it is introduced to abbreviate complicated expressions and make common idioms more readable.

633 questions
-2
votes
2 answers

Slicing up individual words in a text file

I'm trying to get the two last letters of each word in a text file containing a lot of text. And I'm supposed to use slice notations or something similar to solve this. Say the text is this: " I wanna learn how to slice up letters of each of these…
-2
votes
2 answers

What does comma mean after javascript object declaration?

Let's take some javascript code from vk.com var stManager = { //some long code with methods and properties... }, __stm = stManager; Why do we need last line in this code? Why duplicate stManager one more time?
Aleksander A
  • 311
  • 2
  • 10
-2
votes
5 answers

Wrong approach to dot notation?

I have a object that looks like this: var obj = { Laser: [0, 2], Missile: [4, 4] } using literal notation, i can access the properties just fine: for (prop in obj){ console.log(prop + " scored " + obj[prop][0] + " out of " + obj[prop][1] + "…
Christian F
  • 259
  • 4
  • 10
-2
votes
1 answer

The big O notation

I am reading about Big O notation. In the book I have, there is an example in which the complexity of n2 is in class of O(n3). That doesn't seem logical to me because n3 depends on n and it isn't just a plain constant multiplier that we can "get rid…
-2
votes
1 answer

The set operation X and set-roster notation?

Let S = {2,4,6} and T = {1,3,5}. Use the set-roster notation to write each of the following sets, and indicate the number of elements that are in each set? a. S X T b. T X S c. S X S d. T X T The problem is I don't know what's flying here, there are…
lejadina
  • 31
  • 5
-3
votes
1 answer

turn function add(1, 4) into (add, 1, 4)

I have been experimenting with using functions to make a mini programming language, but can't find out how to turn the function add(1, 4) into (add, 1, 4) So far I have this: mem = {} def inp(text): return(input(text)) def store(name,…
-3
votes
7 answers

How to double the strings in Python ex. "Hello" to "HHeelllloo"

how do I do this with sliced notation? ex. "Hello" to "HHeelloo"
-3
votes
1 answer

What is Big O of two nested loops?

I am trying to figure out Big O of following code: for(let i = 0; i < arr.length; i++) { for(let j = 0; j < arr[i].someVariable; j++) { console.log("Hello world") } } arr[i].someVariable is any number from 1 to infinity. Do you have some…
karolinski
  • 577
  • 1
  • 6
  • 18
-3
votes
2 answers

How is the running time calculated for nested "for" loops?

Recently started with this so need your help, Lets say you have nested for loops as shown below, both ranging from 1 to n, how does one calculate the running time for the same in terms of Big O, Theta, Omega? for(i=1; i
Grim0419
  • 19
  • 7
-3
votes
1 answer

underlying architecture 2’s complement representation

The goal that I have is to look and see if the operating system is using 2’s complement underlying architecture. Going into this I was at a complete blank after a while I remembered that 1's compliment had two different representations for 0, (0000…
Cody Syring
  • 15
  • 1
  • 1
  • 8
-3
votes
3 answers

About big O notation definition

I came across this sentence in a book about algorithms: O -notation expresses the upper bound of a function within a constant factor What does it mean?
-3
votes
2 answers

Find the largest palindrome in any given string, using python ( big O notation)

I was wondering which kind of O notation this code is, can somebody help me to figure out? I wrote it but when I was interrogated about which kind of O notation is, and the only thing I could say it was linear but I have the feeling that…
Miguel Angel
  • 419
  • 3
  • 4
-3
votes
1 answer

Big O notation help, confused

I have this problem, prove or disprove F(n)=10n^3+3n g(n)=5n^2 This is what I have tried and gotten k=1 n>1 F(n)/g(n)=(10n^3+3n/5n^2)<(10n^3+3n^2/5n^2)=13/5 Thus 10n^3+3n<=13/5(5n^2) 10n^3+3n<=13n^2n when n>1 Is this correct?
-3
votes
3 answers

Difference between : and . in Objective-C

So I am new to iOS and have been noticing that not only can you use . notation but there is : (colon). My question is what is the difference between these two notations? what do they mean? When are they used? Are they interchangeable? When is it…
CGTheLegend
  • 734
  • 1
  • 7
  • 19
-5
votes
4 answers

What kind of operator is *(++ptr)?

I'm rather new to C and sometimes I come across strange notations, especially in relation with pointers. A very short example: .... real *ptr; real delta_force; for(i
OD IUM
  • 1,555
  • 2
  • 16
  • 26
1 2 3
42
43