Re: [algogeeks] Re: Novell - Puzzle

2011-07-31 Thread Shubham Maheshwari
for the cows ques ... you all are forgetting to add the orginal starting cow ... thus the answer should be *233* On Sun, Jul 31, 2011 at 1:30 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Oops. My bad. Rabbits produce every month too. I overlooked that. On Sun, Jul 31, 2011 at 1:24 PM,

Re: [algogeeks] 32 bit?

2011-07-31 Thread Shubham Maheshwari
if OS installed is of 32 bit ... then compiler will work as working on a 32 bit architecture ... and give the results accordingly ... @aditi :: i am not so sure abt your stateent regarding the size of pointer and an int being th same ... could you plzz quote the reference for the same ... On

Re: [algogeeks] Direct - i ques

2011-07-31 Thread Shubham Maheshwari
use a doubly linked list ... with a field node *min. weneva you insert an element ... check for the value of min at the head ... if the new inserted node has less value ... then set the min field to point to itself else copy the min field of te previous head. insertion and deletion is easy

Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread Shubham Maheshwari
its a *doubly* linked list ... you can easily do the job ... On Sun, Jul 31, 2011 at 2:23 PM, siva viknesh sivavikne...@gmail.comwrote: using LL u cant delete in O(1) ... u have to traverse from head On Jul 31, 1:47 pm, Shubham Maheshwari shubham@gmail.com wrote: use a doubly linked

Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread Shubham Maheshwari
you mean circular linked list ...!!! in case of stack ... we cn do it via SSL ... for a queue implementation ... we will ned circular, or doubly for deletion in O(1). On Sun, Jul 31, 2011 at 2:38 PM, naveen ms naveenms...@gmail.com wrote: @shubham...i have a doubt.can't the same be done with

Re: [algogeeks] Morgan stanely interview ques

2011-07-31 Thread Shubham Maheshwari
color and intensity are2 different things ... do you mean to find pixels with same intensity ...!! and wat is meant by can be reached ...!! On Sun, Jul 31, 2011 at 2:40 PM, sivaviknesh s sivavikne...@gmail.comwrote: *Given an nxn screen, Each pixel is represented by intensity values. Given a

Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread Shubham Maheshwari
hw cn u ensure that the elements are inserted in sorted order ... wat if the elements are coming randmly ... On Sun, Jul 31, 2011 at 2:49 PM, muthu raj muthura...@gmail.com wrote: Use a circular linked list with elements being inserted in sorted order. Inserting minimum element :

Re: [algogeeks] BST

2011-07-31 Thread Shubham Maheshwari
take countr to be a static variable ... that shud do the job ...!! btw ...if thats nt the case ... thn i m nt pretty sure wat u are asking to be done ... On Sun, Jul 31, 2011 at 2:12 AM, Rahul Mittal rahulmitta...@gmail.comwrote: help me with this we need to find out how many times a function

Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread Shubham Maheshwari
will take O(n) time. On Sun, Jul 31, 2011 at 3:00 PM, Shubham Maheshwari shubham@gmail.com wrote: hw cn u ensure that the elements are inserted in sorted order ... wat if the elements are coming randmly ... On Sun, Jul 31, 2011 at 2:49 PM, muthu raj muthura...@gmail.com wrote: Use

Re: [algogeeks]

2011-07-31 Thread Shubham Maheshwari
http://ideone.com/IZKyN could you plzz explain this to me ...!! anyone ... On Sun, Jul 31, 2011 at 1:56 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: @sanchit:no,not at all :) On Sun, Jul 31, 2011 at 1:55 AM, Sanchit Manchanda sanchit...@gmail.comwrote: @kamakshi- sorry if you felt

Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread Shubham Maheshwari
and finding the minimum element all have O(1) time. so after deleting the minimum element, where will you point min pointer? Sorry if i m wrong On Sun, Jul 31, 2011 at 3:11 PM, Shubham Maheshwari shubham@gmail.com wrote: the operation is nt extract min ... its *find* min ... On Sun

Re: [algogeeks] Re: Microsoft Question!

2011-07-22 Thread Shubham Maheshwari
x = 0; while( n ){ x = 1; x = x | ( n 1); n = 1; } return x; On Fri, Jul 22, 2011 at 1:31 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: sorry guys.. dont check the above siolution.. its wrong...!!! misread it.. On 7/22/11, Puneet Gautam puneet.nsi...@gmail.com wrote: check this out:

Re: [algogeeks] Re: Microsoft Question!

