Re: [algogeeks] Re: array size problem

2011-07-03 Thread Navneet Gupta
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- --Navneet -- 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

Re: [algogeeks] Delete a node in a BST!!

2011-07-03 Thread Navneet Gupta
node's data with x's and recursively call deleteNode on x. Since there have been a couple of DS book recos, i would like to add one which I used and found extremely good. Data Structures in C++ by Mark Allen Weiss. All frequently used/asked DS algos are present in that book and more! Thanks, Navneet

Re: [algogeeks] find output

2011-07-03 Thread Navneet Gupta
@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. -- Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: Sum to K problem

2011-07-02 Thread Navneet Gupta
:53 PM, Navneet Gupta navneetn...@gmail.comwrote: Ideally, yes it can. Though i would be happy even if someone gives a good answer for non-negative values. On Mon, Jun 20, 2011 at 6:28 PM, Akshata Sharma akshatasharm...@gmail.com wrote: @Navneet: does the set contains negative

Re: [algogeeks] Dynamic Programming problem

2011-07-02 Thread Navneet 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. -- --Navneet -- You received this message because you

Re: [algogeeks] Re: GOOGLE QUESTION

2011-06-30 Thread Navneet 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. -- --Navneet -- You received this message because you are subscribed

Re: [algogeeks] Binary Tree

2011-06-28 Thread Navneet Gupta
Sunny, the solution is great. Could you give me some ideas around how do you approach such problems in recursive manner? Recursion is never easy for me to understand as it is difficult to visualize. On Tue, Jun 21, 2011 at 11:52 PM, sunny agrawal sunny816.i...@gmail.com wrote: see this

[algogeeks] Algorithms

2011-06-28 Thread Navneet Gupta
http://en.wikipedia.org/wiki/List_of_algorithms How many do you know? :) --Navneet -- 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

Re: [algogeeks] OS

2011-06-27 Thread Navneet Gupta
?hl=en. -- --Navneet -- 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

RE: [algogeeks] string matching

2011-06-23 Thread Navneet Gupta
String matching can be performed in linear time with KMP algorithm. could you say what more optimization you are looking for here? Sent from my Windows Phone -- From: prateek gupta Sent: 23/06/2011 11:17 To: algogeeks@googlegroups.com Subject: [algogeeks] string

RE: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-06-23 Thread Navneet Gupta
Even I am getting permission error in accessing the google doc Sent from my Windows Phone From: pullasunil Sent: 23/06/2011 12:14 To: Algorithm Geeks Subject: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ... Can you mail me the book for Algorithms

Re: [algogeeks] Re: sort the array

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

Re: [algogeeks] [Brain Teaser] Extraordinary Riddle 21 june

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

Re: [algogeeks]

2011-06-21 Thread Navneet Gupta
this group at http://groups.google.com/group/algogeeks?hl=en. -- --Navneet -- 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

Re: [algogeeks] Amazon

2011-06-21 Thread Navneet Gupta
and then create a table to store words such that ith row has words with i characters and has as much has 26 trees (for words starting from each char a...z) Need to think for an efficient solution to construct such generic rectangle. Navneet On Mon, Jun 20, 2011 at 10:05 PM, chirag ahuja sparkle.chi

[algogeeks] Sum to K problem

2011-06-20 Thread Navneet Gupta
Given a set of integers , find a set of numbers such that they sum to a given number k . Notice the set of numbers can have 2 or more than 2 numbers. --Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Sum to K problem

2011-06-20 Thread Navneet Gupta
20, 2011 at 12:09 PM, oppilas . jatka.oppimi...@gmail.comwrote: I think its a NP problem. The solution complexity can go up O(2^N) in worst case. On Mon, Jun 20, 2011 at 11:55 AM, Navneet Gupta navneetn...@gmail.comwrote: Given a set of integers , find a set of numbers such that they sum

[algogeeks] Coin Chain Reaction

