Re: [algogeeks] Re: DISTINCT Permutations ( Not Easy)

2014-03-12 Thread navneet singh gaur
. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- navneet singh gaur -- You received this message because you

Re: [algogeeks] Re: DISTINCT Permutations ( Not Easy)

2014-03-12 Thread navneet singh gaur
]); permute(a, i+1, n); swap([ai], a[j]); } } } - On Wed, Mar 12, 2014 at 11:59 AM, navneet singh gaur navneet.singhg...@gmail.com wrote: void permute(char *a, int i, int n) { int j; if (i == n) printf(%s\n, a); for (j = i; j

Re: [algogeeks] variation of LIS problem

2014-03-12 Thread navneet singh gaur
...@googlegroups.com. -- navneet singh gaur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.

Re: [algogeeks] Breaking a string problem (Dynamic programming)

2013-10-22 Thread navneet singh gaur
because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- navneet singh gaur -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: Crypt arithmetic!! Needed help in solving..

2013-07-26 Thread navneet
nikhil rao nikhilraog@... writes: Pls help needed in solving the below problem..1 )MULTIPLICATION TYPE A B C *D E C F G H     I A C * A C A E * * A F A E C H buddy your question is wrong..in last line as result it should

Re: [algogeeks] Algo Question

2013-02-04 Thread navneet singh gaur
this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- navneet singh gaur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Amazon interview Question

2013-02-04 Thread navneet singh gaur
1. Given a array,find a first unique integer. 2. Integers are coming as online stream,have to find a kth unique integer till now. For 1. Even we cannot use sorting for solving this as if we sort it than our first number which is non-repetitive changes. The best I am able to do is nlogn using

[algogeeks] Re: find a point closest to other points

2012-04-25 Thread Navneet
We cannot do it without computing distances of each node from all other nodes. So to begin with, construct a matrix representation of the graph with distances filled in for every pair of points. Proceed to calculate the minimum spanning tree of such a weighted graph. Kruskal's and Prim's are

[algogeeks] K shortest Path and K- disjoint shortest path

2011-11-07 Thread navneet singh gaur
Hi, Does anyone know how to find K-shortest path and K disjoint shortest path... -- navneet singh gaur -- 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

[algogeeks] Re: Print all path of the tree that sums up to the given value

2011-11-01 Thread Navneet
It's most probably a DP problem on trees. To know all paths which sum up to S, we must have information about subpaths having sum smaller than S and adding the node's value making the sum S. On Nov 1, 8:36 am, Ankuj Gupta ankuj2...@gmail.com wrote: No constraint on path. Though it is not

[algogeeks] Re: Given a node of BST make it the root

2011-11-01 Thread Navneet
It's called as Splaying, accessing any node results in that node becoming the root. The main idea is that some node which is currently being accessed might get accessed again or sometime near in future. Hence, for better search times, splaying is a good idea. (AVL tree rotations will help you

Re: [algogeeks] Re: Amazon OS question

2011-10-28 Thread navneet singh gaur
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 singh gaur -- You received this message because you are subscribed

[algogeeks] Re: ARTICULATION POINT ALGO

2011-10-24 Thread Navneet
It is also an application of depth first traversal. Articulation point is a vertex which if removed will leave the graph unconnected. Since i do not completely remember the algorithm myself, i would recommend you to refer Mark Allan Weiss's book on Data Structures and Algorithms in C++ and

[algogeeks] Re: ARTICULATION POINT ALGO

2011-10-23 Thread Navneet
You can find it very easily on web. Did you tried it? On Oct 23, 1:13 pm, kartik sachan kartik.sac...@gmail.com wrote: PLEASE ANY BODY CAN EXPLAIN ME ARTICULATION POINT ALGO IN DETAIL PLZ TAKE SOME EXAMPLE TOO -- *WITH REGARDS,* * * *KARTIK SACHAN* *B.TECH 3rd YEAR* *COMPUTER SCIENCE

[algogeeks] Re: Amazon Ques Suggest Algo

2011-10-20 Thread Navneet
+1 for Sumanth's solution. On Oct 20, 12:03 pm, anshu mishra anshumishra6...@gmail.com wrote: index  =  0 1 2  3  4 5  6 ar       =  0 1 2 -4 -3 6 -3 sumar =  0 1 3 -1 -4 2 -1 first index where we get the number which has already appeared in sumar will be the last index of sub array whose

[algogeeks] Re: print vertical sums of a binary tree

2011-10-17 Thread Navneet
I have an alternate method. At every level, maintain records with (x-axis value, nodeValue) and keep them in a queue. After traversal is done, you can sort the elements based on x-Axis value and sum up the nodeValue for records having same x-axis value. But complexity is becoming O(nlogn)

[algogeeks] Re: Inplace Array Convertion

2011-10-17 Thread Navneet
Great explanation Sunny. But with this approach, won't a single pass suffice? Select a card , find it's new position, insert the card at that position, initialize i to the position of the replaced card repeat till all cards have been processed. The thing we need to remember is whether relative

[algogeeks] Re: Google Interview Question

2011-10-17 Thread Navneet
How was your interview? Can you please share the questions for benefit of others? On Oct 1, 3:37 pm, Siddhartha Banerjee thefourrup...@gmail.com wrote: lol!!! -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] Re: subset of an array

