Re: [algogeeks] Logical operator question

2011-07-28 Thread sagar pareek
. 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 SAGAR PAREEK COMPUTER SCIENCE

Re: [algogeeks]

2011-07-28 Thread sagar pareek
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Re: Fwd: SORTING ARRAYS

2011-07-27 Thread sagar pareek
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Cisco ??

2011-07-27 Thread sagar pareek
Do anybody of you know what type of questions cisco ask from electronics part? Please if anybody know then tell me some sample questions. And if possible what topics should i cover? Thanks in advance -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received

Re: [algogeeks] Re: Cisco ??

2011-07-27 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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

[algogeeks] How to staore

2011-07-26 Thread sagar pareek
how can u save this value in a int type variable...without using abstract data type. 112223355569990 -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-25 Thread sagar pareek
On Sun, Jul 24, 2011 at 10:15 AM, sagar pareek sagarpar...@gmail.comwrote: nope compiler read it from left to right On Sun, Jul 24, 2011 at 12:05 AM, Arun Vishwanathan aaron.nar...@gmail.com wrote: @sagar: if what u said previously holds as in when u say y=x++ + ++x is evaluated as 4+4

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-25 Thread sagar pareek
and the ones within the bracket cos it to be 5 and then 6:Now first addition within the braces is 6+6=12 and then this is added to 6(since x was already incremented earlier) to be 18..hey it is a totally wild guess what is the right approach here?:) On Mon, Jul 25, 2011 at 12:10 PM, sagar pareek

Re: [algogeeks] preprocessor directive

2011-07-25 Thread sagar pareek
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] C Output

2011-07-25 Thread sagar pareek
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] C Output

2011-07-25 Thread sagar pareek
, swetha rahul swetharahu...@gmail.comwrote: int main() { int a[5]={1,2,3,4,5}; int *ptr=a; printf(%d,*(ptr)); getch(); } Then why this prints 1.. ?? On Mon, Jul 25, 2011 at 7:50 PM, sagar pareek sagarpar...@gmail.comwrote: here a is data type with 5*sizeof(int) so a+1

[algogeeks] Question

2011-07-25 Thread sagar pareek
than usual. In how much time does the man reach home usually? (A) 1 hr 20 min (B) 1 hr(C) 1 hr 10 min(D) 55 min -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] C ouput

2011-07-24 Thread sagar pareek
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-24 Thread sagar pareek
later) then for y=x++ + ++x + ++x with x beginning as 3 shud the expression not be evaluated as 5+5+4( from rhs ++x does a 3 to 4 and another ++x does 4 to 5 and 5 is used in x++) .later x becomes 6 ? On Sat, Jul 23, 2011 at 2:39 PM, sagar pareek sagarpar...@gmail.comwrote: sorry for above

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-23 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-23 Thread sagar pareek
, 2011 at 6:09 PM, sagar pareek sagarpar...@gmail.com wrote: yup but what about this x=4; y= x++ + ++x + ++x; // it is executed as:- during first addition, increase the value of x, now first addition will be 4+4 + ++x; now for second addition it will be like 8+5 hence final value of y=13

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-23 Thread sagar pareek
...@gmail.com wrote: @sagar would it get evaluated like this ? supposing x = 3; y = x++ + ++x; becomes y = (x=x+1) + (x=x+1); then x=x+1; so x = 5, y = 8; On Sat, Jul 23, 2011 at 2:48 PM, sagar pareek sagarpar...@gmail.comwrote: @Venga if u are doing this y= x++ + ++x; //x=3 then it would

Re: [algogeeks] C ouput

2011-07-23 Thread sagar pareek
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: Microsoft Question!

2011-07-22 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed

Re: [algogeeks] Re: Puzzle and solution

2011-07-22 Thread sagar pareek
thanks its almost same :) i was hoping for a diff answer (if exists) On Fri, Jul 22, 2011 at 4:25 PM, Rajeev Kumar rajeevprasa...@gmail.comwrote: Please check this : http://www.techinterview.org/post/526313890/bad-king On Tue, Jul 19, 2011 at 8:43 PM, sagar pareek sagarpar...@gmail.comwrote