2011-06-20 Thread Navneet Gupta
rolled dice whose outcome is 4, 5, or 6. Let N denote the N-th round of rolls. What is the total expected value at the end of the N-th round of rolls? Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Sum to K problem

2011-06-20 Thread Navneet Gupta
Ideally, yes it can. Though i would be happy even if someone gives a good answer for non-negative values. On Mon, Jun 20, 2011 at 6:28 PM, Akshata Sharma akshatasharm...@gmail.com wrote: @Navneet: does the set contains negative elements also? On Mon, Jun 20, 2011 at 12:26 PM, pacific

RE: [algogeeks] Coin Chain Reaction

2011-06-20 Thread Navneet Gupta
Can you discuss how did you arrive at this value? Sent from my Windows Phone -- From: sunny agrawal Sent: 20/06/2011 22:53 To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Coin Chain Reaction and Expected value should be 2.5^(N-1)*(7/2) -- Sunny Aggrawal

[algogeeks] Minimum draws for correct labels

2011-06-20 Thread Navneet Gupta
are allowed to take one marble at a time out of any box, without looking inside, and by this process of sampling you are to determine the contents of all three boxes. What is the smallest number of drawings needed to do this? --Navneet -- You received this message because you are subscribed

Re: [algogeeks] Minimum draws for correct labels

2011-06-20 Thread Navneet Gupta
does not contain while, it can either have BB or BW ball. But it must have BB ball inside it otherwise, we will end up getting BB in correct labeled BB box. On Tue, Jun 21, 2011 at 12:11 AM, Radhika Renganathan radi.coo...@gmail.com wrote: one drawing ?! On 6/21/11, Navneet Gupta

Re: [algogeeks] Re: Finding the min gap in 3 arrays

2011-06-18 Thread Navneet Gupta
. 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. -- --Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: find output.

2011-06-16 Thread Navneet 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. -- --Navneet -- You

Re: [algogeeks] Re: find output.

2011-06-16 Thread Navneet Gupta
at 8:06 PM, Navneet Gupta navneetn...@gmail.comwrote: @Sunny, it is good that you follow Bruce Eckel, but copy pasting the exact thing? :) On Thu, Jun 16, 2011 at 7:34 PM, keyan karthi keyankarthi1...@gmail.comwrote: hi friends is a string literal.. ie the string hi friends is stored

Re: [algogeeks] a doubt..

2011-06-14 Thread Navneet Gupta
, snehi jain snehijai...@gmail.com wrote: wont recursion will also be resource (time) intensive because of the multiple function call which is not observed in iterative procedures. On Tue, Jun 14, 2011 at 7:30 AM, Navneet Gupta navneetn...@gmail.comwrote: Recursion is the best way to write compact

Re: [algogeeks] Find shortest substring that is only occurring once. in Given String

2011-06-14 Thread Navneet Gupta
/group/algogeeks?hl=en. -- --Navneet -- 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

Re: [algogeeks] Interview Question: Puzzle: Probability

2011-06-14 Thread Navneet Gupta
this group at http://groups.google.com/group/algogeeks?hl=en. -- --Navneet -- 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

Re: [algogeeks] a doubt..

2011-06-13 Thread Navneet Gupta
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- --Navneet -- 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

[algogeeks] Intuitive Understanding of XOR Operation

2011-06-13 Thread Navneet Gupta
the correctness of the solution whenever i come across such solutions. Also would be good if someone can throw some light on what other kinds of problems they have seen which are difficult(time complexity wise) but using XOR gives an elegant and time efficient solution. --Navneet -- You received

[algogeeks] Print 1 to n without loops

2011-06-10 Thread Navneet Gupta
Take n from user and print 1 to n. No loops like for/while/do-while are allowed to use. --Navneet -- 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

Re: [algogeeks] Print 1 to n without loops

2011-06-10 Thread Navneet Gupta
No. On Fri, Jun 10, 2011 at 9:26 PM, nagajyothi gunti nagajyothi.gu...@gmail.com wrote: Can goto statement be used? On Fri, Jun 10, 2011 at 11:42 AM, Navneet Gupta navneetn...@gmail.comwrote: Take n from user and print 1 to n. No loops like for/while/do-while are allowed to use

