|
|
|
|
|
by kkaranth
2089 days ago
|
|
I love the runtime analysis of Spaghetti sort: > Preparing the n rods of spaghetti takes linear time. Lowering the rods on the table takes constant time, O(1). This is possible because the hand, the spaghetti rods and the table work as a fully parallel computing device. There are then n rods to remove so, assuming each contact-and-removal operation takes constant time, the worst-case time complexity of the algorithm is O(n). |
|