# need heli in O-notation please

This topic is 4273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hello: i have aquestion regarding the o-notation. how does using strings insted of simple types like integers alter the o-notation of operations? thank you very much

##### Share on other sites
Do you know what the big-O notation actually is?

##### Share on other sites
Big O notation has nothing to do with types. Like the above poster, I believe you misunderstand what, exactly, Big O notation means. Research might help you.

##### Share on other sites
Actually, I think you may be asking a valid question. An operating on an integer is almost by definition O(1), since the size of an integer is a set number of bits and can usually be accomplished with one instruction.

Many (but not all) operations on a string, such as making the letters all caps, take longer depending on the length of the string, and are usually linear time, O(n), or worse. Some operations might be O(n^2) or worse.

Does that help?

##### Share on other sites
Of course, there are also people for whom operations on "integers" are *not* constant time, because their concept of "an integer" is arbitrary-precision and not limited to 32-bit. This kind of thing is important if you're trying to calculate a zillion digits of pi. :)

For example.

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 23
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631768
• Total Posts
3002242
×