Re: [algogeeks] Median of BST

2010-05-19 Thread kaushik sur
@Dhilip Is it tested ? I doubt your code won't work ? @Rohit Can we anyways modify Morris Inorder Traversal process? We can have two pointers slow(increments once) and fast(increments twice), so that if fast reaches end or fast->next is end, we can have the median @ slow ? Correct me If I am wrong

Re: [algogeeks] Re: BST

2010-05-17 Thread kaushik sur
Sharing link for Morris Inorder http://www.scss.tcd.ie/disciplines/software_systems/fmg/fmg_web/IFMSIG/winter2000/HughGibbonsSlides.pdf Courtesy Rohit On Mon, May 17, 2010 at 3:42 PM, kaushik sur wrote: > @Manish > > Does not a recursive solution [inorder traversal] takes an impli

Re: [algogeeks] Re: BST

2010-05-17 Thread kaushik sur
@Manish Does not a recursive solution [inorder traversal] takes an implicit stack space ? Please correct me if I am wrong ? @Rahul Can you please send us the *morris inorder pdf* link that u have shared once ? Best Regards Kaushik -- You received this message because you are subscribed to the

Re: [algogeeks] Re: frequency

2010-05-17 Thread kaushik sur
Hi Friends Hash Map takes 2byte [in Java] for holding a character So in Amazon - It takes A - 1 M - 1 Z - 1 O - 1 N - 1 But it's time effective! Yes it takes additional space for intergers, for each key 4 byte for an integer!!! :-( *** public void checkTheFrequency() {

Re: [algogeeks] k the smallest in BST without using static variable

2010-05-16 Thread kaushik sur
Thanks Rohit! On Sat, May 15, 2010 at 7:13 PM, Rohit Saraf wrote: > there is something called morris inorder traversal. > credits to donald knuth > > > On 5/15/10, kaushik sur wrote: > > Hi Friends > > > > I have encountered the question in sites - "G

[algogeeks] k the smallest in BST without using static variable

2010-05-15 Thread kaushik sur
r and keeping a non-static count variable. I welcome any better solution, time and space efficient. Best Regards Kaushik Sur -- 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

Re: [algogeeks] frequency

2010-05-14 Thread kaushik sur
Hi Friend Using HashMap in Java *** /* * input a character array from the user and output in the following way. example string is amazon.. then output should be a2m1z1o1n1 */ package questionaire; import java.util.Collection; import java.util.HashMap; impo

[algogeeks] Re: frequency

2010-05-14 Thread kaushik sur
gs) { Amazon1 test = new Amazon1("amazon"); test.checkTheFrequency(); } } ** Best Regards Kaushik Sur On May 14, 3:00 pm, divya jain wrote: > use binary tree and insert in it every character u come across. if the > character is