2011-10-11 Thread Navneet
This is a very standard algorithm called subset sum problem and as mentioned above DP gives an efficient solution as the expense of extra space. On Oct 11, 9:14 am, abhishek sharma abhishek.p...@gmail.com wrote: yea DP will be O(given no * n) if all array entries are positive and the given no

[algogeeks] Re: i cannot solve this written test question

2011-10-09 Thread Navneet
sumOfDigits(i) - simply sums all the digits and returns the value. sortDigits() - takes a number and return the lowest possible number possible with digits of param passed. flag = false; for(int i=n+1, i 1000; i++) //mention to go upto 1000 in problem { if(sumOfDigits(i) == sumOfDigits(n)) { //a

[algogeeks] Re: Basic Algorithm

2011-10-08 Thread Navneet
I wonder why my name is there in the example string used :) On Oct 8, 3:11 pm, ManishMCS manishdaw...@gmail.com wrote: A string of characters are given. Find the highest occurrence of a character and display that character. E.g Input: AEGBCNAVNEETGUPTAEDAGPE Output: E. Please give the

[algogeeks] Re: All valid dictionary words must be found and printed.

2011-10-04 Thread Navneet
What is the source of this question? On Sep 20, 4:49 am, Ankur Garg ankurga...@gmail.com wrote: nice find bhanu..though i didnt get much :P on first read :D :D On Tue, Sep 20, 2011 at 4:34 AM, Bhanu Kishore bhanukishor...@gmail.comwrote: See this algorithm:

Re: [algogeeks] SAMSUNG INDIA SOFTWARE OPERATIONS PVT LTD (SISO)

2011-09-13 Thread navneet kumar
which college?? On Tue, Sep 13, 2011 at 7:41 PM, abhinav gupta abhinav@gmail.comwrote: any one plzz tell me what they will ask in written test... and which type of question...basically?? -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Re: Finding connection b/w 2 profiles

2011-09-13 Thread Navneet
A related discussion is available here. http://stackoverflow.com/questions/1556451/how-do-sites-like-linkedin-efficiently-display-1st-2nd-3rd-level-relationship-nex On Sep 13, 8:37 pm, Don dondod...@gmail.com wrote: I think your statement about A-B-C leads people to believe that the depth is 2.

[algogeeks] Re: MS test cases type Questions

2011-09-13 Thread Navneet
Basically test cases are asked for very general purpose software like a Notepad etc. Generally they want you to come up with as many as test cases as possible. On Sep 13, 7:15 pm, Akash Mukherjee akash...@gmail.com wrote: +1 On Mon, Sep 12, 2011 at 3:42 PM, pg@manit gpt.pa...@gmail.com

[algogeeks] Re: Suffix tree

