![]() |
| OMG algorithm analysis |
|
rockhead85
ACM Secretary
|
From a quick glance, I think it is a bubble sort.
(Correct me if I'm wrong) If I'm correct, it should be n^2. Right? But since it has that 'for' loop, it should be n^3. I'll go with n^3. Mind if you tell me where you got the code? |
||||||||||||
|
|
|||||||||||||
|
civilmass
|
I got it from my teacher Stephen Scott. He gave us a bunch of peices of code and we have to prove the big O big (omega) and big (thetta) for each of them. Most of them were pretty easy but that one was quite hard to solve. I did talk to derek about that one and he had Professor scott as a teacher and said that he likes to do stuff like that where it is a sorting algorithm that we know bu he changes it to make it look ridiculously hard. Well thanks for the help man!!!
|
||||||||||||
|
_________________ Civilmass |
|||||||||||||
|
rockhead85
ACM Secretary
|
That code was the piece of code I've ever read.
|
||||||||||||
|
|
|||||||||||||
|
civilmass
|
Hmm.... I bet it was.... did not get enough sleep?? |
||||||||||||||
|
_________________ Civilmass |
|||||||||||||||
|
rockhead85
ACM Secretary
|
Lol. No I didn't (had 1 hour sleep)
What I wanted to say was, "That was the worst piece of code I've ever read." |
||||||||||||
|
|
|||||||||||||
|
Kano
|
That could be in the Obfuscated C Code Contest. I guess it itself isn't that bad, most of the stuff in the contest is one line if i remember right, but yeah, it does break a few unwriten rules.
|
||||||||||||
|
_________________ (1) A sheet of paper is an ink-lined plane. (2) An inclined plane is a slope up. pla(3) A slow pup is a lazy dog. QED: A sheet of paper is a lazy dog. -- Willard Espy, "An Almanac of Words at Play" Kyle Brown |
|||||||||||||
| OMG algorithm analysis |
|
||
|


