[algogeeks] Re: pls help

2013-07-10 Thread Prashant Agarwal
vamshi vijay vamshi1252@... writes: at Sagar See at level 4, 81 leaf  nodes are possible, since in question it has been given 28 leaf  nodes, if i  use just 10 nodes from level 3 (27 nodes), i can get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are also

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-17 Thread prashant thorat
. 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. -- Yours affectionately, Prashant Thorat -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: worst case complexity

2011-09-10 Thread Prashant Kulkarni
In work case (ie max value of i,j and k ll be) for(i=0;in;i++) //i=n { for(j=0;jn*n;j++) // j=i=n; { for(k=0;kn*n;k++) // k=j=i=n; } } So Ans O(n^5) -- Prashant Kulkarni On Sat, Sep 10, 2011 at 12:05 PM, deepikaanand swinyanand...@gmail.comwrote: ans : O(n^5) inner

Re: [algogeeks] Algo Book

2011-09-06 Thread Prashant Kulkarni
The Algorithm Design Manual By Steve S. Skiena -- Prashant Kulkarni On Tue, Sep 6, 2011 at 3:48 PM, Udit Gupta uditgupta...@gmail.com wrote: Fundamentals of Computer Algorithms by Sartaj Sahni On Tue, Sep 6, 2011 at 3:45 PM, Neha Gupta nehagup...@gmail.com wrote: hey guys , do tell me

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread prashant thorat
order can be stored but you need to remember the nulls always On Aug 29, 12:06 am, sagar pareek sagarpar...@gmail.com wrote: level order traversal is best for this case :) On Sun, Aug 28, 2011 at 11:53 PM, prashant thorat prashantnit...@gmail.comwrote: only preorder

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread prashant thorat
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Yours affectionately, Prashant Thorat Computer Science and Engg. Dept, NIT Durgapur. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread prashant thorat
but this case inorder traversal wont get back original tree On Mon, Aug 29, 2011 at 3:09 PM, PRATEEK VERMA prateek...@gmail.com wrote: @prashant it is the same mid value as u calculate in binary search i.e. (lowest index+highest index)/2 No matter whether it is 18 or 27,u gonna get almost

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread prashant thorat
, 11:49 am, prashant thorat prashantnit...@gmail.com wrote: @vikas : you can use recursive approach to draw tree here we go: 6 4 3 5 7 8 11 12 1 ) 6 is root since 4 6 , 4 is left child of 6 2) find value which is more than 6 , so it is 7 in this case... hence 7 is right child. 3

Re: [algogeeks] algo ques

2011-08-28 Thread prashant thorat
://groups.google.com/group/algogeeks?hl=en. -- Yours affectionately, Prashant Thorat Computer Science and Engg. Dept, NIT Durgapur. -- 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

Re: [algogeeks] algo ques

2011-08-28 Thread prashant thorat
) } else return; } On Sun, Aug 28, 2011 at 6:54 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: what is the initial value of length that u r passing?? On Sun, Aug 28, 2011 at 6:47 PM, prashant thorat prashantnit...@gmail.com wrote: Hi, you can do this by recursion , printPath (int length

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-28 Thread prashant thorat
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Yours affectionately, Prashant Thorat Computer Science and Engg. Dept, NIT Durgapur. -- You received this message because you

Re: [algogeeks] goldman sachs paper

2011-08-10 Thread Prashant Gupta
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. -- Prashant Gupta B.Tech Final Year Computer Science and Engineering NIT Trichy

[algogeeks] hi

2011-08-09 Thread prashant gautam
hello -- 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

Re: [algogeeks] MICROSOFT INTERVIEW QUESTIONS faced by my frenz nd me

2011-08-08 Thread Prashant Kulkarni
are printing its starting location so we will some garbage value. -- Prashant Kulkarni On Mon, Aug 8, 2011 at 11:28 AM, Mohit Goel mohitgoel291...@gmail.comwrote: can anyone one explain output of question 1. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] difference between the two

2011-08-06 Thread Prashant Gupta
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. -- Prashant Gupta B.Tech

Re: [algogeeks] order of evalution of variable problem

2011-08-06 Thread Prashant Gupta
/group/algogeeks?hl=en. -- Prashant Gupta B.Tech Final Year Computer Science and Engineering NIT Trichy Phone : +91 9894462744 -- 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

Re: [algogeeks] c output

2011-08-01 Thread Prashant Gupta
. 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. -- Prashant Gupta B.Tech Final Year Computer Science

Re: [algogeeks] Tug of War

2011-07-31 Thread Prashant Gupta
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. -- Prashant Gupta B.Tech Final Year Computer Science and Engineering NIT Trichy Phone

Re: [algogeeks] array constant

2011-07-30 Thread prashant bhutani
for the execution. In that case, you are asking compiler to allocate the memory but how much has to be decided at run-time, so the compiler throws an error! To make initializations, use compile time constants using const keyword or macros or giving the size by yourself.. Thanks Regards, Prashant Bhutani

