Re: [algogeeks] sorting in O(n) time

2011-08-02 Thread Surendra Gupta
Counting sort, radix sort,  .

On Wed, Aug 3, 2011 at 10:58 AM, AMAN AGARWAL mnnit.a...@gmail.com wrote:

 Hi,

 How can we sort one unsorted int array with O(n).

 Unsorted : {4,2,6,1,5,5,1,2,45,444,44,45,4,1}
 Sorted : {1,1,1,2,2,4,4,5,5,6,44,45,45,444}

 Is there any sorting method which gives us O(n) time complexity???

 Please tell the algo if anybody knows it.

 --
 AMAN AGARWAL
 Success is not final, Failure is not fatal: It is the courage to continue
 that counts!

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: google questions

2011-02-02 Thread Surendra Gupta
@Indore
Create a hash table of words, and get the top n counter from the hast count.

On Wed, Feb 2, 2011 at 1:58 PM, snehal jain learner@gmail.com wrote:

 @ above
 you approach trie needs lot of optimization.. this will take up lot of
 space...trie is suitable in case where we want to reduce search complexity
 and its space complexity is very bad.. so hashing should be better here as
 compared to trie..

  i think shashank's solution is better...


 On Tue, Feb 1, 2011 at 7:15 PM, sankalp srivastava 
 richi.sankalp1...@gmail.com wrote:

 I think , as juver++ said ,  you should also try reading on the
 internet about these kinds of problems .This can be solved with an
 augmentation of a trie (keeping a count variable at the leaf
 ( maintaining a counter for all the word frequencies
 accordingly )) .Just print the top ten results in the end .time
 complexity will be O(n , log n ) .We can improve upon this solution a
 lot using other forms of tries and some augmentation

 PS:This will take some time if we do it for n characters , but since
 you explicitly asked for 10 characters , so be it !

 For your second question , try seraching globbing (For the
 masochists , download the source code for glob library and go through
 the code )

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] 4th year project ideas

2010-10-19 Thread Surendra Gupta
You are in wrong group.

On Wed, Oct 20, 2010 at 4:20 AM, Ayush Mittal ayushmittal2...@gmail.comwrote:

 hello friends.
 plz suggest some new ideas for java projects for IT 4th year

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.