Correctness − Data structure implementation should implement its interface correctly.
Time Complexity − Running time or the execution time of operations of data structure must be
as small as possible.
Space Complexity − Memory usage of a data structure operation should be as little as possible.
There are three cases which are usually used to compare various data structure's execution time in a
relative manner.
Worst Case − This is the scenario where a particular data structure operation takes maximum time it can
take. If an operation's worst case time is ƒ(n) then this operation will not take more than ƒ(n) time where
ƒ(n) represents function of n.
Average Case − This is the scenario depicting the average execution time of an operation of a data
structure. If an operation takes ƒ(n) time in execution, then m operations will take mƒ(n) time.
Best Case − This is the scenario depicting the least possible execution time of an operation of a data
structure. If an operation takes ƒ(n) time in execution, then the actual operation may take time as the
random number which would be maximum as ƒ(n).
No comments:
Post a Comment