Re: [algogeeks] Re: Contiguous subarray with sum zero

2011-07-21 Thread sagar pareek
location) form the required string.. On Thu, Jul 21, 2011 at 12:43 AM, sagar pareek sagarpar...@gmail.comwrote: how collision occur at 14 and 20 actually i m not getting hash function Thanks in advance On Thu, Jul 21, 2011 at 12:39 AM, Kamakshii Aggarwal kamakshi...@gmail.com wrote

Re: [algogeeks] Adobe ques

2011-07-21 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You

Re: [algogeeks] Re: MS

2011-07-20 Thread sagar pareek
oh common mine is log(k) too... i m taking only k elements On Wed, Jul 20, 2011 at 1:01 PM, Dumanshu duman...@gmail.com wrote: check the above solution.. urs is O(logn) mine is O(log k). On Jul 19, 11:35 pm, sagar pareek sagarpar...@gmail.com wrote: well i dont think so...any better

Re: [algogeeks] Re: Contiguous subarray with sum zero

2011-07-20 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Re: Contiguous subarray with sum zero

2011-07-20 Thread sagar pareek
On Thu, Jul 21, 2011 at 12:06 AM, sagar pareek sagarpar...@gmail.comwrote: @ankur pls explain through an example by taking above problem. On Wed, Jul 20, 2011 at 10:52 PM, SAMMM somnath.nit...@gmail.comwrote: Nice solution dude . Like that one -- You

Re: [algogeeks] Re: Contiguous subarray with sum zero

2011-07-20 Thread sagar pareek
, Jul 21, 2011 at 12:06 AM, sagar pareek sagarpar...@gmail.comwrote: @ankur pls explain through an example by taking above problem. On Wed, Jul 20, 2011 at 10:52 PM, SAMMM somnath.nit...@gmail.comwrote: Nice solution dude . Like that one -- You received

Re: [algogeeks] Re: Contiguous subarray with sum zero

2011-07-20 Thread sagar pareek
, Jul 21, 2011 at 12:06 AM, sagar pareek sagarpar...@gmail.comwrote: @ankur pls explain through an example by taking above problem. On Wed, Jul 20, 2011 at 10:52 PM, SAMMM somnath.nit...@gmail.comwrote: Nice solution dude . Like that one -- You received

Re: [algogeeks] Amazon

2011-07-19 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT

Re: [algogeeks] Some basic bit fiddling

2011-07-19 Thread sagar pareek
is greater than the width of the variable.So I checked on ideone http://ideone.com/Dwof8 On Tue, Jul 19, 2011 at 10:29 AM, sagar pareek sagarpar...@gmail.comwrote: anybody pls if know give the answer On Tue, Jul 19, 2011 at 8:02 AM, Neeraj Gupta neeraj.gupta...@gmail.comwrote: UB. http

Re: [algogeeks] Re: Ever growing sorted linked list

2011-07-19 Thread sagar pareek
...?? On Mon, Jul 18, 2011 at 9:55 PM, sagar pareek sagarpar...@gmail.com wrote: Update on 2nd line 2.if( ptr2=ptr1-next-next...(5 or 10 times) ) goto 3. else make linear search till NULL encounter and exit with the solution On Mon, Jul 18

Re: [algogeeks] Re: Amazon

2011-07-19 Thread sagar pareek
://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Re: INFINITY

2011-07-19 Thread sagar pareek
://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Re: INFINITY

2011-07-19 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Solve it

2011-07-19 Thread sagar pareek
] = a[0] and S[1] = max(a[0],a[1]) 2. for i:2 to n-1 S[i] = max(S[i-2]+a[i], S[i-1]) 3. return S[n-1] Hope the above algo works... On Tue, Jul 19, 2011 at 2:59 PM, sagar pareek sagarpar...@gmail.comwrote: Given an array all of whose elements are positive numbesr, find the maximum

