|
-
May 9th, 2002, 05:45 PM
#1
Thread Starter
Fanatic Member
what's this mean?
"Addition and deletion are both O(logn) operations"
about heapsort
i have two weeks to learn hashing, heapsort, and "operations on dynamic data structures" (transversals, insertion, deleteion, memory management"
any tips/resources?
thanks
(its for a comp sci ap test, they dont have the course here, so im just taking the test)
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
May 13th, 2002, 07:44 AM
#2
I think it's about the speed of the operation. It tells you how long an operation takes. For example: bubble sort takes at worst n^2. This means the number of loop iterations (where the loop body does the work) is at worst the square of the number of elements. This is very bad.
Quicksort on the other hand takes at worst log n. This is a LOT less.
At best both algorithms need nearly no time (if the array is already sorted).
Finding an element in a linked list takes at worst n. At best 1. (depending on where the element is).
I don't know what the O means, but I think it means "worst case". There may be other letters that mean things like "constant time" or "always".
"constant time" means an operation takes the same time no matter how many elements there are (e.g. deleting an element from a double linked list at a known position).
"always" means an operation takes the same time relative to the element count no matter where in the array the manipulated data is, can't think of an example.
Keda may know more.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|