2011-09-03 Thread Navneet
http://marknelson.us/1996/08/01/suffix-trees/ On Sep 3, 8:30 pm, teja bala pawanjalsa.t...@gmail.com wrote: Any one plzz post the material for suffix tree or elaborate suffix tree entirely.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Re: IBM-ISL

2011-09-02 Thread Navneet
I had an offer from IBM ISL, but i did not accept it. The interview is not very tough. They asked me standard questions like detecting loop in linked list, level order traversal etc. Though i appeared directly for interview and had to write no written test as i was interning there. On Sep 2,

[algogeeks] Find Max Sum Value Pairs

2011-09-01 Thread Navneet Gupta
, 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, visit this group

[algogeeks] Re: Find Max Sum Value Pairs

2011-09-01 Thread Navneet
can do so i guess) On Thu, Sep 1, 2011 at 2:15 PM, Navneet Gupta navneetn...@gmail.comwrote: Given two sorted positive integer arrays A(n) and B(n), we define a set S = {(a,b) | a in A and b in B}. Obviously there are n2 elements in S. The value of such a pair is defined as Val(a,b

[algogeeks] Re: Find Max Sum Value Pairs

2011-09-01 Thread Navneet
its sorted , cant we just take last (largest if assedning) elements of each and  return o(1) .. (since +ve we can do so i guess) On Thu, Sep 1, 2011 at 2:15 PM, Navneet Gupta navneetn...@gmail.comwrote: Given two sorted positive integer arrays A(n) and B(n), we define

[algogeeks] Find the element in Array

2011-08-31 Thread Navneet Gupta
You are given an array. One integer is in the array twice and others are unique. Find that no. O(n) Solution -- Regards, 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] Re: String Problem

2011-08-31 Thread Navneet Gupta
The important thing to notice here is that relative order of characters is important and hence you should not look for just count char based approaches. On Wed, Aug 31, 2011 at 11:20 AM, Navneet Gupta navneetn...@gmail.com wrote: Given two strings S1 and S2, Find whether another string S3 can

[algogeeks] Re: String Problem

2011-08-31 Thread Navneet
Suppose the two strings are ab and cd. The possible strings formed by interleaving these two are abcd, acbd, acdb , cabd etc.. On Aug 31, 5:23 pm, sukran dhawan sukrandha...@gmail.com wrote: what do u mean by interleaving ? On Wed, Aug 31, 2011 at 5:01 PM, Navneet Gupta navneetn

[algogeeks] Sort problem

2011-08-30 Thread Navneet Gupta
Given an array of size n wherein elements keep on increasing monotically upto a certain location after which they keep on decreasing monotically, then again keep on increasing, then decreasing again and so on. Sort the array in place (ie. using only O(1) extra memory) -- Regards, Navneet

[algogeeks] Any PHP experts out there?

2011-08-29 Thread Navneet Gupta
Any suggestions/references for same? have done web programming in past, but not so much creating websites with dynamic content/database integration etc. Also, i plan to start with WAMP model as i use Windows as my primary dev platform. -- Regards, Navneet -- You received this message because

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

2011-08-28 Thread Navneet
Store any two traversals (inorder must) and reconstruct it later. Total space 2n (n = number of nodes) On Aug 28, 11:29 am, rohit rajuljain...@gmail.com wrote: How to save a binary search tree space efficiently and built it again , just tell any idea. -- You received this message because you

[algogeeks] Re: 2 Binary trees are isomorphic?

2011-08-28 Thread Navneet
Dave, I think the last condition should be return (AreIsomorphic(tree1-left, tree2-left) AreIsomorphic(tree1- right,tree2-right)) || (AreIsomorphic(tree1-left, tree2-right) AreIsomorphic(tree1-right,tree2-left)) On Aug 28, 3:39 pm, Ankur Garg ankurga...@gmail.com wrote: Daves

[algogeeks] Zig Zag tree traversal

2011-08-28 Thread Navneet Gupta
Print tree in zig zag manner 1 / \ 23 / \ / \ 4 56 7 O/P: 1 3 2 4 5 6 7 -- Regards, 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] Re: Zig Zag tree traversal