Re: [algogeeks] Solve it

2011-07-19 Thread sagar pareek
(sum of 3,5,7) -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Solve it

2011-07-19 Thread sagar pareek
oh yeah my misunderstanding sorry On Tue, Jul 19, 2011 at 4:33 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I think 6+4+3 6+4+2 On Tue, Jul 19, 2011 at 4:30 PM, sagar pareek sagarpar...@gmail.comwrote: Piyush sorry dude but this will not work say original array be 6 8 4 1 2 3

Re: [algogeeks] Solve it

2011-07-19 Thread sagar pareek
well thanks for the solution On Tue, Jul 19, 2011 at 4:34 PM, sagar pareek sagarpar...@gmail.com wrote: oh yeah my misunderstanding sorry On Tue, Jul 19, 2011 at 4:33 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I think 6+4+3 6+4+2 On Tue, Jul 19, 2011 at 4:30 PM, sagar pareek

Re: [algogeeks] Solve it

2011-07-19 Thread sagar pareek
@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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message

Re: [algogeeks] Re: GETS

2011-07-19 Thread sagar pareek
this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Re: INFINITY

2011-07-19 Thread sagar pareek
wrote: printf(\u221E\n); On Tue, Jul 19, 2011 at 4:10 PM, SAMMM somnath.nit...@gmail.com wrote: Yaa guys it hav something to do with UNICODE ... I know that On Jul 19, 3:32 pm, sagar pareek sagarpar...@gmail.com wrote: yeah in my ubuntu too its not printing

Re: [algogeeks] Re: Amazon

2011-07-19 Thread sagar pareek
Sorry for my previous post i got the solution now :) On Tue, Jul 19, 2011 at 6:29 PM, sagar pareek sagarpar...@gmail.com wrote: Yeah i saw that solution but question is to divide the traingle in 5 equals *TRIANGLES *not 5 equal parts On Tue, Jul 19, 2011 at 5:57 PM, varun pahwa varunpahwa2

[algogeeks] Puzzle and solution

2011-07-19 Thread sagar pareek
(note:- here ^= power) if anyone have more general solution pls let me know *I hope this is useful :) :)* -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

[algogeeks] Re: Puzzle and solution

2011-07-19 Thread sagar pareek
hey guys pls tell any other better solution ... On Tue, Jul 19, 2011 at 6:41 PM, sagar pareek sagarpar...@gmail.com wrote: Question :- Once upon a time in ancient times there was a king who was very fond of wines. He had a huge cellar, which had 1000 different varieties of wine all

Re: [algogeeks] MS

2011-07-19 Thread sagar pareek
email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: Find the missing number - Again given 4 billion integers

2011-07-18 Thread sagar pareek
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. -- **Regards SAGAR

Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread sagar pareek
. 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed

Re: [algogeeks] Long string and the first non-repeating character

2011-07-18 Thread sagar pareek
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Ever growing sorted linked list

2011-07-18 Thread sagar pareek
Update on 2nd line 2.if( ptr2=ptr1-next-next...(5 or 10 times) ) goto 3. else make linear search till NULL encounter and exit with the solution On Mon, Jul 18, 2011 at 7:41 PM, sagar pareek sagarpar...@gmail.com wrote: i have one approach :- first compare root-data and k if k

Re: [algogeeks] Re: Long string and the first non-repeating character

2011-07-18 Thread sagar pareek
. i.e. arr[str[i]]++; Now traverse the string again and print out the first character encountered whose arr[str[i]] == 1; On Jul 18, 9:20 pm, sagar pareek sagarpar...@gmail.com wrote: Very good solution :- but space complexity = O(26) take integer array arr[0-25] and initialise it with 0

Re: [algogeeks] Find the Row ..

2011-07-18 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received

Re: [algogeeks] Ever growing sorted linked list

