[algogeeks] Counting Sort

2006-04-26 Thread pramod
Can we change counting sort to sort inplace only using O(k) space where the numbers range from 1...k? The problem precisely is to design a sorting algorithm to sort 'n' records whose keys range from 1...k in O(n) time using only an auxiliary array of size k. The algorithm should sort be stable and

[algogeeks] [ counting sort ideea ]

2005-11-21 Thread ed.thyme
I have a data structure and also i have 3 basic operation, find_min, delete_min and insert . A sequence of m operation could look like this: insert,insert,insert,delete,find_minetc.. Any M operations of these, should have O(M+k) complexity( O(m+k) -worst case). My ideea is to have a sorted arr