2011-08-28 Thread Navneet
Liao, your solution will generate the required manner. However, can you try to do the same by using some bool value and a single stack/ queue? Let bool value decide whether you want to insert right to left or left to right. Haven't tried myself but think that should work. Karthik, never did i

[algogeeks] Re: 2 Binary trees are isomorphic?

2011-08-28 Thread Navneet
:02 pm, Dave dave_and_da...@juno.com wrote: @Navneet: Don't we want both subtrees to be isomorphic? Dave On Aug 28, 6:40 am, Navneet navneetn...@gmail.com wrote: Dave, I think the last condition should be return (AreIsomorphic(tree1-left, tree2-left) AreIsomorphic(tree1-right

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

2011-08-28 Thread Navneet
dhriti0...@gmail.com wrote: @Navneet: I think only saving the preorder traversal will do. O(n).  Inserting back into that order will give me the original tree back.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Print tree like a tree

2011-08-28 Thread Navneet Gupta
between nodes at higher levels increases with the number of levels we have. Assume a max of 10 levels. But the algorithm should scale. -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Re: Print tree like a tree

2011-08-28 Thread Navneet
) On Aug 28, 7:57 pm, Sanjay Rajpal srn...@gmail.com wrote: It is basically BFS for this tree, just maintain spaces at each level provided tree is a complete binary tree. Sanju :) On Sun, Aug 28, 2011 at 7:46 AM, Navneet Gupta navneetn...@gmail.comwrote: Hope the question is clear

[algogeeks] Re: 2 Binary trees are isomorphic?

2011-08-28 Thread Navneet
...@juno.com wrote: @Naveet: So we have a question of semantics. Do these three trees have the same structure:      a     /   b  / c and a  \   b    \     c and a  \   b  / c I say no, but perhaps you say yes. Dave On Aug 28, 9:35 am, Navneet navneetn...@gmail.com wrote

[algogeeks] Playdom Interview ques

2011-08-26 Thread Navneet Gupta
2 d e f g 3 3. Write a function which returns inorder successor of a node. Take care of corner cases. Return null if no inorder successor. -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet Gupta
One thing i should mention in ques3, you have the parent pointer of node. (so left, right and parent pointers can be used) On Fri, Aug 26, 2011 at 3:22 PM, Navneet Gupta navneetn...@gmail.comwrote: Posting few questions which Playdom asked a friend of mine in telephonic interviews. He had

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet
@Neha, For your solution of 1, you needed to take m*n matrix into account. Though i think your approach should work fine even in that case. Function signature will change. For 3rd solution, the corner cases actually little non-trivial while writing code(need to consider root, root with no right

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet
Also for ques 1, instead of having four auxiliary functions, you can have a variable flag for rows and cols functions being passed as param and reduce the number to two. On Aug 26, 6:07 pm, Navneet navneetn...@gmail.com wrote: @Neha, For your solution of 1, you needed to take m*n matrix

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet
The function of that flag would be to decide direction (bottom up or top down/ left to right or otherwise) On Aug 26, 6:15 pm, Navneet navneetn...@gmail.com wrote: Also for ques 1, instead of having four auxiliary functions, you can have a variable flag for rows and cols functions being passed

[algogeeks] Re: Regarding my posts

2011-08-25 Thread Navneet
Though the problem mentioned was little on serious side, the thread turner out to be really funny :) On Aug 25, 10:31 pm, shady sinv...@gmail.com wrote: lol, then how did this one came ? On Thu, Aug 25, 2011 at 10:58 PM, Abhishek mailatabhishekgu...@gmail.comwrote: first unjoin from

[algogeeks] Given a number, return the least prime greater than number

2011-08-25 Thread Navneet Gupta
Needless to say. looking for an efficient solution rather than trying successive numbers from given number for primality. Any method? A general purpose use of above is to calculate N for hash functions. (index = key%N where N is prime). -- Regards, Navneet -- You received this message because

[algogeeks] Re: Anyone have The google resume book