2011-07-18 Thread sagar pareek
...??or i understood wrongly...?? On Mon, Jul 18, 2011 at 9:55 PM, sagar pareek sagarpar...@gmail.com wrote: Update on 2nd line 2.if( ptr2=ptr1-next-next...(5 or 10 times) ) goto 3. else make linear search till NULL encounter and exit with the solution On Mon, Jul 18, 2011 at 7

Re: [algogeeks] Find the Row ..

2011-07-18 Thread sagar pareek
, sunny agrawal sunny816.i...@gmail.comwrote: oh common thats what have been discussed above :P On Mon, Jul 18, 2011 at 10:52 PM, sagar pareek sagarpar...@gmail.comwrote: oh common its a very tricky question take 6 variables min0,min1,min2 for 1st 3 rows and corresponding max0,max1,max2

Re: [algogeeks] how this output is obtained ?

2011-07-18 Thread sagar pareek
=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Re: how this output is obtained ?

2011-07-18 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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

[algogeeks] Amazon

2011-07-18 Thread sagar pareek
of the tournament if he/she loses a game), how many games need to be conducted to determine a winner of the tournament. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Re: how this output is obtained ?

2011-07-18 Thread sagar pareek
what?? On Tue, Jul 19, 2011 at 10:39 AM, saurabh singh saurab...@gmail.com wrote: Your answer lies in the above few posts:) On Tue, Jul 19, 2011 at 10:37 AM, sagar pareek sagarpar...@gmail.comwrote: z=++x+x++ //with x=2 gives z=6 and x=4 On Tue, Jul 19, 2011 at 10:32 AM, rogu3

Re: [algogeeks] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-17 Thread sagar pareek
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Re: Microsoft Interview Qn

2011-07-17 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Microsoft Qn: Algo to find the border of a binary tree

2011-07-17 Thread sagar pareek
swetharahu...@gmail.comwrote: @Reynald Will 75 not be included in the tree that u have given..?? On Sun, Jul 17, 2011 at 12:49 AM, sagar pareek sagarpar...@gmail.comwrote: here is the code void border(node*); void recur(node*); void border(node *ptr) { node

Re: [algogeeks] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-17 Thread sagar pareek
OK On Sun, Jul 17, 2011 at 2:59 PM, saurabh singh saurab...@gmail.com wrote: 9 1 is analogous to 1 9...And the question requires only two nodes,it does not says about all such pairs. On Sun, Jul 17, 2011 at 2:52 PM, sagar pareek sagarpar...@gmail.comwrote: OK... suppose our tree

Re: [algogeeks] Microsoft Qn: Algo to find the border of a binary tree

2011-07-17 Thread sagar pareek
class,one simple question on array. On Sun, Jul 17, 2011 at 3:42 PM, sagar pareek sagarpar...@gmail.comwrote: @reynaled :- Happy to help @Sameer :- Thanks for pointing out and i think all you guyz now can optimize it :) On Sun, Jul 17, 2011 at 11:35 AM, sameer.mut...@gmail.com sameer.mut

Re: [algogeeks] Re: Microsoft Interview Qn

2011-07-17 Thread sagar pareek
This can be done using single array too... :) :) Do anybody wants the code? On Sun, Jul 17, 2011 at 3:04 PM, sagar pareek sagarpar...@gmail.com wrote: This can be done like this 1. find out the height of the tree 2. make the number of arrays(node* pointers)=height of tree 3. traverse

Re: [algogeeks] Microsoft Qn: Algo to find the border of a binary tree

2011-07-17 Thread sagar pareek
know abt the results but one thing for sure get your basic first right and than do the weird question On Sun, Jul 17, 2011 at 3:53 PM, sagar pareek sagarpar...@gmail.comwrote: Yeah best of luck saurabh whaen results will be out? On Sun, Jul 17, 2011 at 3:47 PM, sourabh jakhar sourabhjak

Re: [algogeeks] Microsoft Qn: Algo to find the border of a binary tree

