Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread umesh kewat
one another solution using counting array... void findwidth(BST* bt, int *arr, int count)//initially count is 0 for root { if(bt) return; arr[count]++; count++; if(bt->left) findwidth(bt->left, arr, count); if(bt->right) findwidth(bt->right, arr, count); ret

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread umesh kewat
use levelorder traversal and calculate the number of node in same level by putting some condition :) On Mon, Jul 26, 2010 at 1:53 PM, vineel yalamarth < vineelyalamar...@gmail.com> wrote: > > > No dude, they asked me to find width , in the sense ... find the maximum > number of nodes in any leve

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread vineel yalamarth
No dude, they asked me to find width , in the sense ... find the maximum number of nodes in any level. And if you know how to find the diameter do post it -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email t

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread sharad kumar
shldnt max width be equal to diameter of the treecorrect me if im wrong On Mon, Jul 26, 2010 at 1:28 PM, vineel yalamarth < vineelyalamar...@gmail.com> wrote: > > > Dear Sharad,Maximum width of the tree you had drawn is 2...(3,8),(1,4) > > > > > -- > You received this message because you

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread vineel yalamarth
Dear Sharad,Maximum width of the tree you had drawn is 2...(3,8),(1,4) -- 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+u

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread sharad kumar
5 / \ 3 8 max width is 4 (1-3-5-8) am i riteif so then use the approach as i stated earlier ... / \ 1 4 On Mon, Jul 26, 2010 at 1:03 PM, Sathaiah Dontula wrote: > I mean "maximum number of nodes in a breadth of a BST". > > Thanks, > Sathaiah > > On Mon, Jul 26, 2010 at 1:00 PM,

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread Sathaiah Dontula
I mean "maximum number of nodes in a breadth of a BST". Thanks, Sathaiah On Mon, Jul 26, 2010 at 1:00 PM, sharad kumar wrote: > the max width of bst is the largets diff betweeen the min node and max node > rite? > > > On Mon, Jul 26, 2010 at 12:30 PM, Chunyuan Ge wrote: > >> breadth-favorit

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread sharad kumar
the max width of bst is the largets diff betweeen the min node and max node rite? On Mon, Jul 26, 2010 at 12:30 PM, Chunyuan Ge wrote: > breadth-favorite search? > > > On Mon, Jul 26, 2010 at 2:28 PM, Sathaiah Dontula wrote: > >> You mean maximum width of bst ? >> >> You can use BST to find

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread Chunyuan Ge
breadth-favorite search? On Mon, Jul 26, 2010 at 2:28 PM, Sathaiah Dontula wrote: > You mean maximum width of bst ? > > You can use BST to find the same. > > Thanks, > Sathaiah > > > On Mon, Jul 26, 2010 at 11:47 AM, aparichith > wrote: > >> Can some one tell me the algorithm to find out the wid

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-25 Thread Sathaiah Dontula
You mean maximum width of bst ? You can use BST to find the same. Thanks, Sathaiah On Mon, Jul 26, 2010 at 11:47 AM, aparichith wrote: > Can some one tell me the algorithm to find out the width of a binary > search tree. > > -- > You received this message because you are subscribed to the Googl

[algogeeks] Oracle-Java Developer interview question

2010-07-25 Thread aparichith
Can some one tell me the algorithm to find out the width of a binary search tree. -- 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