Re: [algogeeks] Print 1 to n without loops

2011-06-10 Thread Navneet Gupta
Using recursion would be like using loops only. Also i believe the recursion used would be tail recursion and one can change tail recursion to loop based non recursive method. Okay, giving all a hint. Think classes and objects. On Fri, Jun 10, 2011 at 9:26 PM, Navneet Gupta navneetn

Re: [algogeeks] Print 1 to n without loops

2011-06-10 Thread Navneet Gupta
]; } this will print from 1 to 5 am i right? On Fri, Jun 10, 2011 at 9:30 PM, Navneet Gupta navneetn...@gmail.comwrote: Using recursion would be like using loops only. Also i believe the recursion used would be tail recursion and one can change tail recursion to loop based non recursive method

Re: [algogeeks] Re: please help me

2011-06-09 Thread Navneet Gupta
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- --Navneet -- 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

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread Navneet Gupta
://groups.google.com/group/algogeeks?hl=en. -- --Navneet -- 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

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread Navneet Gupta
of Applets and AWT and have started getting acquainted to Swing but the problem lies where to start from. Its like I want a small example or few starting steps. Complete Reference is the book that i refer. On Thu, Jun 9, 2011 at 1:48 PM, Navneet Gupta navneetn...@gmail.com wrote: I would recommend

Re: [algogeeks] Regular Expressions Implementation

2011-06-09 Thread Navneet Gupta
such characters are popped, you are ready to process remaining of string anf regex in similar fashion. Thanks, Navneet P.S. This example only had a *, while regex can have more such symbols such as ? etc and problem will become little more complicated if we have multiple such characters. On Thu, Jun 9

Re: [algogeeks] MS Interview

2011-06-09 Thread Navneet Gupta
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. -- --Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Navneet Gupta
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. -- --Navneet -- You

RE: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Navneet Gupta
in an array in O(nlogn) complexity . how insertion sort will do in O(nlogn)? On Thu, Jun 9, 2011 at 4:27 PM, Navneet Gupta navneetn...@gmail.com wrote: Insertion sort also would do. On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR deok...@gmail.com wrote: thanx for suggestion On Thu, Jun 9

[algogeeks] Sudoku

2011-06-07 Thread Navneet Gupta
What could be a good strategy to check if the given Sudoku puzzle is indeed solvable? Can you think of anything other than actually trying to solve it and later finding it is not solvable. Even good ideas for optimizations are welcome. --Navneet -- You received this message because you

[algogeeks] Re: Sudoku

2011-06-07 Thread Navneet Gupta
A little different but related problem is to determine whether a Sudoku puzzle is easy, medium or hard to solve. Here, solveability is guaranteed. On Tue, Jun 7, 2011 at 2:31 PM, Navneet Gupta navneetn...@gmail.com wrote: What could be a good strategy to check if the given Sudoku puzzle

Re: [algogeeks] challenging problem , looking for a quick and a best algorithm

2011-06-07 Thread Navneet 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. -- --Navneet -- You received this message because

[algogeeks] Re: Read a data from given particular memory location in C++

2011-06-04 Thread Navneet
Sorry but the context is not very clear. What exactly are you trying to do? Looks like you want to allocate space for an integer value and assign the value p to it. So, you need to refer it with some pointer (in this case x). On Jun 4, 2:24 pm, D.N.Vishwakarma@IITR deok...@gmail.com wrote: say

Re: [algogeeks] Re: Read a data from given particular memory location in C++

2011-06-04 Thread Navneet Gupta
in this case by indirect way ... without use of (void*)x. On Sat, Jun 4, 2011 at 3:23 PM, Navneet navneetn...@gmail.com wrote: Sorry but the context is not very clear. What exactly are you trying to do? Looks like you want to allocate space for an integer value and assign the value p to it. So, you

<    1   2