2011-07-17 Thread sagar pareek
@prasanth Trie will be used... :) :) On Sun, Jul 17, 2011 at 5:28 PM, sagar pareek sagarpar...@gmail.com wrote: @saurabh Ok... on 20th amazon is coming :) On Sun, Jul 17, 2011 at 4:35 PM, prasanth n nprasnt...@gmail.com wrote: @sourabh jakhar: how to design that big int class

Re: [algogeeks] Microsoft Qn: Algo to find the border of a binary tree

2011-07-17 Thread sagar pareek
yeah it can be On Sun, Jul 17, 2011 at 6:47 PM, prasanth n nprasnt...@gmail.com wrote: @sagar pareek: we cant use linked list ah?? On Sun, Jul 17, 2011 at 6:44 PM, sagar pareek sagarpar...@gmail.comwrote: kk... On Sun, Jul 17, 2011 at 5:31 PM, sourabh jakhar sourabhjak

Re: [algogeeks] Re: Puzzle

2011-07-17 Thread sagar pareek
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread sagar pareek
. 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread sagar pareek
, Nikhil Gupta nikhilgupta2...@gmail.com wrote: @Aditya Here is the padding effect : Address of char : starts anywhere Address of long double : starts at 11 address locations from char variable -- 1+11+12=24 bytes On Mon, Jul 18, 2011 at 1:10 AM, sagar pareek sagarpar...@gmail.comwrote

Re: [algogeeks] In-memory dictionary

2011-07-17 Thread sagar pareek
. 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you

Re: [algogeeks] Re: Dynamic Programming Cormen

2011-07-16 Thread sagar pareek
/algogeeks/-/vBP5ZdFV9HEJ. 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 SAGAR PAREEK

Re: [algogeeks] Image Based Problem (Google)

2011-07-16 Thread sagar pareek
/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Printf ...

2011-07-16 Thread sagar pareek
SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Printf ...

2011-07-16 Thread sagar pareek
and o/p is %#s Zi not %s Zi On Sat, Jul 16, 2011 at 2:18 PM, sagar pareek sagarpar...@gmail.com wrote: @Kamakhsi In my ubuntu gcc this o/p is coming with warning of undefined %# :) On Sat, Jul 16, 2011 at 5:43 AM, sukhmeet singh sukhmeet2...@gmail.comwrote: @Anatony the output

Re: [algogeeks] Printf ...

2011-07-16 Thread sagar pareek
tell me your output pls On Sat, Jul 16, 2011 at 2:19 PM, sagar pareek sagarpar...@gmail.com wrote: and o/p is %#s Zi not %s Zi On Sat, Jul 16, 2011 at 2:18 PM, sagar pareek sagarpar...@gmail.comwrote: @Kamakhsi In my ubuntu gcc this o/p is coming with warning of undefined

Re: [algogeeks] Printf ...

2011-07-16 Thread sagar pareek
; ^ ^ increment only ^ b's now ++b + ++b*10 + 7*100; ^ now increase ^ b also as 8 + 8*10 + 700 788 try different combinations also like a=5; ++a + (++a + ++a); // this give answer=24 :) On Sat, Jul 16, 2011 at 2:24 PM, sagar pareek sagarpar...@gmail.com wrote: tell me your output pls

Re: [algogeeks] MS:Linked list

2011-07-16 Thread sagar pareek
this solution but it was strictly asked to do in O(n) time and O(1) space complexity and what if range of numbers is very large On Sat, Jul 16, 2011 at 1:09 AM, sagar pareek sagarpar...@gmail.comwrote: You just need to maintain the array for the odd words which encountered during traversing

Re: [algogeeks] MS:Linked list

2011-07-16 Thread sagar pareek
yup :) On Sat, Jul 16, 2011 at 4:17 PM, Nishant Mittal mittal.nishan...@gmail.comwrote: @sagar it will take O(n2) if all the elements of linked list are odd and distinct.. On Sat, Jul 16, 2011 at 4:06 PM, sagar pareek sagarpar...@gmail.comwrote: i have solution with no extra space