2011-08-25 Thread Navneet
Yep, link is not working. On Aug 26, 12:44 am, Rahul Verma rahul08k...@gmail.com wrote: link is not working guys -- 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

[algogeeks] Re: Suggestion

2011-08-25 Thread Navneet
Ankit, i would also like to mention Mark Allan Weiss book on Data Structures. Available in both C and C++ (different books) On Aug 25, 3:59 pm, Abhishek mailatabhishekgu...@gmail.com wrote: for simplicity use, Data Structures Through C in Depth -S. K. Srivastava, Deepali Srivastava all the

[algogeeks] Directi Questions

2011-08-21 Thread navneet kumar
hi all, has Directi visited any of your campus?? if yes then can you share some details... Regards, Navneet Kumar -- Department of Information Technology, Indian Institute of Information Technology and Management Gwalior, MP, INDIA Contact no.:+91-9977935740 -- You received this message

[algogeeks] Re: any good link?

2011-08-21 Thread Navneet
geeksforgeeks.org careercup.com On Aug 21, 7:13 pm, MAC macatad...@gmail.com wrote: can anyone suggest good link to review Algos and OS concepts -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Question from Google interview

2011-08-18 Thread Navneet Gupta
be discounted. -- Regards, 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

[algogeeks] Re: Question from Google interview

2011-08-18 Thread Navneet
look for next token . On Thu, Aug 18, 2011 at 9:10 PM, Navneet Gupta navneetn...@gmail.comwrote: Given a string containing multiple words such that spaces between words is missing. Also, you have a dictionary containing valid words. Ex. Thatwouldbefantastic

[algogeeks] Re: Book

2011-08-18 Thread Navneet
My two cents on this book - Too lengthy and written more like an exhaustive tutorial rather than idea book. I purchased hard copy but sold it for didn't like it much. On Aug 19, 2:56 am, Swati Sarraf swati1...@gmail.com wrote: Hi guys, Does any one of u has the book - Data Structures and

[algogeeks] HASHTABLE - what's the big deal?

2011-08-17 Thread Navneet Gupta
to interviewers. More of a general question on applications of hash tables. -- Regards, 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

[algogeeks] Komli Media

2011-08-16 Thread Navneet Gupta
Any feedback on Komli Media? How's their compensation like for college freshers? Any interview questions you would like to share? -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Any links/resources on Recurrence Relations?

2011-08-15 Thread Navneet Gupta
Looking for a brief reference to solving recurrence relations. (Methods to deduce functions from recurrence relations) -- Regards, 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

[algogeeks] Re: Design a concurrent hash table

2011-08-15 Thread Navneet Gupta
Any takers? On Thu, Aug 11, 2011 at 3:45 PM, Navneet Gupta navneetn...@gmail.comwrote: Q. Design a concurrent hash table with as much as concurrency as possible. System has multiple readers and writers. System will crash if a reader or writer is reading or writing from a location which

[algogeeks] Re: Design a concurrent hash table

2011-08-15 Thread Navneet
Did not see i already had replies :) Yeah, from what i know, read-write locks is the way to go about achieving max concurrency. On Aug 15, 5:08 pm, Navneet Gupta navneetn...@gmail.com wrote: Any takers? On Thu, Aug 11, 2011 at 3:45 PM, Navneet Gupta navneetn...@gmail.comwrote: Q. Design

[algogeeks] Re: Non recursive preorder and postorder

2011-08-15 Thread Navneet
I think only condition given is not to use recursion, so auxiliary data structures can be used. On Aug 15, 7:30 pm, ankit sambyal ankitsamb...@gmail.com wrote: Morris in order traversal will do in order traversal without using recursion or a stack. -- You received this message because you

[algogeeks] Design a concurrent hash table

2011-08-11 Thread Navneet Gupta
question, so basically looking for strategies. -- Regards, 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

[algogeeks] Re: Help on Recursion Bit Operators related problems

2011-08-04 Thread Navneet
bit twiddling hacks, a stanford resource. http://graphics.stanford.edu/~seander/bithacks.html On Aug 4, 10:55 am, Shashank Jain shashan...@gmail.com wrote: even this is a gud 1.http://www.cprogramming.com/tutorial/bitwise_operators.html Shashank Jain IIIrd year Computer Engineering Delhi