Re: [algogeeks] array constant

2011-07-30 Thread prashant bhutani
If a compiler is compiling the code, simply means the compiler is intelligent enough to know what you want to do. But the language specifications, clearly explains not to do such things as these are non-portable!! Thanks Regards, Prashant Bhutani Senior Undergraduate Computer Science

Re: [algogeeks] Re: Amazon

2011-07-30 Thread prashant bhutani
Well the macro definition should be #define sqrt(x) ((x)*(x)) to capture all the possible scenarios!! Thanks Regards, Prashant Bhutani Senior Undergraduate Computer Science Engineering (B.Tech) Institute of Technology - BHU (IT-BHU) Varanasi-221005 On Sat, Jul 30, 2011 at 1:28 PM, arvind

Re: [algogeeks] Re: plz give some efficient method to find out if a point lies inside or outside the triangle?

2011-07-29 Thread prashant bhutani
Yeah, the comparison of two floats will be a problem as the behaviour is undefined and depends on the machine architecture and compiler. Thanks Regards, Prashant Bhutani Senior Undergraduate Computer Science Engineering (B.Tech) Institute of Technology - BHU (IT-BHU) Varanasi-221005 On Fri

Re: [algogeeks] C output 3

2011-07-29 Thread prashant bhutani
fffe is two's complement of 2. Let me explain for fe and you can extrapolate it with other f's. f =15, e =14. fe = 1110, ~fe = 0001, ~fe+1 = 0010 = 2 which gives your answer. Thanks Regards, Prashant Bhutani Senior Undergraduate Computer Science Engineering (B.Tech) Institute

Re: [algogeeks] plzz explain

2011-07-27 Thread Prashant Gupta
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Prashant Gupta B.Tech Final Year Computer Science and Engineering NIT Trichy Phone : +91 9894462744 -- You received this message because you are subscribed

Re: [algogeeks] output please

2011-07-24 Thread Prashant Gupta
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. -- Prashant Gupta B.Tech Final Year Computer Science

Re: [algogeeks] Single linked list questions.

2011-01-06 Thread Prashant Kulkarni
hi, for 1 question, use stack to display elements in reverse order. can you elaborate your 2nd question ? -- Prashant Kulkarni On Thu, Jan 6, 2011 at 4:56 PM, dinesh bansal bansal...@gmail.com wrote: Hi Guys, There are some questions asked to me: 1. How do you print the SLL in reverse

Re: [algogeeks] linkd list

2010-12-15 Thread Prashant Kulkarni
4)look for 'z' in the list by considering all numbers as unsigned if u found then check sign of that number it be opposite of 'z' if so return 1 else 0 [above steps is repeated for all elements] *correct me if I am wrong* -- Prashant Kulkarni IISc Bangalore On Wed, Dec 15, 2010 at 10:36 AM

Re: [algogeeks] linkd list

2010-12-15 Thread Prashant Kulkarni
we can use binary search algorithm to find the z ( sorting ll take O(n log n ) but it is very less compared to n^2 * log n ) -- Prashant Kulkarni On Wed, Dec 15, 2010 at 3:32 PM, Ankur Murarka ankur.murarka@gmail.comwrote: wouldn't your algo take n^3 time as well given the fact

Re: [algogeeks]

2010-11-02 Thread prashant thorat
affectionately, Prashant Thorat Computer Science and Engg. Dept, NIT Durgapur. -- 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

Re: [algogeeks] All numbers in Array repeat twice except two

2010-10-04 Thread Prashant Kulkarni
I think we can do XOR operation Over all numbers and result will contain number which appeared only once. Correct Me If I'm Wrong -- Prashant Kulkarni On Mon, Oct 4, 2010 at 3:17 PM, malli mallesh...@gmail.com wrote: I have an array. All numbers in the array repeat twice except two

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-28 Thread Prashant Kulkarni
i think it is similar to finding max in a list O(n) or sorting algorithm O(n log n) -- Prashant Kulkarni On Tue, Sep 28, 2010 at 11:33 PM, Rahul Singal rahulsinga...@gmail.comwrote: A possible solution i can think is create a directed graph where each vertex is a envelope and edges

Re: [algogeeks] find out the mid point of a single linked list

2010-09-28 Thread Prashant Kulkarni
of the linked list -- Prashant Kulkarni On Tue, Sep 28, 2010 at 10:54 PM, Divesh Dixit dixit.coolfrog.div...@gmail.com wrote: Given a singly-linked, find out (just give the basic logic) the mid point of a single linked list in a single parse of the list. Assume the program would be loaded

Re: [algogeeks] Re: Addition Of numbers in SLL