Re: [algogeeks] Merge unsorted arrays

2011-07-16 Thread sagar pareek
. 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you

Re: [algogeeks] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-16 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-16 Thread sagar pareek
steps until it got to root_left, whereupon F + R = K. Dave On Jul 16, 11:40 am, sagar pareek sagarpar...@gmail.com wrote: @dave what if the k= root-left + right most leaf ? how ur algo works on it? On Sat, Jul 16, 2011 at 9:28 PM, Dave dave_and_da...@juno.com wrote: @Noobcoder

Re: [algogeeks] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-16 Thread sagar pareek
and so it must not be O(n) On Sat, Jul 16, 2011 at 10:54 PM, sagar pareek sagarpar...@gmail.comwrote: ok i got it actually u written wrong that f/w and reverse traversal are running parallel u must wrote that f/w traversal inside reverse or vice versa On Sat, Jul 16, 2011 at 10:35 PM

Re: [algogeeks] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-16 Thread sagar pareek
simultaneously, with each one being advanced in certain circumstances, and that in order to do that you would have to use explicit stacks instead of recursion. Perhaps, instead, you misread or misunderstood it. Dave On Jul 16, 12:24 pm, sagar pareek sagarpar...@gmail.com wrote: ok i got

Re: [algogeeks] Re: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.

2011-07-16 Thread sagar pareek
You must take an example and then explain On Sat, Jul 16, 2011 at 11:59 PM, Dave dave_and_da...@juno.com wrote: @Sagar: If you are not getting my logic, ask a question. Dave On Jul 16, 12:35 pm, sagar pareek sagarpar...@gmail.com wrote: Ok may be i m not getting ur logic

Re: [algogeeks] Microsoft Qn: Algo to find the border of a binary tree

2011-07-16 Thread sagar pareek
://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Microsoft Qn: Algo to find the border of a binary tree

2011-07-16 Thread sagar pareek
in the tree that u have given..?? On Sun, Jul 17, 2011 at 12:49 AM, sagar pareek sagarpar...@gmail.comwrote: here is the code void border(node*); void recur(node*); void border(node *ptr) { node* tmp; int stack[20],top=0; if(tmp=ptr-left) { while(tmp-left) { printf(%d ,tmp-data

Re: [algogeeks] What is the output of the following program? Why?

2011-07-16 Thread sagar pareek
. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] What is the output of the following program? Why?

2011-07-16 Thread sagar pareek
://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Whats wrong?

2011-07-15 Thread sagar pareek
, 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD

Re: [algogeeks] Printf ...

2011-07-15 Thread sagar pareek
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. -- **Regards SAGAR PAREEK COMPUTER SCIENCE

Re: [algogeeks] Re: Image based Problem (Google)

2011-07-15 Thread sagar pareek
/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] X-AmazoN

2011-07-15 Thread sagar pareek
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] X-AmazoN

2011-07-15 Thread sagar pareek
oh sorry... On Fri, Jul 15, 2011 at 3:21 PM, sunny agrawal sunny816.i...@gmail.comwrote: @sagar did you read the question before posting On Fri, Jul 15, 2011 at 3:17 PM, sagar pareek sagarpar...@gmail.comwrote: int a=(int)rand()%1001; //1-1000 int b=(int)rand()%2; // 0-1 On Fri, Jul

Re: [algogeeks] MS:Linked list

2011-07-15 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google

Re: [algogeeks] C OUTPUT HELP

2011-07-14 Thread sagar pareek
://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] # References !!!!

2011-07-14 Thread sagar pareek
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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received

Re: [algogeeks] Re: Image based Problem (Google)

2011-07-14 Thread sagar pareek
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Whats wrong?

2011-07-14 Thread sagar pareek
members stored in memory. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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] Re: Precedence of operators

2011-07-13 Thread sagar pareek
. 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you

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

2011-07-12 Thread sagar pareek
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Re: Puzzle

2011-07-12 Thread sagar pareek
://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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

<    1   2   3   4   >