[algogeeks] Graph Based Problems

2011-07-26 Thread Navneet Gupta
importance to graph problems. Hope this will give some folks some motivations to share/ask good graph based problems. I will try to come up with first set of questions to get things rolling. -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: Any good book on design patterns?

2011-07-25 Thread Navneet
One which many have referred me is Design Patterns - Elements of Reusable Object Oriented Software On Jul 24, 7:32 pm, Swathi chukka.swa...@gmail.com wrote: -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Book Reco for Computer Networks

2011-07-19 Thread Navneet Gupta
Looking for a book which explains networks like Bruce Eckel explains OOP :) . Enough said -- Regards, 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

[algogeeks] Add Two Numbers stored in Linked Lists

2011-07-18 Thread Navneet Gupta
Write a recursive routine to add two numbers stored in Linked List in O(n) time and return result in List 3 Lists are not to be reversed. Example: List 1 : 1 2 3 4 5 (Num1 - 12345) List 2 : 6 7 8 (Num2 - 678) List 3 (output) - 1 3 0 2 3 (12345 + 678) -- Regards, Navneet -- You

[algogeeks] Reverse a List with Recursion

2011-07-17 Thread Navneet Gupta
that. -- Regards, 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, visit

[algogeeks] Re: Reverse a List with Recursion

2011-07-17 Thread Navneet
;     } head and temp are global On Sun, Jul 17, 2011 at 2:42 PM, Navneet Gupta navneetn...@gmail.comwrote: Hi, I was trying to accomplish this task with the following call , header = ReverseList(header) I don't want to pass tail pointer or anything and just want that i get

[algogeeks] Test Mail - Plz ignore

2011-07-14 Thread Navneet Gupta
Sending a test mail after re-joining the group. Please ignore. -- Regards, 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] Max Arithmetic Subsequence

2011-07-14 Thread Navneet Gupta
It worked fine on sorted input. On Wed, Jul 13, 2011 at 5:46 AM, Navneet Gupta navneetn...@gmail.com wrote: OOPS..Bad miss :( On Tue, Jul 12, 2011 at 11:53 PM, sunny agrawal sunny816.i...@gmail.com wrote: Algorithm in the paper says works only on sorted arrays it is mentioned

[algogeeks] Image based Problem (Google)

2011-07-12 Thread Navneet Gupta
Given 1000 million x 1000 million image, What information of this image to be stored such that you can find the locations when the given image has modi cations -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Reversing the order of words in String

2011-07-12 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. -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Reversing the order of words in String

2011-07-12 Thread Navneet Gupta
:54 PM, saurabh singh saurab...@gmail.com wrote: can strlen do the same job? I doubt...? On Tue, Jul 12, 2011 at 10:51 PM, Navneet Gupta navneetn...@gmail.com wrote: @Saurabh, just to let you know, compiler actually does that. Without traversing the array (read specifying the array size

[algogeeks] Max Arithmetic Subsequence

2011-07-12 Thread Navneet Gupta
; } } while(i=1) { L[i][j] = 2; i=i-1; } } return maxLen; } -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] GOOGLE Q1

2011-07-10 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. -- Regards, Navneet -- You received this message

Re: [algogeeks] GOOGLE Q1

