Hi,
I've just learnt about the Big-O-Notation and a bit confused about the O(2^n) one. Someone could help me out with some code example?
Thanks
This is a discussion on The Big-O-Notation example? within the C++ Programming forums, part of the General Programming Boards category; Hi, I've just learnt about the Big-O-Notation and a bit confused about the O(2^n) one. Someone could help me out ...
Hi,
I've just learnt about the Big-O-Notation and a bit confused about the O(2^n) one. Someone could help me out with some code example?
Thanks
Well, if you just learned about this why don't you show us what you have tried?
"A government big enough to give you everything you want, is big enough to take away everything you have." - Thomas Jefferson
MSVS 2008 Pro / DevPartner / CB NightlyBuilds / MinGW / Cygwin
it has nothing to do with code examples... It speackes about complexity of the algorithm
For example if you say that some sorting algorithm is O(2^n) it means you should do about
k*2^n operations to sort the array of n values, where k is a constant
If I have eight hours for cutting wood, I spend six sharpening my axe.
I thought the OP was asking for code:
Someone could help me out with some code example?
"A government big enough to give you everything you want, is big enough to take away everything you have." - Thomas Jefferson
MSVS 2008 Pro / DevPartner / CB NightlyBuilds / MinGW / Cygwin
This link to Prelude's website may be helpful in understanding Big-O notation and why its used, give it a read. http://www.eternallyconfuzzled.com/a..._art_bigo.aspx