Next: SHELL SORT (Donald Shell)
Up: sorting
Previous: Av. Case Complexity of
- (a) Local exchange only
- each accomplishes in undoing one environment
5 1 4 7 2 has inversions (5,1),(5,4),(5,2),(4,2),(7,2)
(n n-1 ...2 1) has
inversions
lower bound
- (b) lower bound on comparison based sorting
example: a b c - there are 3! outputs.
(for n numbers there are n! outputs)
Every decision tree to sort n numbers must have atleast n! leaf nodes
Every decision tree to sort n numbers must have atleast 2n! - 1 nodes
Every decision tree to sort n numbers must have depth atleast
leaf nodes
Depth is the lower bound worst case time complexity for this class of algorithms
Lower Bound on Comparison-Based Sorting Algorithm
Decision Tree for 3 numbers
Depth of binary tree with
leaves
Next: SHELL SORT (Donald Shell)
Up: sorting
Previous: Av. Case Complexity of
Sushil_Prasad
2014-09-25