2011-07-10 Thread Navneet Gupta
Sorry typo below On Sun, Jul 10, 2011 at 12:49 PM, Navneet Gupta navneetn...@gmail.comwrote: Try this 1. Find the min and max in O(n) time. 2. For A.P. = mix to max/N , we find max possible subsequence. For example 1,2,3,0,4,7,19,6,8,10,24.(could be more but trying to show

Re: [algogeeks] Reversing the order of words in String

2011-07-07 Thread Navneet Gupta
at 1:19 PM, Piyush Sinha ecstasy.piy...@gmail.com wrote: @Navneettake a look at the solution below and tell if there is any bug in it... #include string.h typedef struct revll {     char s[100];     struct revll *next; }revll; revll *rev_str(char *a) {   char temp[100

Re: [algogeeks] Amazon

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

Re: [algogeeks] Reversing the order of words in String

2011-07-07 Thread Navneet Gupta
@Vishal, Don't confuse printing in reverse with actually modifying the actual string to reverse word order in it :) On Thu, Jul 7, 2011 at 3:34 PM, Vishal Thanki vishaltha...@gmail.com wrote: @Navneet, it works with multiple spaces between words.. And here is the two line solution :) import

Re: [algogeeks] Reversing the order of words in String

2011-07-07 Thread Navneet Gupta
, Jul 7, 2011 at 3:36 PM, Navneet Gupta navneetn...@gmail.com wrote: @Vishal, Don't confuse printing in reverse with actually modifying the actual string to reverse word order in it :) On Thu, Jul 7, 2011 at 3:34 PM, Vishal Thanki vishaltha...@gmail.com wrote: @Navneet, it works with multiple

Re: [algogeeks] Reversing the order of words in String

2011-07-07 Thread Navneet Gupta
Okay, I think NO EXTRA SPACE is what i should have mentioned clearly. Anyways dude, i appreciate the point of simplicity which you are trying to show. On Thu, Jul 7, 2011 at 3:45 PM, Navneet Gupta navneetn...@gmail.com wrote: I meant, having the result in same string which was used as param

[algogeeks] Usage of static extern

2011-07-07 Thread Navneet Gupta
(); return MessageBox(0, myString, My Message Box, 0); } } -- Regards, 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] Explanation

2011-07-07 Thread Navneet Gupta
://groups.google.com/group/algogeeks?hl=en. -- Regards, 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] MS Question

2011-07-06 Thread Navneet Gupta
. 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] solve this

2011-07-06 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...@googlegroups.com

Re: [algogeeks]

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

[algogeeks] Reversing the order of words in String

2011-07-06 Thread Navneet Gupta
reverseString(str, 0, str.length() - 1); //Reverse Individual words in string reverseWordsInString(str); coutstr; cin.get(); return 0; } -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Reversing the order of words in String

2011-07-06 Thread Navneet Gupta
tushicom...@gmail.com wrote: good job but how can this be done in one traversal as asked on the Adobe Interview Questions thread. On Wed, Jul 6, 2011 at 9:49 PM, Navneet Gupta navneetn...@gmail.com wrote: I think somebody on this thread has asked this question but i am not able to find

Re: [algogeeks] puzzle

2011-07-06 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. -- Regards, Navneet -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Reversing the order of words in String

2011-07-06 Thread Navneet Gupta
?? On 7/6/11, Tushar Bindal tushicom...@gmail.com wrote: I read that solution. But the same doubt as Navneet which I think you also raised i one of your posts on that thread On Wed, Jul 6, 2011 at 10:34 PM, Navneet Gupta navneetn...@gmail.comwrote: Saurabh, I understood your solution

Re: [algogeeks] Re: Some adobe interview questions.

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

2011-07-06 Thread Navneet Gupta
/group/algogeeks?hl=en. -- Regards, 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] Re: Nagarro Question

2011-07-05 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] Unique substring

2011-07-05 Thread Navneet Gupta
, 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, send email

[algogeeks] Flatten a BST to produce inorder traversal

2011-07-04 Thread Navneet Gupta
Tree has an extra pointer next apart from left and right. Objective is to set next pointer to point to node successor in the tree. Following the next pointer, we would be able to produce sorted list. Looking for both a recursive and non-recursive approach. --Navneet -- You received

Re: [algogeeks] Flatten a BST to produce inorder traversal

2011-07-04 Thread Navneet Gupta
://en.wikipedia.org/wiki/Threaded_binary_tree On Mon, Jul 4, 2011 at 11:34 PM, Navneet Gupta navneetn...@gmail.comwrote: Tree has an extra pointer next apart from left and right. Objective is to set next pointer to point to node successor in the tree. Following the next pointer, we would be able

  1   2   >