2011-07-22 Thread Shubham Maheshwari
thnx ... :D On Fri, Jul 22, 2011 at 9:19 PM, sagar pareek sagarpar...@gmail.com wrote: gr8 shubham On Fri, Jul 22, 2011 at 1:42 PM, Shubham Maheshwari shubham@gmail.com wrote: x = 0; while( n ){ x = 1; x = x | ( n 1); n = 1; } return x; On Fri, Jul 22, 2011 at 1:31 PM

Re: [algogeeks] Interview Puzzle - 100 Prisoners and Caps

2011-07-22 Thread Shubham Maheshwari
could some1 plz post the xplainations ... On Fri, Jul 22, 2011 at 8:04 PM, Pankaj jatka.oppimi...@gmail.com wrote: Chetan, No. How could you relate this problem with that? Do you find something similar? ~ Pankaj On Fri, Jul 22, 2011 at 8:01 PM, chetan kapoor

Re: [algogeeks] Re: subwords in a given word!

2011-07-22 Thread Shubham Maheshwari
how are you gonna do it if the originl strng contains repeated letters ... On Fri, Jul 22, 2011 at 3:33 PM, shady sinv...@gmail.com wrote: what algorithm, print it subsequently is there any ? On Fri, Jul 22, 2011 at 3:24 PM, DeeJJ..! suryaprakash...@gmail.comwrote: @sunny...yaa..but

Re: [algogeeks] Re: Amazon ques

2011-07-20 Thread Shubham Maheshwari
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. -- Shubham Maheshwari ShubZz O.o o.O

Re: [algogeeks] is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-18 Thread Shubham Maheshwari
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. -- Shubham Maheshwari ShubZz O.o o.O enJoY ...!!! -- You received this message

Re: [algogeeks] is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-18 Thread Shubham Maheshwari
can we do anything else .. othr than hash tables ... On Tue, Jul 19, 2011 at 1:05 AM, Saket Choudhary sake...@gmail.com wrote: Have a hash Table. Read the elements and push it to the hash table. If it alraedy exists you are done. On 19 July 2011 01:02, Shubham Maheshwari shubham.veloc

Re: [algogeeks] is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-18 Thread Shubham Maheshwari
in a unless b.include?(m) bm else puts m break end end On 19 July 2011 01:05, Saket Choudhary sake...@gmail.com wrote: Have a hash Table. Read the elements and push it to the hash table. If it alraedy exists you are done. On 19 July 2011 01:02, Shubham Maheshwari

Re: [algogeeks] static vs dynamic array

2011-07-18 Thread Shubham Maheshwari
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Shubham Maheshwari ShubZz O.o o.O enJoY ...!!! -- You received this message because you are subscribed to the Google Groups Algorithm

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

2011-07-17 Thread Shubham Maheshwari
Maheshwari shubham.veloc...@gmail.com wrote: :D On Sun, Jul 17, 2011 at 2:24 AM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: @shubham:yes u r right.thanks :) On Sun, Jul 17, 2011 at 2:12 AM, Shubham Maheshwari shubham.veloc...@gmail.com wrote: @Kamakshii: thats probably becuz a union

Re: [algogeeks] Re: Finding the Kth Prime

2011-07-17 Thread Shubham Maheshwari
://groups.google.com/group/algogeeks?hl=en. -- Shubham Maheshwari ShubZz O.o o.O enJoY ...!!! -- 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] Microsoft Qn: Algo to find the border of a binary tree

2011-07-16 Thread Shubham Maheshwari
. 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. -- Shubham Maheshwari ShubZz O.o o.O enJoY

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

2011-07-16 Thread Shubham Maheshwari
union Data Type What is the output of the following program? Why? #include main() { typedef union { int a; char b[10]; float c; } Union; Union x,y = {100}; x.a = 50; strcpy(x.b,hello); x.c = 21.50; printf(Union x : %d %s %f n,x.a,x.b,x.c); printf(Union y : %d %s %f n,y.a,y.b,y.c); } -- Shubham

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

2011-07-16 Thread Shubham Maheshwari
you mean to say .. the ques is wrong ... or what ...!! On Sun, Jul 17, 2011 at 1:54 AM, sagar pareek sagarpar...@gmail.com wrote: I think you must first read about unions and the differences between union and structures :) On Sun, Jul 17, 2011 at 1:48 AM, Shubham Maheshwari shubham.veloc

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

2011-07-16 Thread Shubham Maheshwari
of 100. On Sun, Jul 17, 2011 at 1:58 AM, Shubham Maheshwari shubham.veloc...@gmail.com wrote: you mean to say .. the ques is wrong ... or what ...!! On Sun, Jul 17, 2011 at 1:54 AM, sagar pareek sagarpar...@gmail.comwrote: I think you must first read about unions and the differences