2010-08-14 Thread Prashant Kulkarni
i think we can use recursion method to reverse the list -- Prashant Kulkarni On Sat, Aug 14, 2010 at 11:40 PM, Lokesh Agarwal lokesh...@gmail.comwrote: how can you traverse from last without reversing it. and there is no need fof using extra stack space. -- You received this message

Re: [algogeeks] confusion

2010-07-29 Thread Prashant Kulkarni
every printf statement wll return how many number of parameter/variable print r printed so 2nd nested wll print number 1 n remaing two printf statement wll print number of parameters are printed so total three 1's .:) -- Prashant Kulkarni || Lokaha Samastaha Sukhino Bhavanthu || || Sarve Jana

Re: [algogeeks] Recursion help!

2010-06-04 Thread Prashant Kulkarni
) here if (n-1) th is greater so it will return its value -- Prashant Kulkarni On Fri, Jun 4, 2010 at 7:13 PM, Raj N rajn...@gmail.com wrote: int Max(int a[],int n) { int max; if(n==1) return a[0]; else max=Max(a,n-1); if(maxa[n

Re: [algogeeks] Re: another google telephone interview question

2010-05-19 Thread Prashant Kulkarni
i think we can use sorting algorithm like insertion sort, in insertion sort whenever we are putting the element into it's proper position we can check whether this elements already exists don't put otherwise insert into into it's proper position (element) -- Prashant Kulkarni || Lokaha Samastaha

Re: [algogeeks] Convert a Binary tree into spike.

2010-05-13 Thread Prashant K
use BFS traversal method -- Prashant Kulkarni || Lokaha Samastaha Sukhino Bhavanthu || || Sarve Jana Sukhino Bhavanthu || On Wed, May 12, 2010 at 8:48 PM, vinayan c vinayan1...@gmail.com wrote: Something like this 1 2 3 4

Re: [algogeeks] Finding the middle of a singly linked list which has a cycle in it

2010-03-29 Thread Prashant K
. 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. -- Prashant Kulkarni -- You received this message because you are subscribed

Re: [algogeeks] First k smallest elements

2010-03-28 Thread Prashant K
. 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. -- Prashant Kulkarni NITK -- You received this message because you are subscribed

Re: [algogeeks] parallel algorithm: find majority element

2009-12-09 Thread Prashant K
://groups.google.com/group/algogeeks?hl=en. -- Prashant Kulkarni -- 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

[algogeeks] Re: max product of any three nos in an array of signed integers

2009-09-16 Thread Prashant
. -- Keep up with people you care about with Yahoo! India Mail. Learn howhttp://in.rd.yahoo.com/tagline_galaxy_1/*http://in.overview.mail.yahoo.com/connectmore . -- Prashant Kulkarni --~--~-~--~~~---~--~~ You received this message

[algogeeks] Re: minimum difference.

2009-09-02 Thread Prashant
of length n. find 2 number such that their differnce is minimum. -- Shishir Mittal Ph: +91 9936 180 121 -- Regards, Prashant Kulkarni --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Re: Median Finding algorithms.

2009-08-31 Thread Prashant
, Nagendra Kumar nagendra@gmail.com wrote: Given a set S of n distinct numbers and a positive integer k = n. Determine the k numbers in S that are closest to the median of S. Find an O(n) algorithm -- Prashant Kulkarni --~--~-~--~~~---~--~~ You

[algogeeks] Re: Help me with this problem

2006-06-17 Thread prashant bhargava
(brick edges must bepallarel to board edges)Thanks for helpRegards,Prashant Bhargava ***--***--***--***--***--***--***Plz do visitwww.hemantdesign.com/prashant --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Re: Help me with this problem

2006-06-17 Thread prashant bhargava
PROTECTED] wrote: Sorry, you're wrong. Consider board of size N = 1, M = 5 and K = 2. If you round down (N/K) then you have RESULT = 0. If you round up then you have 5. Also wrong. On 6/17/06, prashant bhargava [EMAIL PROTECTED] wrote: if the question is complete then the answer shd' be (N/K) * M

[algogeeks] Re: Find the number of paths between two points on a grid

2006-04-06 Thread prashant bhargava
from current node start(x+n,y,TRAVERSED); } -- Smile, it's the second best thing you can do with your lips..By the way...the First thing is ur KISS :-)Prashant Bhargava-- www.excogitation.tkor www.hemantdesign.com/prashant -- Smile

[algogeeks] Re: Find the number of paths between two points on a grid

2006-04-06 Thread prashant bhargava
.. By the way...the First thing is ur KISS :-)Prashant Bhargava-- www.excogitation.tkor www.hemantdesign.com/prashant --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

[algogeeks] Hi all...seniors please share ur thoughts

2006-03-29 Thread Prashant
Hello Friends. I am Prashant and in First yr Engg--Computers from Mumbai University. This may sound absurd for this group. I have an aim of becoming one of the code jammers some day. I want to kno what kind of programming skills (languages etc) one shld kno