Re: [algogeeks] Data Structure

2012-09-18 Thread Sagar Pareek
String hashing

On Tue, Sep 18, 2012 at 5:21 PM, Ashish Goel ashg...@gmail.com wrote:

 stack

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652



 On Tue, Sep 18, 2012 at 3:55 PM, Sheetal Naidu kartiknaid...@gmail.comwrote:

 sqlite database for mozilla...maybe hashtable


 On 18 September 2012 13:20, Navin Kumar algorithm.i...@gmail.com wrote:


 Which data structure is used to maintain browser history?

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/MCj-0bFwvV0J.
 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.




 --
 - A.Sheetal
   B.tech, Final yr,
   Department Of Information Technology,
   NIT, Durgapur

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 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.


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




-- 
**KIND 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Need help regarding threads

2012-04-01 Thread Sagar Pareek
It was telling that error after doing some modifications...
Yeah i think bharat u r saying correct...
I will try it...
Thanks for reply...

On Sat, Mar 31, 2012 at 11:45 AM, bharat b bagana.bharatku...@gmail.comwrote:

 u should get an error: argument of type ‘void* (TraCISagar::)(void*)’ does
 not match ‘void* (*)(void*)’ ...
 The function which is threaded should be either static or global in
 pthread implementation ...


 On Tue, Mar 27, 2012 at 7:20 PM, Sagar Pareek sagarpar...@gmail.comwrote:

 Thanks for reply
 but tell me two thing , is it true or not?
 is NULL is not equal to (void*)0 ??
 AND
 int a=20;
 int b=(int)a ;  // Whats wrong in here??

 Similarly for
 void * TraCISagar::sender(void* a);

 then while calling in pthread as
  pthread_create(thread1,NULL,(void*)sender,NULL)
 instead of
  pthread_create(thread1,NULL,sender,NULL);


 by the way i already implemented NULL instead of (void*)0
 and
 pthread_create(thread1,NULL,sender,NULL);

 But not getting why this problem is occurring?


 On Tue, Mar 27, 2012 at 8:37 AM, SAMM somnath.nit...@gmail.com wrote:

 Yaa Senthil is right , I overlooked it . In 3rd argument also it is
 expecting an address while u r passing the pointer .

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




 --
 **KIND 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...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 **Regards
 *
 * bagana.bharatku...@gmail.com

 Bharat B | M.Tech II  | C.S.E | IITM
 *
 *
 *Ph: +91 8056127652*


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




-- 
**KIND 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Need help regarding threads

2012-03-27 Thread Sagar Pareek
Thanks for reply
but tell me two thing , is it true or not?
is NULL is not equal to (void*)0 ??
AND
int a=20;
int b=(int)a ;  // Whats wrong in here??

Similarly for
void * TraCISagar::sender(void* a);

then while calling in pthread as
 pthread_create(thread1,NULL,(void*)sender,NULL)
instead of
 pthread_create(thread1,NULL,sender,NULL);


by the way i already implemented NULL instead of (void*)0
and
pthread_create(thread1,NULL,sender,NULL);

But not getting why this problem is occurring?

On Tue, Mar 27, 2012 at 8:37 AM, SAMM somnath.nit...@gmail.com wrote:

 Yaa Senthil is right , I overlooked it . In 3rd argument also it is
 expecting an address while u r passing the pointer .

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




-- 
**KIND 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Need help regarding threads

2012-03-26 Thread Sagar Pareek
Hello all,
I need help regarding thread implementation in C++

Here is my sample code...

*class TraCISagar : public BasicModule1 {
public:
.
.
void activity();
void* sender(void*);
.
.
};

void* TraCISagar::sender(void* a)
{
.
.
.
}

void TraCISagar::activity()
{
  pthread_t thread1;
.
.
pthread_create(thread1,NULL,(void*)sender,(void*)0);   //problem coming
here
.
.
pthread_join(thread1,NULL);
}

int main()
{
.
.
.
.
}*

And error is invalid use of member (did you forget the ‘’ ?)
Do anyone of you know how to solve it?


-- 
**KIND 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-13 Thread sagar pareek
Thanks Dave, Don and all others for this clarification.

On Mon, Dec 12, 2011 at 11:23 PM, Prakash D cegprak...@gmail.com wrote:

 only the number of comparisons is log(n)


 On Mon, Dec 12, 2011 at 11:04 PM, Ankur Garg ankurga...@gmail.com wrote:

 Agree with dave..Its still O(n)


 On Mon, Dec 12, 2011 at 10:57 PM, Dave dave_and_da...@juno.com wrote:

 @Sagar: Don is correct. n/2+n/4+n/8+... ~= n. But even the first
 round, involving n/2 comparisons, is O(n).

 Dave

 On Dec 12, 11:23 am, sagar pareek sagarpar...@gmail.com wrote:
  Yes Mr. DoN
 
  First round of Tournament sort results in log(n) time for finding
 largest
  no.
 
  n/2+n/4+n/8   results n/(2^i)   where ^ = power
 
 
 
 
 
  On Mon, Dec 12, 2011 at 8:16 AM, Don dondod...@gmail.com wrote:
   No. To find the largest number in an unsorted array requires looking
   at each number, which is order n by definition.
   Don
 
   On Dec 12, 10:02 am, sagar pareek sagarpar...@gmail.com wrote:
Hi every one.
 
Can we find largest number from an unsorted array in log(n) ?
 
--
**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...@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 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.


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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



[algogeeks] Find Largest number in log(n)

2011-12-12 Thread sagar pareek
Hi every one.


Can we find largest number from an unsorted array in log(n) ?

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



[algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread sagar pareek
I think...
First round of tournament sort. :D

On Mon, Dec 12, 2011 at 8:02 AM, sagar pareek sagarpar...@gmail.com wrote:

 Hi every one.


 Can we find largest number from an unsorted array in log(n) ?

 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread sagar pareek
Yes Mr. DoN

First round of Tournament sort results in log(n) time for finding largest
no.

n/2+n/4+n/8   results n/(2^i)   where ^ = power

On Mon, Dec 12, 2011 at 8:16 AM, Don dondod...@gmail.com wrote:

 No. To find the largest number in an unsorted array requires looking
 at each number, which is order n by definition.
 Don

 On Dec 12, 10:02 am, sagar pareek sagarpar...@gmail.com wrote:
  Hi every one.
 
  Can we find largest number from an unsorted array in log(n) ?
 
  --
  **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...@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 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.



Re: [algogeeks] Hired by Symantec :) :)

2011-10-01 Thread sagar pareek
cONGRATES

On Sat, Oct 1, 2011 at 7:34 PM, rahul sharma rahul23111...@gmail.comwrote:


 congrats buddy

 On Sat, Oct 1, 2011 at 6:51 PM, siva viknesh sivavikne...@gmail.comwrote:

   I should definitely thank this group and all its members. This
 group played a vital role in my placement preparations and surely it
 was an excellent doubt clearing group.

   To mention some instance I read about mutex and semaphore in many
 sites which is not so good, but in this group, some of the members
 gave mind-blowing awesome explanations..which on the very next day a
 company asked a question applying a similar concept.

   Thanks a lot ppl :) U helped me a lot directly or indirectly in
 getting me placed :)

  Will soon come up with my detailed interview experiences.

 Proud to be one of the moderators of this group :)

 Wish all final years get dream offers :)

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Flip kart

2011-09-23 Thread sagar pareek
thanx a ton
one more query...
was mcq is in online test?

On Fri, Sep 23, 2011 at 1:54 AM, aditya kumar
aditya.kumar130...@gmail.comwrote:

 those three question they ASKD me in interview nt in coding round n they
 are very particular abt coding


 On Fri, Sep 23, 2011 at 1:53 AM, aditya kumar 
 aditya.kumar130...@gmail.com wrote:

 11.5 fr our college
 they will hve online test .. 3 coding question and u need to attempnt any
 two ..25mcq's .. mcq;s wer mostly frm sql ..
  Q- Given a linked list find whether the linked list is palindrome or
 not. I gave him solution by modifying the linked list then i gave solution
 using extra
 space then i gave solution using recursion. First i gave complexity as
 O(n^2) using brute force. He asked me to reduce the complexity then i moved
 on to
 modify the linked list itself, he told me not to modify the linked list.
 Then i went for the extra linked list. Then he asked me not to use extra
 space and
 finally i came up with a recursive solution. And he was very much happy
 after seeing the recursive solution, i think thats wat he was looking for.
 Q- I was asked to do a level order traversal in binary tree. I used
 queue.
 Q- He asked me to do spiral traversal of a Binary Tree. I used stack and
 queues for the alternate levels.

 On Thu, Sep 22, 2011 at 7:54 PM, sagar pareek sagarpar...@gmail.comwrote:

 12.5


 On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth adisriika...@gmail.comwrote:

 around 11.5 LPA gross
 Regards,
 Adi Srikanth.
 Mob No 9887233349
 Personal Pages: adisrikanth.co.nr



 On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma rahul23111...@gmail.com
  wrote:

 wats eligibility n package?


 On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek 
 sagarpar...@gmail.comwrote:

 nit allahabad


 On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 which college may i know?


 On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek 
 sagarpar...@gmail.com wrote:

 it is coming in my college


 On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 How did u applied for it? Can you please let me know..

  On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek 
 sagarpar...@gmail.com wrote:

 Hello ...
 Do anyone know the process and questions of flip kart ??

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


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


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


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




 --
 **Regards
 SAGAR PAREEK

Re: [algogeeks] Flip kart

2011-09-23 Thread sagar pareek
and would u like to please tell me the online coding questions...

On Fri, Sep 23, 2011 at 1:10 PM, sagar pareek sagarpar...@gmail.com wrote:

 thanx a ton
 one more query...
 was mcq is in online test?


 On Fri, Sep 23, 2011 at 1:54 AM, aditya kumar 
 aditya.kumar130...@gmail.com wrote:

 those three question they ASKD me in interview nt in coding round n they
 are very particular abt coding


 On Fri, Sep 23, 2011 at 1:53 AM, aditya kumar 
 aditya.kumar130...@gmail.com wrote:

 11.5 fr our college
 they will hve online test .. 3 coding question and u need to attempnt any
 two ..25mcq's .. mcq;s wer mostly frm sql ..
  Q- Given a linked list find whether the linked list is palindrome or
 not. I gave him solution by modifying the linked list then i gave solution
 using extra
 space then i gave solution using recursion. First i gave complexity as
 O(n^2) using brute force. He asked me to reduce the complexity then i moved
 on to
 modify the linked list itself, he told me not to modify the linked list.
 Then i went for the extra linked list. Then he asked me not to use extra
 space and
 finally i came up with a recursive solution. And he was very much happy
 after seeing the recursive solution, i think thats wat he was looking for.
 Q- I was asked to do a level order traversal in binary tree. I used
 queue.
 Q- He asked me to do spiral traversal of a Binary Tree. I used stack and
 queues for the alternate levels.

 On Thu, Sep 22, 2011 at 7:54 PM, sagar pareek sagarpar...@gmail.comwrote:

 12.5


 On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth 
 adisriika...@gmail.comwrote:

 around 11.5 LPA gross
 Regards,
 Adi Srikanth.
 Mob No 9887233349
 Personal Pages: adisrikanth.co.nr



 On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma 
 rahul23111...@gmail.com wrote:

 wats eligibility n package?


 On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.com
  wrote:

 nit allahabad


 On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 which college may i know?


 On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek 
 sagarpar...@gmail.com wrote:

 it is coming in my college


 On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 How did u applied for it? Can you please let me know..

  On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek 
 sagarpar...@gmail.com wrote:

 Hello ...
 Do anyone know the process and questions of flip kart ??

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


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


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


  --
 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: MICROSOFT IDC

2011-09-23 Thread sagar pareek
congrates dude

On Thu, Sep 22, 2011 at 7:26 PM, Sanjay Rajpal srn...@gmail.com wrote:

 Saurabh : Thank u very much :)

 Sanju
 :)



 On Thu, Sep 22, 2011 at 6:15 AM, saurabh sah.saurab...@gmail.com wrote:

 thanx to all

 @sanjay I have shared my interview experience at
 http://msidcinterview.blogspot.com/

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Flip kart

2011-09-22 Thread sagar pareek
12.5

On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth adisriika...@gmail.comwrote:

 around 11.5 LPA gross
 Regards,
 Adi Srikanth.
 Mob No 9887233349
 Personal Pages: adisrikanth.co.nr



 On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma rahul23111...@gmail.comwrote:

 wats eligibility n package?


 On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.comwrote:

 nit allahabad


 On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 which college may i know?


 On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek 
 sagarpar...@gmail.comwrote:

 it is coming in my college


 On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 How did u applied for it? Can you please let me know..

  On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek 
 sagarpar...@gmail.com wrote:

 Hello ...
 Do anyone know the process and questions of flip kart ??

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


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



[algogeeks] Flip kart

2011-09-21 Thread sagar pareek
Hello ...
Do anyone know the process and questions of flip kart ??

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



Re: [algogeeks] Flip kart

2011-09-21 Thread sagar pareek
it is coming in my college

On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit 
arpit.rajpuro...@gmail.com wrote:

 How did u applied for it? Can you please let me know..

 On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.comwrote:

 Hello ...
 Do anyone know the process and questions of flip kart ??

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Flip kart

2011-09-21 Thread sagar pareek
nit allahabad

On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit 
arpit.rajpuro...@gmail.com wrote:

 which college may i know?


 On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote:

 it is coming in my college


 On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit 
 arpit.rajpuro...@gmail.com wrote:

 How did u applied for it? Can you please let me know..

 On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.comwrote:

 Hello ...
 Do anyone know the process and questions of flip kart ??

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-19 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.




 --
 Bhanu Chowdary

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




 --
 Nitin Garg

 Personality can open doors... but only Character can keep them open




 --
 Nitin Garg

 Personality can open doors... but only Character can keep them open




 --
 Nitin Garg

 Personality can open doors... but only Character can keep them open




 --
 Nitin Garg

 Personality can open doors... but only Character can keep them open

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Symantec System programming ques

2011-09-18 Thread sagar pareek
I am supposing that file is count.txt and is already exists

so in initials of the main()
do this

*int count;
FILE* fp;

if((fp=fopen(count.txt,r))==NULL)
{
 printf(File does not exist\n);
 exit(0):
}

fscanf(fp,%d,count);
count++;

fclose(fp);

fp=fopen(count.txt,w);

fprintf(fp,%d,count);

fclose(fp);

*

On Sat, Sep 17, 2011 at 9:36 PM, siva viknesh sivavikne...@gmail.comwrote:

 hi anyone at least provide code using file handling.i found this
 ques from other site

 On Sep 17, 6:35 pm, sivaviknesh s sivavikne...@gmail.com wrote:
  you have to write a program which tell about how many times it has run.
 ex:
 
  if you run first time it will print 1.
  if you run second time it will print 2.
  like this.
 
  this can easily done by File Handling but think other solution like IPC.
 
  after booting your system, your program's output start from 1
 
  answers plz???
 
  --
  Regards,
  $iva

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] c output,printf(%llx)

2011-09-18 Thread sagar pareek
Check out what u have written...


On Sun, Sep 18, 2011 at 7:17 PM, wujin chen wujinchen...@gmail.com wrote:

 usigned long long x = 0x12345678;
 int a = 0x09;
 int b = 0x10;
 printf(a=%x, b=%llx,a,b,c);

 the result is: a=9,b=123456780010

 i wonder why~~

 can anyone explain it?
 thanks.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks]

2011-09-18 Thread sagar pareek
Give some examples ,i m not getting ur question

On Mon, Sep 19, 2011 at 1:45 AM, UTKARSH SRIVASTAV
usrivastav...@gmail.comwrote:

 how to find second largest element than current element in an array given
 condition that we have to find that second largest element from index 1 to
 the index of the current element

 --
 *UTKARSH SRIVASTAV
 CSE-3
 B-Tech 3rd Year
 @MNNIT 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...@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 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.



Re: [algogeeks] Networking:suggest some book

2011-09-17 Thread sagar pareek
Best book is kurose and ross

On Sat, Sep 17, 2011 at 7:08 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:

 On Sat, Sep 17, 2011 at 8:58 AM, hary rathor harry.rat...@gmail.com
 wrote:
  1 frozen

 Hahahaha. It's not 'FROZEN', it is Forouzan :P
 (
 http://books.google.com/books/about/Data_Communications_and_Networking.html?id=U3Gcf65Pu9IC
 )

  2 steven Vol 1
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 



 --
 Gaurav Menghani

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] program

2011-09-15 Thread sagar pareek
Use hashing like counting sort...

On Wed, Sep 14, 2011 at 11:20 AM, raj raji20.pat...@gmail.com wrote:

 program to find the top 3 repeating number from the given array
 eg
 You r given an array and u have to find out the top 3 repeated
 numbers.
  for ex: GAURAV[]={20,8,3,7,8,9,20,6,4,6,20,8,20}
 so the output will be: 20 is repeated 4 times 8 is repeated 3 times 6
 is repeated 2 times.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] A logical Question

2011-09-15 Thread sagar pareek
it depends that weather boat is on the water or not :P

On Thu, Sep 15, 2011 at 12:58 PM, Tamanna Afroze afroze...@gmail.comwrote:


 *If you are on a boat and you throw out a suitcase, Will the level of
 water increase.*

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks]

2011-09-10 Thread sagar pareek
@aayush

Dude... i dont knw from where did u find such a stupid question...
Whole cryptography.mean all SSL , RSA , etc etc based on large
numbers which have prime factors...
if we are able to break them in partitions then whole security
is. !
Cryptography's base is wholly and wholly depends on large numbers with large
prime factors

On Thu, Sep 8, 2011 at 11:25 AM, siddharam suresh
siddharam@gmail.comwrote:

 guys there is subject called number theory and cryptography, in which
 there are so many algos to find prime number and prime factors of the
 number.

 Thank you,
 Sid.



 On Thu, Sep 8, 2011 at 11:17 AM, bharatkumar bagana
 bagana.bharatku...@gmail.com wrote:
  @sukran :
  sieve of erathothenes algo gives only the prime numbers below a number ..
  How can we find a number's all prime factors using this algo pls
 explain
  ...
 
  On Wed, Sep 7, 2011 at 5:15 PM, sukran dhawan sukrandha...@gmail.com
  wrote:
 
  sieve of erathothenes algo
 
  On Wed, Sep 7, 2011 at 1:36 PM, Yogesh Yadav medu...@gmail.com wrote:
 
  prime no has only 2 factors. number itself and 1.
 
 
 
  On Wed, Sep 7, 2011 at 12:14 PM, aayush jain ajain...@gmail.com
 wrote:
 
  can anybody tell me the code of find the prime no. and after finding
  prime no. find its prime factore using linkes list?? --
  You received this message because you are subscribed to the Google
  Groups Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
  --
 
  Please do not print this e-mail until urgent requirement. Go Green!!
  Save Papers = Save Trees
  BharatKumar Bagana
  http://www.google.com/profiles/bagana.bharatkumar
  Mobile +91 8056127652
 
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks]

2011-09-10 Thread sagar pareek
@Ayush
I m sorry ... my intention was not to hurt you.

On Sat, Sep 10, 2011 at 11:32 PM, shady sinv...@gmail.com wrote:

 easy dude, no one's making fun of you. Who knows you solve this problem in
 future and become a millionaire ?

 Just keep posting and contributing to group :)


 On Sat, Sep 10, 2011 at 11:06 PM, aayush jain ajain...@gmail.com wrote:

 @sagar
 bro i m not intelligent than u so thats why u r making fun of mine..u know
 one thing
 God is not giving equal capability of mind and he has given something
 special to everyone that thing surely is not in u...
 so think about it before say anythink..

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks]

2011-09-10 Thread sagar pareek
And please read my previous post again...
i wrote stupid questionnot u r stupid...

On Sun, Sep 11, 2011 at 4:24 AM, sagar pareek sagarpar...@gmail.com wrote:

 @Ayush
 I m sorry ... my intention was not to hurt you.


 On Sat, Sep 10, 2011 at 11:32 PM, shady sinv...@gmail.com wrote:

 easy dude, no one's making fun of you. Who knows you solve this problem in
 future and become a millionaire ?

 Just keep posting and contributing to group :)


 On Sat, Sep 10, 2011 at 11:06 PM, aayush jain ajain...@gmail.com wrote:

 @sagar
 bro i m not intelligent than u so thats why u r making fun of mine..u
 know one thing
 God is not giving equal capability of mind and he has given something
 special to everyone that thing surely is not in u...
 so think about it before say anythink..

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


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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



Re: [algogeeks] IP Address

2011-09-07 Thread sagar pareek
+1 to anup

On Wed, Sep 7, 2011 at 8:08 AM, Anup Ghatage ghat...@gmail.com wrote:

 I think It depends on the IP version you willbe using.

 If it is IPv4 then it is:
 struct in_addr and struct sockaddr_in

 If it is IPv6 then it is:
 struct in6_addr and struct sockaddr_in6

 Also there is a struct sockaddr_storage for generic storage and
 interconversion of IP address' if you don't know which version it is.

 On Tue, Sep 6, 2011 at 1:51 PM, sagar pareek sagarpar...@gmail.comwrote:

 @ r_shetty

 search
 1. struct in_addr
 2. struct sockaddr_in


 On Mon, Sep 5, 2011 at 10:04 PM, teja bala pawanjalsa.t...@gmail.comwrote:

 resource records which is a 5
 tuple(domain_name,type,value,class,time_to_live) is returned to respective
 browser request when a resolver gets called..


 On Mon, Sep 5, 2011 at 9:46 PM, rShetty rajeevr...@gmail.com wrote:

 Which is the data Structure used to store the IP addresses in a
 network ?
 Please Elaborate?

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.




 --
 Anup Ghatage

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] IP Address

2011-09-06 Thread sagar pareek
@ r_shetty

search
1. struct in_addr
2. struct sockaddr_in

On Mon, Sep 5, 2011 at 10:04 PM, teja bala pawanjalsa.t...@gmail.comwrote:

 resource records which is a 5
 tuple(domain_name,type,value,class,time_to_live) is returned to respective
 browser request when a resolver gets called..


 On Mon, Sep 5, 2011 at 9:46 PM, rShetty rajeevr...@gmail.com wrote:

 Which is the data Structure used to store the IP addresses in a
 network ?
 Please Elaborate?

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Tejas networks

2011-09-05 Thread sagar pareek
thanks bharat

On Mon, Sep 5, 2011 at 1:47 PM, bharatkumar bagana 
bagana.bharatku...@gmail.com wrote:

 http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
 For Q4): Dijkstra is the best one .. as there is no root for negative
 weight edge ...
 Floyds algo gives all pairs shortest path with negative weight edges also
 .. so that doesn't work in this situation ...


 On Sun, Sep 4, 2011 at 6:22 PM, aditya kumar aditya.kumar130...@gmail.com
  wrote:

 q4) floyds algorithm for shortest path .


 On Sun, Sep 4, 2011 at 5:41 PM, sukran dhawan sukrandha...@gmail.comwrote:

 for q3 :either both inorder and preorder traversal shud be stored or
 inorder and postorder shud be stored


 On Sun, Sep 4, 2011 at 2:54 PM, sukran dhawan sukrandha...@gmail.comwrote:



 -- Forwarded message --
 From: sukran dhawan sukrandha...@gmail.com
 Date: Sun, Sep 4, 2011 at 2:53 PM
 Subject: Re: [algogeeks] Tejas networks
 To: algogeeks@googlegroups.com


 reverse a linked list

 void reverse(struct node ** head)
 {
 struct node * last,*temp;

 last = *head;
 while(last-next != null)
 last = last-next;

 while(*head != last)
 {
 temp = *head;
 *head = (*head)-next;
 temp-next = last-next;
 last-next = temp
 }
 }

 On Sun, Sep 4, 2011 at 2:46 PM, Anup Ghatage ghat...@gmail.com wrote:

 Could you please give an example for question 3?

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




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


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




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Network Question

2011-09-05 Thread sagar pareek
oh pls neha i am doing my majors in networking..

On Mon, Sep 5, 2011 at 9:06 PM, Neha Singh neha.ndelhi.1...@gmail.comwrote:

 @sagar :
 U can't use subnets 10.0.1.0/24 and 10.0.1.0/ http://10.0.1.0/2426   in
 the same LAN

 I think u must 1st study what subnetting is and how it is done

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Network Question

2011-09-05 Thread sagar pareek
I got solutions from max people...half are saying its possible and half are
saying its not..

Neha please u must read what longest prefix match

On Mon, Sep 5, 2011 at 9:44 PM, sagar pareek sagarpar...@gmail.com wrote:

 oh pls neha i am doing my majors in networking..


 On Mon, Sep 5, 2011 at 9:06 PM, Neha Singh neha.ndelhi.1...@gmail.comwrote:

 @sagar :
 U can't use subnets 10.0.1.0/24 and 10.0.1.0/ http://10.0.1.0/2426   in
 the same LAN

 I think u must 1st study what subnetting is and how it is done

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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



Re: [algogeeks] Tejas networks

2011-09-05 Thread sagar pareek
nope sam primilarity testing is not sufficient

On Mon, Sep 5, 2011 at 9:17 PM, SAMM somnath.nit...@gmail.com wrote:

 Question no 1:

 Find the fibonacci number as usual and check whether the current
 fibonacci numbed is prime using Miller primality test .Tht will do...

 On 9/5/11, sagar pareek sagarpar...@gmail.com wrote:
  thanks bharat
 
  On Mon, Sep 5, 2011 at 1:47 PM, bharatkumar bagana 
  bagana.bharatku...@gmail.com wrote:
 
  http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
  For Q4): Dijkstra is the best one .. as there is no root for negative
  weight edge ...
  Floyds algo gives all pairs shortest path with negative weight edges
 also
  .. so that doesn't work in this situation ...
 
 
  On Sun, Sep 4, 2011 at 6:22 PM, aditya kumar 
 aditya.kumar130...@gmail.com
   wrote:
 
  q4) floyds algorithm for shortest path .
 
 
  On Sun, Sep 4, 2011 at 5:41 PM, sukran dhawan
  sukrandha...@gmail.comwrote:
 
  for q3 :either both inorder and preorder traversal shud be stored or
  inorder and postorder shud be stored
 
 
  On Sun, Sep 4, 2011 at 2:54 PM, sukran dhawan
  sukrandha...@gmail.comwrote:
 
 
 
  -- Forwarded message --
  From: sukran dhawan sukrandha...@gmail.com
  Date: Sun, Sep 4, 2011 at 2:53 PM
  Subject: Re: [algogeeks] Tejas networks
  To: algogeeks@googlegroups.com
 
 
  reverse a linked list
 
  void reverse(struct node ** head)
  {
  struct node * last,*temp;
 
  last = *head;
  while(last-next != null)
  last = last-next;
 
  while(*head != last)
  {
  temp = *head;
  *head = (*head)-next;
  temp-next = last-next;
  last-next = temp
  }
  }
 
  On Sun, Sep 4, 2011 at 2:46 PM, Anup Ghatage ghat...@gmail.com
 wrote:
 
  Could you please give an example for question 3?
 
   --
  You received this message because you are subscribed to the Google
  Groups Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
 
   --
  You received this message because you are subscribed to the Google
  Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
 
  --
 
  **Please do not print this e-mail until urgent requirement. Go Green!!
  Save Papers = Save Trees
  *BharatKumar Bagana*
  **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
  *
  Mobile +91 8056127652*
  bagana.bharatku...@gmail.com
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  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@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.
 
 


 --
 Somnath Singh

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Network Question

2011-09-05 Thread sagar pareek
One more thing
CIDR

On Mon, Sep 5, 2011 at 10:49 PM, sagar pareek sagarpar...@gmail.com wrote:

 Google it:-

 Auto-summarization
 longest prefix match
 supernetting
  i think thats enough


 On Mon, Sep 5, 2011 at 10:06 PM, Neha Singh neha.ndelhi.1...@gmail.comwrote:

 @sagar : Can u give me any reference where such a networking is done ??
 Any link or text book reference ??

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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



[algogeeks] Tejas networks

2011-09-04 Thread sagar pareek
Please tell most efficient algo


1. Write a method to find the prime fibonacci numbers.
eg. 1,1,2,3,5,8,13 are fibonacci
  2,3,5,7,11,12... are prime.
  2,3,5,13.are prime fibonacci.

2. Write a program to reverse a linked list using O(1) space.

3. Write the traversal of a tree into a file and then recreate the tree
using the file.

4. There is a matrix where a[i][j] =-1 if there is no train going from i
station to j station.
   = 0 if i=j.
   = n if there is a train going
from station i to j taking n hours.
 Given a starting station and destination station, find the minimum possible
path from s to d.



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



Re: [algogeeks] Re: Network Question

2011-09-04 Thread sagar pareek
common yaar i m in a LAN so why to use NAT ??
please see once again the question and try to answer

On Sun, Sep 4, 2011 at 7:10 PM, aditya kumar
aditya.kumar130...@gmail.comwrote:


 for communication with other n/w they use NAT .
 along with the i/p address port number is also stored in the table .
 On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek sagarpar...@gmail.comwrote:

 mask*


 On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek sagarpar...@gmail.comwrote:

 ok i know it will match longest mask...but then it will always skip the
 ip of shorter mast if it has same ip address


 On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan 
 sukrandha...@gmail.comwrote:

 ya the longest mask matching will take place


 On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI viharri@gmail.com wrote:

 I think the communication problem is just bcoz of longest prefix
 match...

 On Sep 3, 10:09 am, Vengadanathan fantastic.n...@gmail.com wrote:
  ya both the subnet can exisit in the same network , but problem is
  lack of communication between the two subnets ,because in routing
  table of the router the record for  10.0.1.0/26 will be first then
  record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first
  preference , so subnet 10.0.1.0/26 cannot communicate with
 10.0.1.0/24
  having same ip node more over packet sent within 10.0.1.0/24 will
  reach 10.0.1.0/26 not to the nodes on the same network .. so
  10.0.1.0/24 can communicate with 10.0.1.0/26
  but cannot communicate within itself ..
 
  On Sep 3, 9:38 am, bharatkumar bagana bagana.bharatku...@gmail.com
  wrote:
 
 
 
 
 
 
 
   all the addresses which come under second addr will also come under
 first
   
   Can those 2 be exist in same LAN ?
   If yes , how can router decides to which subnet it has to pass
 through the
   incoming packet ..
 
   On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar
   aditya.kumar130...@gmail.comwrote:
 
their wont be any conflict in ip address . coz within dhcp
 assigns ip
adsress from the pool of available address and within the n/w
 (LAN) we need
to have unique ip address bt across the n/w (LAN) we can use same
 ip from
the pool of ip addresses .
 
On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek 
 sagarpar...@gmail.comwrote:
 
It is urgent to get the answer thats why i m posting network
 question
here... searching on net is not working
 
 HI !!
I stuck on a question related to VLSM
 
Suppose we have two subnets as
 
10.0.1.0/24   valid ip address can be 10.0.1.2
 
and
 
10.0.1.0/26 here also valid ip address can be 10.0.1.2
 
now suppose we are using these two subnets in a LAN and having
 this ip
(10.0.1.2) in both the subnets then is there any IP conflict
 will happen or
not?
 
--
**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...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
 --
You received this message because you are subscribed to the
 Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
   --
 
   **Please do not print this e-mail until urgent requirement. Go
 Green!!
   Save Papers = Save Trees
   *BharatKumar Bagana*
   **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
   *
   Mobile +91 8056127652*
   bagana.bharatku...@gmail.com

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


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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




 --
 **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: Network Question

2011-09-03 Thread sagar pareek
yeah the same problem i  facing that if two same ip/s with diff subnets in
same LAN can't create any problem??

On Sat, Sep 3, 2011 at 11:05 AM, bharatkumar bagana 
bagana.bharatku...@gmail.com wrote:

 I didn't understand so subnet 10.0.1.0/26 cannot communicate with
 10.0.1.0/24

 having same ip node more over packet sent within 10.0.1.0/24 will
 reach 10.0.1.0/26 not to the nodes on the same network .. so
 10.0.1.0/24 can communicate with 10.0.1.0/26
 but cannot communicate within itself ..

 what do u mean?
 In a n/w all the IP 's should be unique ? can there exist like this .. pls
 explain me detail y ...

 On Sat, Sep 3, 2011 at 1:09 AM, Vengadanathan fantastic.n...@gmail.comwrote:

 ya both the subnet can exisit in the same network , but problem is
 lack of communication between the two subnets ,because in routing
 table of the router the record for  10.0.1.0/26 will be first then
 record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first
 preference , so subnet 10.0.1.0/26 cannot communicate with 10.0.1.0/24
 having same ip node more over packet sent within 10.0.1.0/24 will
 reach 10.0.1.0/26 not to the nodes on the same network .. so
 10.0.1.0/24 can communicate with 10.0.1.0/26
 but cannot communicate within itself ..

 On Sep 3, 9:38 am, bharatkumar bagana bagana.bharatku...@gmail.com
 wrote:
  all the addresses which come under second addr will also come under
 first
  
  Can those 2 be exist in same LAN ?
  If yes , how can router decides to which subnet it has to pass through
 the
  incoming packet ..
 
  On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar
  aditya.kumar130...@gmail.comwrote:
 
 
 
 
 
 
 
 
 
   their wont be any conflict in ip address . coz within dhcp assigns ip
   adsress from the pool of available address and within the n/w (LAN) we
 need
   to have unique ip address bt across the n/w (LAN) we can use same ip
 from
   the pool of ip addresses .
 
   On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek sagarpar...@gmail.com
 wrote:
 
   It is urgent to get the answer thats why i m posting network question
   here... searching on net is not working
 
HI !!
   I stuck on a question related to VLSM
 
   Suppose we have two subnets as
 
   10.0.1.0/24   valid ip address can be 10.0.1.2
 
   and
 
   10.0.1.0/26 here also valid ip address can be 10.0.1.2
 
   now suppose we are using these two subnets in a LAN and having this
 ip
   (10.0.1.2) in both the subnets then is there any IP conflict will
 happen or
   not?
 
   --
   **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...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
 
  **Please do not print this e-mail until urgent requirement. Go Green!!
  Save Papers = Save Trees
  *BharatKumar Bagana*
  **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
  *
  Mobile +91 8056127652*
  bagana.bharatku...@gmail.com

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




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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

Re: [algogeeks] Re: Network Question

2011-09-03 Thread sagar pareek
ok i know it will match longest mask...but then it will always skip the ip
of shorter mast if it has same ip address

On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan sukrandha...@gmail.comwrote:

 ya the longest mask matching will take place


 On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI viharri@gmail.com wrote:

 I think the communication problem is just bcoz of longest prefix
 match...

 On Sep 3, 10:09 am, Vengadanathan fantastic.n...@gmail.com wrote:
  ya both the subnet can exisit in the same network , but problem is
  lack of communication between the two subnets ,because in routing
  table of the router the record for  10.0.1.0/26 will be first then
  record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first
  preference , so subnet 10.0.1.0/26 cannot communicate with 10.0.1.0/24
  having same ip node more over packet sent within 10.0.1.0/24 will
  reach 10.0.1.0/26 not to the nodes on the same network .. so
  10.0.1.0/24 can communicate with 10.0.1.0/26
  but cannot communicate within itself ..
 
  On Sep 3, 9:38 am, bharatkumar bagana bagana.bharatku...@gmail.com
  wrote:
 
 
 
 
 
 
 
   all the addresses which come under second addr will also come under
 first
   
   Can those 2 be exist in same LAN ?
   If yes , how can router decides to which subnet it has to pass through
 the
   incoming packet ..
 
   On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar
   aditya.kumar130...@gmail.comwrote:
 
their wont be any conflict in ip address . coz within dhcp assigns
 ip
adsress from the pool of available address and within the n/w (LAN)
 we need
to have unique ip address bt across the n/w (LAN) we can use same ip
 from
the pool of ip addresses .
 
On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek sagarpar...@gmail.com
 wrote:
 
It is urgent to get the answer thats why i m posting network
 question
here... searching on net is not working
 
 HI !!
I stuck on a question related to VLSM
 
Suppose we have two subnets as
 
10.0.1.0/24   valid ip address can be 10.0.1.2
 
and
 
10.0.1.0/26 here also valid ip address can be 10.0.1.2
 
now suppose we are using these two subnets in a LAN and having this
 ip
(10.0.1.2) in both the subnets then is there any IP conflict will
 happen or
not?
 
--
**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...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
 --
You received this message because you are subscribed to the Google
 Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
   --
 
   **Please do not print this e-mail until urgent requirement. Go Green!!
   Save Papers = Save Trees
   *BharatKumar Bagana*
   **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
   *
   Mobile +91 8056127652*
   bagana.bharatku...@gmail.com

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Network Question

2011-09-03 Thread sagar pareek
mask*

On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek sagarpar...@gmail.com wrote:

 ok i know it will match longest mask...but then it will always skip the ip
 of shorter mast if it has same ip address


 On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan sukrandha...@gmail.comwrote:

 ya the longest mask matching will take place


 On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI viharri@gmail.com wrote:

 I think the communication problem is just bcoz of longest prefix
 match...

 On Sep 3, 10:09 am, Vengadanathan fantastic.n...@gmail.com wrote:
  ya both the subnet can exisit in the same network , but problem is
  lack of communication between the two subnets ,because in routing
  table of the router the record for  10.0.1.0/26 will be first then
  record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first
  preference , so subnet 10.0.1.0/26 cannot communicate with 10.0.1.0/24
  having same ip node more over packet sent within 10.0.1.0/24 will
  reach 10.0.1.0/26 not to the nodes on the same network .. so
  10.0.1.0/24 can communicate with 10.0.1.0/26
  but cannot communicate within itself ..
 
  On Sep 3, 9:38 am, bharatkumar bagana bagana.bharatku...@gmail.com
  wrote:
 
 
 
 
 
 
 
   all the addresses which come under second addr will also come under
 first
   
   Can those 2 be exist in same LAN ?
   If yes , how can router decides to which subnet it has to pass
 through the
   incoming packet ..
 
   On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar
   aditya.kumar130...@gmail.comwrote:
 
their wont be any conflict in ip address . coz within dhcp assigns
 ip
adsress from the pool of available address and within the n/w (LAN)
 we need
to have unique ip address bt across the n/w (LAN) we can use same
 ip from
the pool of ip addresses .
 
On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek 
 sagarpar...@gmail.comwrote:
 
It is urgent to get the answer thats why i m posting network
 question
here... searching on net is not working
 
 HI !!
I stuck on a question related to VLSM
 
Suppose we have two subnets as
 
10.0.1.0/24   valid ip address can be 10.0.1.2
 
and
 
10.0.1.0/26 here also valid ip address can be 10.0.1.2
 
now suppose we are using these two subnets in a LAN and having
 this ip
(10.0.1.2) in both the subnets then is there any IP conflict will
 happen or
not?
 
--
**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...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
 --
You received this message because you are subscribed to the Google
 Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
   --
 
   **Please do not print this e-mail until urgent requirement. Go
 Green!!
   Save Papers = Save Trees
   *BharatKumar Bagana*
   **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
   *
   Mobile +91 8056127652*
   bagana.bharatku...@gmail.com

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


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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



[algogeeks] Network Question

2011-09-02 Thread sagar pareek
It is urgent to get the answer thats why i m posting network question
here... searching on net is not working

 HI !!
I stuck on a question related to VLSM

Suppose we have two subnets as

10.0.1.0/24   valid ip address can be 10.0.1.2

and

10.0.1.0/26 here also valid ip address can be 10.0.1.2

now suppose we are using these two subnets in a LAN and having this ip
(10.0.1.2) in both the subnets then is there any IP conflict will happen or
not?

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



Re: [algogeeks] Pointer

2011-08-30 Thread sagar pareek
Just refer indirect sorting...its just like what u guessed :)

On Tue, Aug 30, 2011 at 11:33 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:

 I read a question : To swap two given strings using pointers.

 Are we supposed to declare two pointers and exchange their values, or use
 these pointers to swap each element of the two strings one by one?

 --
 Nikhil Gupta
 NSIT, New Delhi, India

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



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

2011-08-28 Thread sagar pareek
level order traversal is best for this case :)

On Sun, Aug 28, 2011 at 11:53 PM, prashant thorat
prashantnit...@gmail.comwrote:

 only preorder will suffice.. considering fact that it's BST


 On Sun, Aug 28, 2011 at 11:26 PM, Rishabbh A Dua duarish...@gmail.comwrote:

 Please correct me if i am wrong but isnt the answer to this q is AVL
 trees

 On Sun, Aug 28, 2011 at 10:43 PM, Dhriti Khanna dhriti0...@gmail.comwrote:

 @ Navneet: See if the tree is: 6
4   7
   3 5  8

 Then the preorder traversal is : 6 4 3 5 7 8
 And using this preorder traversal and inserting them in the tree one by
 one, we generate this exact tree.



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




 --
 Rishabbh A Dua

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




 --
 Yours affectionately,
 Prashant Thorat
 Computer Science and Engg. Dept,
 NIT Durgapur.

  --
 You received this message because you are subscribed to the Google Groups
 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 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Tejas Network Placement Process!!!

2011-08-27 Thread sagar pareek
Yeah i wanna know abt it...

On Fri, Aug 26, 2011 at 9:22 PM, rohit rajuljain...@gmail.com wrote:

 Please share  Process and experience of tejas Network for software
 profile.
 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Recruitment Procedure for Microsoft Research Redmond and Bangalore

2011-08-27 Thread sagar pareek
Well i only attended MSR b'lore summer school but sorry no idea interns

On Sat, Aug 27, 2011 at 7:23 PM, shady sinv...@gmail.com wrote:

 anyone with research background ?


 On Sat, Aug 27, 2011 at 1:57 AM, shady sinv...@gmail.com wrote:

 Does anyone know about the recruitment procedure for Research Intern at MS
 Redmond or MS Bangalore ? What are the type of questions do they ask and
 what should be paid attention to ?
 There are lot of posts on MS SDE and SDET positions but none about
 research.

 If anyone knows then kindly reply.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: String passing

2011-08-27 Thread sagar pareek
@raj

u already mentioned that if we write :-
char *p=hello;
p[0]='k'; // gives runtime error


so if we are passing arguments as

modify(char a[],char *b)
{
.
.
}

main()
{
.
.
modify(hello,hi);
.
.
}


then its actually
char arr[]=hello;
char *b=hi;

so ofcourse now
b[0]='a'; // give u runtime error

now u may be confuse about
arr[0]='a'; //gives runtime error

here i would like to tell you that arr is char pointer not char array
you can check by yourself in :-   http://www.ideone.com/EQrjj

On Sat, Aug 27, 2011 at 10:39 PM, raj kumar megamonste...@gmail.com wrote:


 monsters are monsters



 -- Forwarded message --
 From: raj kumar megamonste...@gmail.com
 Date: Sat, Aug 27, 2011 at 10:30 PM
 Subject: Re: [algogeeks] Re: String passing
 To: algogeeks@googlegroups.com


 can't understand what are you trying to say

 source

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Adding Two no without using any operator...??

2011-08-27 Thread sagar pareek
yeah one option is half adder with xor and and operators

one more solution

http://www.ideone.com/B07bn

On Sun, Aug 28, 2011 at 12:41 AM, Gaurav Menghani gaurav.mengh...@gmail.com
 wrote:

 I guess you mean without using any 'arithmetic operator'. If yes, it
 can be done with XOR and AND operators.

 Not sure how it can be done otherwise, without using any kind of
 operators AT ALL.

 On Sun, Aug 28, 2011 at 12:37 AM, Brijesh brijeshupadhyay...@gmail.com
 wrote:
  How to add two nos without using any operator...?
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/algogeeks/-/MpNKzlE3UuwJ.
  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.
 



 --
 Gaurav Menghani

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Remove all Duplicates Words

2011-08-25 Thread sagar pareek
thanks ankur khurana

@dave
May be u never did any mistake in posting and reading the problems.
But dont think urself superior.
Yeah i did mistake in reading the question so u must either ignore it or
request me to not repeat it in future.
You are behaving like its my daily routine of doing such kind of things.

On Thu, Aug 25, 2011 at 11:56 AM, Anup Ghatage ghat...@gmail.com wrote:

 Actually, this method will be O(n) for any number of occurrences of a
 single word, but It will go into O(n^2) for multiple occurrences of multiple
 words.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: C doubt

2011-08-24 Thread sagar pareek
See if we use dynamic memory allocation then still the size of pointer will
be 4 bytes only
Mean that int* pointer still have the size equals to pointer ... malloc only
returns new alloted memory which is now only  *pointed *by that pointer

check this out :- http://www.ideone.com/20ayq

On Wed, Aug 24, 2011 at 8:10 PM, Don dondod...@gmail.com wrote:

 If you are working in C++, stl has a vector container class which will
 do this. Otherwise, declare an integer pointer in the struct and use
 malloc to allocate memory for it. Then you can use it like an array.
 Don

 On Aug 23, 11:51 pm, Arun Vishwanathan aaron.nar...@gmail.com wrote:
  say that you have a structure with some fields of known size and unknown
  size.For example, a char, an integer and an integer array.I do not know
 the
  size of the integer array until the user mentions the number of bytes he
  needs this integer array to cover in the command line as an argument.Is
 it
  possible to have a structure with an integer dynamic array?
 
  Arun
 
  --
   People often say that motivation doesn't last. Well, neither does
 bathing
  - that's why we recommend it daily.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Remove all Duplicates Words

2011-08-24 Thread sagar pareek
use hashing

On Wed, Aug 24, 2011 at 8:43 PM, UMESH KUMAR kumar.umesh...@gmail.comwrote:

 Qn. Remove all duplicates words from given a line without using extra
 memory ?

 Ex:-Hello word hello hi
 Out put:- Hello word hi

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Find the non-duplicate element in sorted array in O(n) time

2011-08-24 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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Find the non-duplicate element in sorted array in O(n) time

2011-08-24 Thread sagar pareek
mine approach is log(n)

check it out first

On Thu, Aug 25, 2011 at 1:21 AM, Don dondod...@gmail.com wrote:

 I'm going to assume that elements in pairs means exactly two of each
 element except for the one which is missing it's pair.
 The recursive solution is simple, but it only uses tail recursion, so
 it is worthwhile to do it iteratively.

 int findSingle(int *a, int size)
 {
  int result;

  while(1)
  {
printf(a[0] = %d size=%d\n, a[0], size);
if (size == 1)
{
  result = a[0];
  break;
}
else if (size == 3)
{
result = (a[0] == a[1]) ? a[2] : a[0];
break;
}
else
{
  int midpoint = size/2;
  if (a[midpoint] == a[midpoint-1]) --midpoint;
  if (a[midpoint] != a[midpoint+1])
  {
result = a[midpoint];
break;
  }
  else if (midpoint % 2)
  {
size = midpoint;
  }
  else
  {
a += midpoint;
size -= midpoint;
  }
}
  }
  return result;
 }

 On Aug 24, 4:49 am, atul purohit gonewiththe...@gmail.com wrote:
  Hi,
 
  A* sorted *integer array contains elements in pairs. All the pairs are
  complete except one element whose pair is missing. Find that element.
 
  Ex.   { 1,1,2,2,2,2,3,3,4,5,5}
   result = 5
 
  There is a standard solution which returns an XOR of all the elements.
 But
  this needs O(n) time complexity. The person who asked me this question
 said
  that this can be done in  O(n). Maybe we can eliminate some elements.
  Anyone knows how to do this?
 
  Cheers,
  Atul

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: Search an array of unknown length

2011-08-23 Thread sagar pareek
@saurabh
u are getting sizeof(a)/sizeofa[0] =1 coz fiest one is pointer and second
one is integer...both's size is 4
do it
without passing
http://www.ideone.com/8olTP

On Tue, Aug 23, 2011 at 1:28 PM, vikas vikas.rastogi2...@gmail.com wrote:

 nopes, you need to know where the hell it ends even if this is a
 string , it ends with convention of ending 0. in case it is stream ,
 we know the data length. in case of array, above mentioned approach
 should work. sizeof(arr)/sizeof(arr[0])

 if you are given only a pointer and no length, you can address until
 there is another page starts in memory , not belonging to the process.




 On Aug 23, 7:07 am, saurabh singh saurab...@gmail.com wrote:
  Just a small code to back up my point...http://www.ideone.com/woRiT
 
 
 
 
 
 
 
 
 
  On Tue, Aug 23, 2011 at 7:33 AM, saurabh singh saurab...@gmail.com
 wrote:
   That would take all the fun awaywhat if you are given only the
 address
   of the array?This wont work in that case
 
   On Mon, Aug 22, 2011 at 10:39 PM, asdqwe ayushgoel...@gmail.com
 wrote:
 
   If i am not wrong, the only possible solution can be
   len=sizeof(arr)/sizeof(arr[0])
   i.e. find the length from the array itself.
 
   On Aug 22, 9:01 pm, saurabh singh saurab...@gmail.com wrote:
@dave or anyone??? response please
 
On Sun, Aug 21, 2011 at 12:43 PM, saurabh singh 
 saurab...@gmail.com
   wrote:
 kkk...not sure
 assume no number is greater than 1000(I mentioned There has to be
 some
 additional constraints to make the problem solvable)
 Now check 1st element if not the desired element keep multiplying
 with
   2
 the previous range till either one of these condition is satisfied
 *1.An exception is caught*
 *2.Number greater than 1000 occurs.*
 suppose this happens for *1024 *for the given example.
 then we will check out for (512+1024)/2 th element for the above
   condition.
 If true than again branch like binary search.This way can element
   which on
 left side doesn't gives any exception and maintains the
 constraints
   while on
 the right it violates the same.So we may land up with the desired
   index and
 can then perform binary search...
 
 PS:There are lots of assumption in this approach and the more I
 write
   the
 more I get convinced that its a plain stupid idea...
 
 --
 Saurabh Singh
 B.Tech (Computer Science)
 MNNIT ALLAHABAD
 
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT 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...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   Saurabh Singh
   B.Tech (Computer Science)
   MNNIT ALLAHABAD
 
  --
  Saurabh Singh
  B.Tech (Computer Science)
  MNNIT 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...@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 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.



Re: [algogeeks] Re: amazon q

2011-08-23 Thread sagar pareek
I m surprised that ur whole explanation is for me :-o
Check ur previous post and then last post...
i think u r confused

On Tue, Aug 23, 2011 at 3:10 PM, WgpShashank shashank7andr...@gmail.comwrote:

 @sagar,

 A self-balancing balancing binary search tree(Its *BST not BT )*containing n 
 items allows the lookup, insertion, and removal of an item in
 O(log n) worst-case time. Since it’s a BST, we can easily find out minimum
 element in O(nlogn). please note that if it would have been simple BST not
 Balnced BST then our complexity to lookup will changes to O(n) in worst case
 when tree is skewed but as question say balanced BST (check out AVL/RB Tree)
 they gureentte that look-up will O(logn) only why its true  will work you
 need to go through tree rotation (thats used to make tree balanced  reduce
 height ).

 Since Heap is a balanced binary tree (or almost complete binary tree but
 not balanced BST ), insertion complexity for heap is O(logn). Also
 complexity to get minimum in a min heap is O(logn) because removal of root
 node causes a call to 
 heapifyhttp://www.cs.virginia.edu/%7Eluebke/cs332.fall00/lecture4/index.htm(after
  removing the first element from the array) to maintain the heap tree
 property. But a heap cannot be used for the above purpose as the question
 says – insert an element if it is not already present because of this
 constraint we can't use min-heap as well . For a heap, we cannot find out in
 O(logn) if an element is present or not as its balanced Binary Tree(BT) , we
 have to search all the elements e.g.in both  left  right sub-tree up-to
 leaf so in worst case it will take O(n) time to search an element weather
 ist present or not , then its present leave it  else insert as a last node 
 call heapify (take O(logn)) so tottal time complexity will be O(n)+ O(logn)
 =O(n)

   search+heapify =O(search)

 so why correct answer is only Balanced Binary Search Tree

 Do Notify me if i missed something or wants more clarification ?


 *Thanks
 Shashank Mani
 Computer Science
 Birla Institute of Technology Mesra*

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/65k0xGJY6ZoJ.

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



Re: [algogeeks] Re: Search an array of unknown length

2011-08-23 Thread sagar pareek
hmm ok
my mistake of reading


On Tue, Aug 23, 2011 at 6:56 PM, saurabh singh saurab...@gmail.com wrote:

 Well sir I am fully aware why this is hapening.Kindly reread what I wrote
 .*what if we are given only the address of  the array.*
 I personaly feel anyone who asked the question never expected this to be
 the answer.(using sizeof).
 On Tue, Aug 23, 2011 at 2:42 PM, sagar pareek sagarpar...@gmail.comwrote:

 @saurabh
 u are getting sizeof(a)/sizeofa[0] =1 coz fiest one is pointer and second
 one is integer...both's size is 4
 do it
 without passing
 http://www.ideone.com/8olTP


 On Tue, Aug 23, 2011 at 1:28 PM, vikas vikas.rastogi2...@gmail.comwrote:

 nopes, you need to know where the hell it ends even if this is a
 string , it ends with convention of ending 0. in case it is stream ,
 we know the data length. in case of array, above mentioned approach
 should work. sizeof(arr)/sizeof(arr[0])

 if you are given only a pointer and no length, you can address until
 there is another page starts in memory , not belonging to the process.




 On Aug 23, 7:07 am, saurabh singh saurab...@gmail.com wrote:
  Just a small code to back up my point...http://www.ideone.com/woRiT
 
 
 
 
 
 
 
 
 
  On Tue, Aug 23, 2011 at 7:33 AM, saurabh singh saurab...@gmail.com
 wrote:
   That would take all the fun awaywhat if you are given only the
 address
   of the array?This wont work in that case
 
   On Mon, Aug 22, 2011 at 10:39 PM, asdqwe ayushgoel...@gmail.com
 wrote:
 
   If i am not wrong, the only possible solution can be
   len=sizeof(arr)/sizeof(arr[0])
   i.e. find the length from the array itself.
 
   On Aug 22, 9:01 pm, saurabh singh saurab...@gmail.com wrote:
@dave or anyone??? response please
 
On Sun, Aug 21, 2011 at 12:43 PM, saurabh singh 
 saurab...@gmail.com
   wrote:
 kkk...not sure
 assume no number is greater than 1000(I mentioned There has to
 be some
 additional constraints to make the problem solvable)
 Now check 1st element if not the desired element keep
 multiplying with
   2
 the previous range till either one of these condition is
 satisfied
 *1.An exception is caught*
 *2.Number greater than 1000 occurs.*
 suppose this happens for *1024 *for the given example.
 then we will check out for (512+1024)/2 th element for the above
   condition.
 If true than again branch like binary search.This way can
 element
   which on
 left side doesn't gives any exception and maintains the
 constraints
   while on
 the right it violates the same.So we may land up with the
 desired
   index and
 can then perform binary search...
 
 PS:There are lots of assumption in this approach and the more I
 write
   the
 more I get convinced that its a plain stupid idea...
 
 --
 Saurabh Singh
 B.Tech (Computer Science)
 MNNIT ALLAHABAD
 
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT 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...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   Saurabh Singh
   B.Tech (Computer Science)
   MNNIT ALLAHABAD
 
  --
  Saurabh Singh
  B.Tech (Computer Science)
  MNNIT 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...@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 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.




 --
 Saurabh Singh
 B.Tech (Computer Science)
 MNNIT 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...@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 to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more

Re: [algogeeks] Re: amazon q

2011-08-22 Thread sagar pareek
Ok then answer must be both of them :)
actually finding min is O(1)
but to re-heapify after deletion is log(n).

On Mon, Aug 22, 2011 at 9:55 AM, Amol Sharma amolsharm...@gmail.com wrote:

 BST should be the answer..agree with the reason by dumanshu
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad
  http://gplus.to/amolsharma99 
 http://twitter.com/amolsharma99http://in.linkedin.com/pub/amol-sharma/21/79b/507http://youtube.com/amolsharma99





 On Mon, Aug 22, 2011 at 6:52 AM, Akash Mukherjee akash...@gmail.comwrote:

 ay that the re-heapify is implicit just as the re-balance is im


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Adobe Interview - 20/08/2011

2011-08-22 Thread sagar pareek
@saurabh
pls post ur solutions too

On Mon, Aug 22, 2011 at 12:48 PM, Jagannath Prasad Das
jpdasi...@gmail.comwrote:

 i think find max and min of all time-stamps respectively


 On Mon, Aug 22, 2011 at 12:44 PM, saurabh agrawal saurabh...@gmail.comwrote:

 How did u solved :

 3) There is a list containing the checkin and checkout time of every
 person in a party . The checkin time is in ascending order while the
 checkout is random .

 Eg:

Check_inCheck_out

 Person 1 8.00  9.00

 Person 2 8.15  8.30

 Person 3 8.30  9.20



 On Mon, Aug 22, 2011 at 9:14 AM, Decipher ankurseth...@gmail.com wrote:

 Hi,

 This is my Adobe interview experience for freshers :

  *Written Test:*

 Engineering   – 45 Minutes - Data Structures, Algorithms,
 Operating Systems

 C/C++  – 45 Minutes - C/C++ Fundamentals  Coding***
 *

 Aptitude– 45 Minutes – Quantitative  Analytical

 * *

 *On clearing the Test, 3 Technical Interviews + HR discussion on the
 same day.*

 *
 *

 *Interview 1: *

 1) Insert an element in a linked list at the end , given the *start *
 pointer.

 2) Write a function to Swap pointers .

 3) There is a list containing the checkin and checkout time of every
 person in a party . The checkin time is in ascending order while the
 checkout is random .

 Eg:

Check_inCheck_out

 Person 1 8.00  9.00

 Person 2 8.15  8.30

 Person 3 8.30  9.20

 and so on ...
 Now , give an optimized solution to find at what time the maximum number
 of people will be in the party . My solution - O(nlogn) time and O(n) space
 . He gave another O(nlogn) time and O(n) space solution .

 and some other questions that I can't recal ..

 *Interview 2:*
 1) Base class contains 2 functions and Derived class (with Private
 Inheritance from Base) also contains 2 functions (same name as those in Base
 cass), then he asked me the effect by changing the Inheritance type and
  making different functions virtual like - virtual func in Base then in
 Derived and then both .

 2) Same question appended- A derived class *A* derived from Derived and
 Base , now

 A a = new A;
 Base *b =  a;
 Derived *d = a;

 b = d;

 and b = (Base *) d;

 then which functions can I call ?

 3) Convert a tree into its mirror without using extra memory - O(1) space
 .

 4) If an array is rotated a number of unknown times , then how to find an
 element in O(log n)

 5) There are 3 sticks placed at right angles to each other and a sphere
 is placed between the sticks . Now another sphere is placed in the gap
 between the sticks and Larger sphere . Find the radius of smaller sphere in
 terms of radius of larger sphere .

 *This is as far I can remember so please don't ask any questions
 regarding it .*


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/K0ws20ht-pkJ.
 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.


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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: amazon q

2011-08-22 Thread sagar pareek
@shashank
what about min heap?
Check this out -- http://en.wikipedia.org/wiki/Heap_%28data_structure%29

On Mon, Aug 22, 2011 at 4:13 PM, WgpShashank shashank7andr...@gmail.comwrote:

 Only Balanced BST (its guaranteed that we can search element in o(logn) ,

 i am assuming its maxheap .In a max heap, the smallest element is always
 present at a leaf node. So we need to check for all leaf nodes for the
 minimum value. Worst case complexity will be O(n)

 12
 / \
 / \
 8 7
 / \ / \ try to search 5 in this using Heap  balanced BST
 / \ / \
 2 3 4 5

 As searching is main constraints on complexity we can't use Heap to achieve
 O(logn) it will take linear time but using Balanced BST (e.g. AVL/RB Tree)
 we can search element in O(logn) :)


 Shashank
 CSE,BIT Mesra

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/fmXlF2-kcFwJ.

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



Re: [algogeeks] Output question

2011-08-22 Thread sagar pareek
U should know that union's elements share memory alloted through the largest
data type like in this case 10 bytes is alloted and is shared by all the
union elements.

So in union x :- last element modified is c, so that's why it is printing
garbage values for int and char[] elements...
actually if u convert float value in binary then u will see that what's its
actual integer value is? same case for char[]

in union y : last modified element is integer thats y it is printing 100 for
integer... ascii value of 'd' is 100 thats y printing 'd' for char[] and
0.000 for float

On Mon, Aug 22, 2011 at 4:53 PM, vartika vartika.aggarwa...@gmail.comwrote:

 #includestdio.h
 #includestring.h
 int 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);
  return 0;
 }

 Someone pls explain the output

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Please share experiences if any body has faced Samsung Engineering Labs(SIEL)

2011-08-22 Thread sagar pareek
50 apti (25 DI + 25 reasoning) in 60 mis

20 tech 30 mins

1tech + 1 hr
 and u are done

On Mon, Aug 22, 2011 at 9:36 PM, ghsjgl k ghsk...@gmail.com wrote:

 i attended for SISO


 On Mon, Aug 22, 2011 at 2:08 PM, saurabh sah.saurab...@gmail.com wrote:

 Can Please tell about the type of question if any body has faced
 SIEL .

 Saurabh sah
 NIT Jaipur.

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] constructor ques

2011-08-22 Thread sagar pareek
+1 coder

On Mon, Aug 22, 2011 at 9:41 PM, sukran dhawan sukrandha...@gmail.comwrote:

 hey sorry didnt notice virtual :)


 On Mon, Aug 22, 2011 at 9:38 PM, coder dumca coder.du...@gmail.comwrote:

 @sukran ur r wrong man
 the construdor of virtual base class are called first  otherwise it is
 from left to right
 so the correct order is
 D A B C Z
 On Mon, Aug 22, 2011 at 8:25 AM, Sanjay Rajpal srn...@gmail.com wrote:

  agree with sukran.


 Sanju
 :)



 On Mon, Aug 22, 2011 at 8:20 AM, sukran dhawan 
 sukrandha...@gmail.comwrote:

 its left to right always !


 On Mon, Aug 22, 2011 at 8:49 PM, Sanjay Rajpal srn...@gmail.comwrote:

  A
 B
 C
 D


 Sanju
 :)



 On Mon, Aug 22, 2011 at 8:17 AM, sivaviknesh s sivavikne...@gmail.com
  wrote:

 you have 4 classes A,B,C,D and class Z is derived from all these
 classes
 using
 Class Z: public A,private B,Protected C, Virtual D
 What is the order of constructor call?

 ...plz reason out also

 --
 Regards,
 $iva

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


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


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


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


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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Please share experiences if any body has faced Samsung Engineering Labs(SIEL)

2011-08-22 Thread sagar pareek
one more thing simple questions on OS in interview
very basic like what is process?
diff b/w process and threads
why thread call light process ...

On Mon, Aug 22, 2011 at 11:15 PM, sonu kumar sonu.one...@gmail.com wrote:

 aptitude test as sagar said.then tech test consists of
 c- 20 ques,
 ds-5 ques,
 os- 5 ques.

 then in interview  only c and c++,and ds asked.
 they mostly emphasize on code 2 write.


 On Mon, Aug 22, 2011 at 2:08 PM, saurabh sah.saurab...@gmail.com wrote:

 Can Please tell about the type of question if any body has faced
 SIEL .

 Saurabh sah
 NIT Jaipur.

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re:

2011-08-22 Thread sagar pareek
it gives runtime error...
coz u have to allocate memory to *q

On Tue, Aug 23, 2011 at 12:02 AM, Abhishek mailatabhishekgu...@gmail.comwrote:

 i think.. it will not produce error, but o/p 'may' be garbage values.
 since the memory locations adjacent to *q will be overwritten.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/X1CZmpVjhxEJ.

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



Re: [algogeeks] C output

2011-08-22 Thread sagar pareek
Yeah its o/p is 10 :)

On Tue, Aug 23, 2011 at 12:45 AM, Deepak Garg deepakgarg...@gmail.comwrote:

 its output is

 10


 On Tue, Aug 23, 2011 at 12:03 AM, rohit rajuljain...@gmail.com wrote:

 #includestdio.h

 #define max(a,b) (ab?a:b)


 int main()
 {

  int j=max(3+2,2+8);
  printf(%d,j);

return 0;
 }

why this program show output as 9 ? please help me

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




 --
 U.D.I.T

 Sent by Nokia OVI (c)

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] array problem

2011-08-21 Thread sagar pareek
This problem can be reduced if we are taking whole 32 bits...
Mean left most all 0's bits are also including
then if number is less than 65535 (2^16-1) then make it 0
as 16 bits are at least zero in this case

On Sun, Aug 21, 2011 at 2:19 PM, Sanjay Rajpal srn...@gmail.com wrote:

 let n be the no.of integers in the array :

 int i=1,a;
 int zero,one;
 for(int a=1;a=32;a++)
 {
 zero=0;
 one=0;
 for(int j=0;jn;j++)
 {
 if(a[j]  i)
 {
 one++;
 }
 else
 {
 zero++;
 }
 }
 if(one  zero)
 {
 printf(1s are more \n);
 }
 else
 {
 printf(0s are more \n);
 }
 i=i1;
 }

 Correct me if m wrong.

 Sanju
 :)



 On Sun, Aug 21, 2011 at 1:28 AM, Dheeraj Sharma 
 dheerajsharma1...@gmail.com wrote:

 yeah i took it in the another way..i ll post it v soon

 On 8/21/11, himanshu kansal himanshukansal...@gmail.com wrote:
  problem: There is an array containing integers.
  for every bit in the integer,you have to print a 1 if no of 1s
  corresponding to that bit is more than no of 0s corresponding to that
  bit (counting that bit in all the integers) otherwise print a 0(if no
  of 0s corresponding to that bit are more).
 
  this you have to do for all bits in the integers.
 
  assumption:integers are of 32bits.
  no of integers in array are odd...(i.e. there is no case like no. of
  1s=no. of 0s)
 
  i have  done this by counting the no of 1s and 0s for all bits.
 
  but can anyone suggest any other efficient approach (somewhat using
  bitwise operators).
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 


 --
 *Dheeraj Sharma*
 Comp Engg.
 NIT Kurukshetra
 +91 8950264227

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] c question what is output?

2011-08-21 Thread sagar pareek
FUNC2(i) =  i==0?i*(i-1*(i-1-1))

8==0?1:8*(8-1*(8-1-1))
8==0?1:8*(8-6)
8==0?1:8*2
8==0?1:16

hence it will return 16

On Sun, Aug 21, 2011 at 11:40 AM, SuDhir mIsHra
sudhir08.mis...@gmail.comwrote:

 #includestdio.h
 #define FUNC1(i) (i*(i-1))
 #define FUNC2(i) (i==0?1:i*FUNC1(i-1))
 main()
 {
 int i=8;


 printf(\n%d,FUNC2(i));
 }

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] why the output 16

2011-08-21 Thread sagar pareek
@prakash
before posting u should check what others already posted  :D  :D

On Sun, Aug 21, 2011 at 4:03 PM, Prakash D cegprak...@gmail.com wrote:

 FUNC2(8)

 == 8==0? 1: 8 * FUNC1(8-1)
 == 8==0? 1: 8*( 8-1* 8-1-1)

 ==  8 * (8-8-2)
 == -16

 but why 16??

 On Sat, Aug 20, 2011 at 7:02 PM, SuDhir mIsHra 
 sudhir08.mis...@gmail.comwrote:

 #includestdio.h
 #define FUNC1(i) (i*(i-1))
 #define FUNC2(i) (i==0?1:i*FUNC1(i-1))
 main()
 {
 int i=8;


 printf(\n%d,FUNC2(i));
 }

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: c question what is output?

2011-08-21 Thread sagar pareek
Arey yaar just see the my post...
i explained it step by step :)

On Sun, Aug 21, 2011 at 4:43 PM, Sanjay Rajpal srn...@gmail.com wrote:

 16

 8*(8-1*(8-1-1))


 Sanju
 :)



 On Sun, Aug 21, 2011 at 4:10 AM, Anjul Sharma annurocks1...@gmail.comwrote:

 is 336 the answer??

 On Aug 21, 11:10 am, SuDhir mIsHra sudhir08.mis...@gmail.com wrote:
  #includestdio.h
  #define FUNC1(i) (i*(i-1))
  #define FUNC2(i) (i==0?1:i*FUNC1(i-1))
  main()
  {
  int i=8;
 
  printf(\n%d,FUNC2(i));
 
 
 
 
 
 
 
  }

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



[algogeeks] Longest palindrome

2011-08-21 Thread sagar pareek
Suggest a method to find longest palindrome in a given string..

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



Re: [algogeeks] Re: amazon q

2011-08-21 Thread sagar pareek
+1 Dumanshu
This question was asked by amazon :D

And answer is BST only
coz deletion in heap(min heap) is O(1).
And if it is max heap then deletion of min element is O(n).

On Sun, Aug 21, 2011 at 9:13 PM, Dumanshu duman...@gmail.com wrote:

 We can't use a heap. Balanced BST is correct because Deletion of the
 smallest element Insertion of an
 element if it is not already present in the set - for this we need
 to search for the element and searching in heap is O(n).

 On Aug 21, 6:16 pm, priya ramesh love.for.programm...@gmail.com
 wrote:
  A data structure is required for storing a set of integers such that each
 of
  the following operations can be done in (log n) time, where n is the
 number
  of elements in the set. Deletion of the smallest element Insertion of an
  element if it is not already present in the set Which of the following
 data
  structures can be used for this purpose?
 
  ·  Pick one of the choices
 
  A heap can be used but not a balanced binary search tree
 
  A balanced binary search tree can be used but not a heap
 
  Both balanced binary search tree and heap can be used
 
  Neither balanced binary search tree nor heap can be used

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] SAP!!

2011-08-21 Thread sagar pareek
I don't think that SAP came anywhere in north campuses !!
as far as i know...

On Sun, Aug 21, 2011 at 9:29 PM, rashmi i rash...@gmail.com wrote:

 Kamakshi, do u have any idea about the SAP placement questions?


 On Sun, Aug 21, 2011 at 9:28 PM, rashmi i rash...@gmail.com wrote:

 Cummins College, Pune.


 On Sun, Aug 21, 2011 at 9:16 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 which college?

 On Sun, Aug 21, 2011 at 8:56 PM, rashmi i rash...@gmail.com wrote:


 Hey, SAP is visiting our college. Any idea about the pattern of the
 campus selection  process? As in type of questions asked? Thanks
 --
 R@$!-!
 DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS.

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




 --
 Regards,
 Kamakshi
 kamakshi...@gmail.com

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




 --
 R@$!-!
 DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS.




 --
 R@$!-!
 DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Adding Two numbers using bitwise operators only

2011-08-20 Thread sagar pareek
Refer half adder :)

*sum = a ^ b;
carry = a  b;
while (carry != 0)
{
carry = 1;
a = sum;
b = carry;
sum = a ^ b;
carry = a  b;
}*

On Sat, Aug 20, 2011 at 9:32 PM, Sanjay Rajpal srn...@gmail.com wrote:

 Hey frnds,

 I am stuck in a problem of adding two numbers using bitwise operators only.

 An explanation is required.


 Sanju
 :)

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Aricent

2011-08-20 Thread sagar pareek
Well yeah its a development company but my seniors haven't got their joining
yet. :( :(

On Sat, Aug 20, 2011 at 11:54 PM, Abhishek mailatabhishekgu...@gmail.comwrote:

 is 'Aricent' is a good company to join..


 Regards
 BIT Mesra
 MCA (III year)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/vWqY79gxSXcJ.
 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 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Sorting

2011-08-20 Thread sagar pareek
Hi every one:-

I encounter a problem in which we have to sort.

You come across a collection of 20 stone statues in a line. You want to
sort them by height, with the shortest statue on the left. The statues are
very heavy and you want to move them the least possible distance.
 Design a sorting algorithm that minimizes the total distance
that the statues are moved.

Answer :-

Whenever the swap operation for the objects being sorted
is expensive, one of the best things to do is indirect sort, i.e., sort
references
to the objects first and then apply the permutation that was applied
to the references in the end.
In the case of statues, we can assign increasing indices to the statues
from left to right and then sort the pairs of statue height and index. The
indices in the sorted pairs would give us the permutation to apply. While
applying permutation, we would want to perform it in a way that we
move each statue the minimum possible distance. We can achieve this
if each statue is moved exactly to its correct destination exactly once (no
intermediate swaps).

*
I am not getting the answer...please anyone explain it...

Thanks in advance :) :)*
-- 
**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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: crossing a bridge; running away from zombies (logic puzzle)

2011-08-20 Thread sagar pareek
@aditya
Any puzzle asked by any company doesn't mean that it belongs to that
particular company.

I encounter this question first time in 2005 through a flash game.

On Sun, Aug 21, 2011 at 12:17 AM, Aditya Virmani
virmanisadi...@gmail.comwrote:

 thts a Google question...17 is the answer


 On Sat, Aug 20, 2011 at 2:08 AM, Dave dave_and_da...@juno.com wrote:

 @Icy: A few years ago this was reported to be a Microsoft interview
 question. It is so well publicized now that most people here have
 probably seen it.

 1 and 2 cross.
 1 returns. (alternatively, 2 returns)
 5 and 10 cross.
 2 returns. (alternatively, 1 returns)
 1 and 2 cross.

 17 minutes.

 Dave

 On Aug 19, 3:25 pm, icy` vipe...@gmail.com wrote:
  Hey everyone,
  I recently joined this group, so I thought I'd add a short interview/
  logic puzzle that I remember hearing.  Hopefully it wasnt already
  said.  Part of the fun is the story, so here it goes...
 
  Four people have been running away from a pack of zombies, and are now
  injured in varying degrees.  It is already nighttime, and they have
  come upon a bridge.  They must cross the bridge as fast as possible
  before the pack of zombies comes upon them, but the bridge is very
  dark, slippery, and cannot support much weight.  There is one
  flashlight.  Rules:
 
  * the bridge must be crossed with the flashlight,  only two people at
  most.  A return trip must be made (the flashlight cannot be thrown
  back, etc)
  * the four people cross the bridge at different speeds:  1minute, 2
  minutes, 5 min, and 10min.   A trip time is determined by the slowest
  person.   So if the 1min crosses together with the 5min, the trip time
  is 5min.
  *if a person falls off the bridge, he/she goes to /dev/null;P
 
  So what is the fastest way for everyone to cross the bridge, and how
  long does that take?
 
  ~icy

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Sorting

2011-08-20 Thread sagar pareek
*The statues are
very heavy and you want to move them the least possible distance.*

On Sun, Aug 21, 2011 at 12:31 AM, priya ramesh 
love.for.programm...@gmail.com wrote:

 in quick sort the pivot is positioned to it's proper position. (no
 intermediate swaps)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Number of nodes at each level in binary tree

2011-08-20 Thread sagar pareek
2(power)i  or 2^i
where i is level  i=0,1,2,3..

On Sun, Aug 21, 2011 at 1:27 AM, bugaboo bharath.sri...@gmail.com wrote:

 Anyone knows the algorithm to count the number of nodes at each level
 in a binary tree. Providing the approach and logic better than the
 actual code itself.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Answer these ques !!

2011-08-19 Thread sagar pareek
@nair
Are these questions of CITRIX?

coz all these questions i already faced somewhere

On Fri, Aug 19, 2011 at 9:12 PM, priya ramesh 
love.for.programm...@gmail.com wrote:

 5th is option 1 sorry!

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Answer these ques !!

2011-08-19 Thread sagar pareek
ok i got it!!

oracle apps !!  :D :D

actually i got it from ur last post of bianry  tree question  :)  :)

On Fri, Aug 19, 2011 at 9:38 PM, sagar pareek sagarpar...@gmail.com wrote:

 ok nair so tell me from where u found these questions?


 On Fri, Aug 19, 2011 at 9:19 PM, jestincobol nair 
 jestinco...@gmail.comwrote:

 A binary search tree is defined as follows.

 Each node has a key, a value, a (possibly null) left child, and a
 (possibly null) right child.
 An ordering is defined on the keys to be stored in the tree.
 For a given node nd, the keys of all the nodes in its left subtree are
 “before” nd’s key, and the keys of all the nodes in its right subtree are
 “after” nd’s key.
 The depth of the root node is defined to be 0; the depth of any other
 node is 1 more than the depth of its parent.

 How would the next() function of a binary search tree’s iterator be
 defined, assuming no changes are made to the tree while the iterator is
 active?

 Note: next() should return the value at each node in order of the
 corresponding keys; also, assume for each answer that the iterator has been
 appropriately initialized before the first call to next().

 1. using a queue:

nd = q.remove()
q.add(nd.leftChild)
a.qdd(nd.rightChild)
return nd.value

 2. using a stack:

nd = stk.remove()
stk.add(nd.leftChild)
stk.add(nd.rightChild)
return nd.value

 3. using a stack:

nd = stk.remove()
nxt = nd.getRight()
while (null != nxt) { stk.push(nxt); nxt = nxt.getLeft(); }
return nd.value



 1 is correct


 2 is correct


 3 is correct


 None of these


 plz say ur answers for this ??


 On Fri, Aug 19, 2011 at 9:18 PM, jestincobol nair 
 jestinco...@gmail.comwrote:

 @ sagar:no dude  !! dese are of not of citrix :)


 On Fri, Aug 19, 2011 at 9:14 PM, sagar pareek sagarpar...@gmail.comwrote:

 @nair
 Are these questions of CITRIX?

 coz all these questions i already faced somewhere


 On Fri, Aug 19, 2011 at 9:12 PM, priya ramesh 
 love.for.programm...@gmail.com wrote:

 5th is option 1 sorry

  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



Re: [algogeeks]

2011-08-19 Thread sagar pareek
traverse the list and print only odd numbers and if even number encounter
store it in a stack and later on print it

On Fri, Aug 19, 2011 at 9:29 PM, sukran dhawan sukrandha...@gmail.comwrote:

 There is a Circular Singly Linked List with n nodes having sorted values
 from 1 to n. Need to print the odd and even numbers in groups in a single
 traversal.
 Eg. Input: 1-2-3-4-5-6-1 Output: {Any combination of Odd Nos} {Any
 combination of Even Nos} Eg. 1 3 5 6 4 2. write a program for same?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks]

2011-08-19 Thread sagar pareek
well we can take anything as he stated in any order

On Fri, Aug 19, 2011 at 9:49 PM, Abhishek Yadav
algowithabhis...@gmail.comwrote:

 Hey try queue instead of stack


 On Fri, Aug 19, 2011 at 9:47 PM, sagar pareek sagarpar...@gmail.comwrote:

 traverse the list and print only odd numbers and if even number encounter
 store it in a stack and later on print it

 On Fri, Aug 19, 2011 at 9:29 PM, sukran dhawan sukrandha...@gmail.comwrote:

 There is a Circular Singly Linked List with n nodes having sorted values
 from 1 to n. Need to print the odd and even numbers in groups in a single
 traversal.
 Eg. Input: 1-2-3-4-5-6-1 Output: {Any combination of Odd Nos} {Any
 combination of Even Nos} Eg. 1 3 5 6 4 2. write a program for same?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Search an array of unknown length

2011-08-19 Thread sagar pareek
@Sanjay
yeah its the very basic idea that comes in mind
but is your index searching log n ?
i think no !!
if yes then tell me how?

On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal srn...@gmail.com wrote:

 I forgot to mention one thing, at each comparison, store the index at which
 we searched previously.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal srn...@gmail.com wrote:

 You can do it very easily.

 I assume array is sorted and contains integers.

 Say start at position 1, if value at that index is equal to the value to
 be found, return index.
 else if value at that index is greater than the value to be found, we got
 an interval to search in.
 else(value at that index is smaller than the value to be found)
 search at location 10,then 100, then 1000 till you find an interval.

 Once you find an interval, perform Binary Search on this and get element
 in O(log n).

 Got it ?

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek sagarpar...@gmail.comwrote:

 HI,

 I have encountered a problem :-

 You have an array of  *UNKNOWN  *length . And you have to find an
 element in  O(log(n)) time without using any extra space.

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



  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Search an array of unknown length

2011-08-19 Thread sagar pareek
hmmm ok
i found a solution in which index searching is done by 2^i
which is more optimal
multiplication by 10 or 2 power i ??i=0,1,2,3.

On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal srn...@gmail.com wrote:

 See at each step you are multiplying the index to be compared by 10(say),
 this increase is exponential.
 Therefore the search is exponential and complexity is log n. Base depends
 on the factor by which you are multiplying for the next index to be
 compared.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek sagarpar...@gmail.comwrote:

 @Sanjay
 yeah its the very basic idea that comes in mind
 but is your index searching log n ?
 i think no !!
 if yes then tell me how?


 On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal srn...@gmail.com wrote:

 I forgot to mention one thing, at each comparison, store the index at
 which we searched previously.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal srn...@gmail.comwrote:

 You can do it very easily.

 I assume array is sorted and contains integers.

 Say start at position 1, if value at that index is equal to the value to
 be found, return index.
 else if value at that index is greater than the value to be found, we
 got an interval to search in.
 else(value at that index is smaller than the value to be found)
 search at location 10,then 100, then 1000 till you find an interval.

 Once you find an interval, perform Binary Search on this and get element
 in O(log n).

 Got it ?

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek 
 sagarpar...@gmail.comwrote:

 HI,

 I have encountered a problem :-

 You have an array of  *UNKNOWN  *length . And you have to find an
 element in  O(log(n)) time without using any extra space.

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



  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Search an array of unknown length

2011-08-19 Thread sagar pareek
Well i think it depends...
because range of   x and 10x is more than  i and 2i
no doubt multiple of 10 will give us early index but then to find number in
b/w indexes is more than of 2^i

On Fri, Aug 19, 2011 at 11:38 PM, Sanjay Rajpal srn...@gmail.com wrote:

 Multiplication by 10 or 2^i , it depends.

 Multiplication by 10 will be faster, I think.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 11:05 AM, sagar pareek sagarpar...@gmail.comwrote:

 hmmm ok
 i found a solution in which index searching is done by 2^i
 which is more optimal
 multiplication by 10 or 2 power i ??i=0,1,2,3.

 On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal srn...@gmail.com wrote:

 See at each step you are multiplying the index to be compared by 10(say),
 this increase is exponential.
 Therefore the search is exponential and complexity is log n. Base depends
 on the factor by which you are multiplying for the next index to be
 compared.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek sagarpar...@gmail.comwrote:

 @Sanjay
 yeah its the very basic idea that comes in mind
 but is your index searching log n ?
 i think no !!
 if yes then tell me how?


 On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal srn...@gmail.comwrote:

 I forgot to mention one thing, at each comparison, store the index at
 which we searched previously.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal srn...@gmail.comwrote:

 You can do it very easily.

 I assume array is sorted and contains integers.

 Say start at position 1, if value at that index is equal to the value
 to be found, return index.
 else if value at that index is greater than the value to be found, we
 got an interval to search in.
 else(value at that index is smaller than the value to be found)
 search at location 10,then 100, then 1000 till you find an
 interval.

 Once you find an interval, perform Binary Search on this and get
 element in O(log n).

 Got it ?

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek sagarpar...@gmail.com
  wrote:

 HI,

 I have encountered a problem :-

 You have an array of  *UNKNOWN  *length . And you have to find an
 element in  O(log(n)) time without using any extra space.

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



  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Search an array of unknown length

2011-08-19 Thread sagar pareek
:)

On Fri, Aug 19, 2011 at 11:43 PM, Sanjay Rajpal srn...@gmail.com wrote:

 Thats wat I said, it depends. Searching in the interval will compensate
 reaching the index earlier.
 So both are almost equivalent.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 11:12 AM, sagar pareek sagarpar...@gmail.comwrote:

 Well i think it depends...
 because range of   x and 10x is more than  i and 2i
 no doubt multiple of 10 will give us early index but then to find number
 in b/w indexes is more than of 2^i


 On Fri, Aug 19, 2011 at 11:38 PM, Sanjay Rajpal srn...@gmail.com wrote:

 Multiplication by 10 or 2^i , it depends.

 Multiplication by 10 will be faster, I think.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 11:05 AM, sagar pareek sagarpar...@gmail.comwrote:

 hmmm ok
 i found a solution in which index searching is done by 2^i
 which is more optimal
 multiplication by 10 or 2 power i ??i=0,1,2,3.

 On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal srn...@gmail.comwrote:

 See at each step you are multiplying the index to be compared by
 10(say), this increase is exponential.
 Therefore the search is exponential and complexity is log n. Base
 depends on the factor by which you are multiplying for the next index to 
 be
 compared.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek 
 sagarpar...@gmail.comwrote:

 @Sanjay
 yeah its the very basic idea that comes in mind
 but is your index searching log n ?
 i think no !!
 if yes then tell me how?


 On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal srn...@gmail.comwrote:

 I forgot to mention one thing, at each comparison, store the index at
 which we searched previously.

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal srn...@gmail.comwrote:

 You can do it very easily.

 I assume array is sorted and contains integers.

 Say start at position 1, if value at that index is equal to the
 value to be found, return index.
 else if value at that index is greater than the value to be found,
 we got an interval to search in.
 else(value at that index is smaller than the value to be found)
 search at location 10,then 100, then 1000 till you find an
 interval.

 Once you find an interval, perform Binary Search on this and get
 element in O(log n).

 Got it ?

 Sanju
 :)



 On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek 
 sagarpar...@gmail.com wrote:

 HI,

 I have encountered a problem :-

 You have an array of  *UNKNOWN  *length . And you have to find an
 element in  O(log(n)) time without using any extra space.

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



  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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] Re: probability! tough one to crack!

2011-08-19 Thread sagar pareek
GOOD one dave
and thanks divye for a wonderful explanation

On Fri, Aug 19, 2011 at 11:44 PM, DK divyekap...@gmail.com wrote:

 For those of you who want an explanation of Dave's answer, please refer to
 the diagram below.

 | 0.5 in |-| 0.5 in |
 xxx -
 xxx 0.5 in
 xxx -
 xx...xx   |
 xx...xx   |
 xx...xx   |
 xx...xx   |
 xxx -
 xxx 0.5 in
 xxx -

 Since the radius of the coin is 0.5 in, if the center of the coin falls in
 the x area, it will cross a grid line.
 So, probability of the coin not crossing the grid lines is area of dots /
 area of square = (1 inch square / 4 inch square) = 1/4

 --
 DK

 http://www.divye.in
 http://twitter.com/divyekapoor
 http://gplus.to/divyekapoor

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/osMGCscKC70J.

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



Re: [algogeeks] Re: Search an array of unknown length

2011-08-19 Thread sagar pareek
Well
sorry but i forget to mention exceptions in the solution.
Here is the complete solution :-

The key idea here is to simultaneously do a binary search
for the end of the array as well as the key. We try to look for A[2k ] in
the
k-th step and catch exceptions for successive values of k till either we hit
an exception or we hit a number greater than or equal to b. Then we do
a binary search for b between indices 2k - 1 and 2k . The runtime of the
search algorithm is 0 (l og 叫.

On Fri, Aug 19, 2011 at 11:53 PM, Dave dave_and_da...@juno.com wrote:

 @Everyone: The problem says that the array is of UNKNOWN length, but
 all of the solutions presented assume that the array is of INFINITE
 length. Suppose, e.g., that the length is 987, but you don't know
 that. Then it will be meaningless to probe at 1, 10, 100, 1000, etc,
 or 1, 2, 4, ..., 512, 1024 because any probe beyond 987 is outside the
 array. An address violation may occur, or arbitrary data, unrelated to
 the data in the array may be used. I think the problem as stated is
 unsolvable.

 Dave

 On Aug 19, 12:48 pm, sagar pareek sagarpar...@gmail.com wrote:
  HI,
 
  I have encountered a problem :-
 
  You have an array of  *UNKNOWN  *length . And you have to find an element
  in  O(log(n)) time without using any extra space.
 
  --
  **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...@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 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.



Re: [algogeeks] Re: Search an array of unknown length

2011-08-19 Thread sagar pareek
thanks for pointing it out

On Sat, Aug 20, 2011 at 12:16 AM, Dave dave_and_da...@juno.com wrote:

 @Sagar: So far so good, but you are not guaranteed to get an
 exception. Example, int a[987] is followed in memory by char
 b[1000], which is a dictionary. You won't detect an exception
 until you get to at least a[262144] (2 to the 18th). But you will pick
 up plenty of garbage which may throw off your binary search.

 Dave

 On Aug 19, 1:26 pm, sagar pareek sagarpar...@gmail.com wrote:
  Well
  sorry but i forget to mention exceptions in the solution.
  Here is the complete solution :-
 
  The key idea here is to simultaneously do a binary search
  for the end of the array as well as the key. We try to look for A[2k ] in
  the
  k-th step and catch exceptions for successive values of k till either we
 hit
  an exception or we hit a number greater than or equal to b. Then we do
  a binary search for b between indices 2k - 1 and 2k . The runtime of the
  search algorithm is 0 (l og 叫.
 
 
 
 
 
  On Fri, Aug 19, 2011 at 11:53 PM, Dave dave_and_da...@juno.com wrote:
   @Everyone: The problem says that the array is of UNKNOWN length, but
   all of the solutions presented assume that the array is of INFINITE
   length. Suppose, e.g., that the length is 987, but you don't know
   that. Then it will be meaningless to probe at 1, 10, 100, 1000, etc,
   or 1, 2, 4, ..., 512, 1024 because any probe beyond 987 is outside the
   array. An address violation may occur, or arbitrary data, unrelated to
   the data in the array may be used. I think the problem as stated is
   unsolvable.
 
   Dave
 
   On Aug 19, 12:48 pm, sagar pareek sagarpar...@gmail.com wrote:
HI,
 
I have encountered a problem :-
 
You have an array of  *UNKNOWN  *length . And you have to find an
 element
in  O(log(n)) time without using any extra space.
 
--
**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...@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 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 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: exit() vs. _exit()

2011-08-18 Thread sagar pareek
Well i dont know about ur case but  _exit() is use to exit from current
process only like to exit child in fork()
and exit() is use to exit whole process tree

On Thu, Aug 18, 2011 at 3:26 PM, Amol Sharma amolsharm...@gmail.com wrote:

 anyone ??
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Thu, Aug 18, 2011 at 10:40 AM, Amol Sharma amolsharm...@gmail.comwrote:

 what is the difference between exit() and _exit

 http://ideone.com/MCzGy

 http://ideone.com/SxbwT

 when i am using exit() hello world is printed but with _exit() nothing
 gets printed though it ran successfully.plz explain why is so happening
 ??


 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT 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...@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 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.



Re: [algogeeks] Amazon Question

2011-08-18 Thread sagar pareek
Hashing
:)

On Thu, Aug 18, 2011 at 5:30 PM, Ankur Garg ankurga...@gmail.com wrote:

 Define a data structure , using extra memory/space , such that :

 Insert(int a)
 Delete(int a)
 isPresent(int a)
 get(int a)

 All above operations on the defined data structure take O(1) , i.e.
 constant time.


 Any suggestions /solutions for this problem


 Regards

 Ankur

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Amazon Question

2011-08-18 Thread sagar pareek
Common yaar its very simple
it is good for u to go in deep hence google it or refer a good data
structure book

On Thu, Aug 18, 2011 at 5:36 PM, Ankur Garg ankurga...@gmail.com wrote:

 Can u provide a bit detail bro !!


 On Thu, Aug 18, 2011 at 8:04 AM, sagar pareek sagarpar...@gmail.comwrote:

 Hashing
 :)

 On Thu, Aug 18, 2011 at 5:30 PM, Ankur Garg ankurga...@gmail.com wrote:

 Define a data structure , using extra memory/space , such that :

 Insert(int a)
 Delete(int a)
 isPresent(int a)
 get(int a)

 All above operations on the defined data structure take O(1) , i.e.
 constant time.


 Any suggestions /solutions for this problem


 Regards

 Ankur

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: citrix rd????

2011-08-17 Thread sagar pareek
yaar if u know C  then u too can attempt the question
but some of new operators like '' is used for referencing and all must be
known
also inheritence implementation, overloading, overridding etc

On Mon, Aug 15, 2011 at 9:32 PM, priya ramesh 
love.for.programm...@gmail.com wrote:

 @sagar: Can you please upload important c++ docs?? I have no idea what to
 emphasize on in c++ and my placements starting in sometime. Plz help

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread sagar pareek
16, 61, 106  average speed is 45 miles/hour

On Wed, Aug 17, 2011 at 10:28 PM, priya ramesh 
love.for.programm...@gmail.com wrote:

 A car is traveling at a uniform speed.The driver sees a milestone showing a
 2-digit number. After traveling for an hour the driver sees another
 milestone with the same digits in reverse order.After another hour the
 driver sees another milestone containing the same two digits. What is the
 average speed of the driver?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
@rajul

61-16 =45

its not 55 miles per hour

On Wed, Aug 17, 2011 at 11:33 PM, Don dondod...@gmail.com wrote:

 Actually you are all wrong. His uniform speed was zero, and he was
 sitting by milestone 44 the whole time.

 On Aug 17, 11:58 am, priya ramesh love.for.programm...@gmail.com
 wrote:
  A car is traveling at a uniform speed.The driver sees a milestone showing
 a
  2-digit number. After traveling for an hour the driver sees another
  milestone with the same digits in reverse order.After another hour the
  driver sees another milestone containing the same two digits. What is the
  average speed of the driver?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
@rajul dave
45 miles per hour is uniform speed

On Wed, Aug 17, 2011 at 11:49 PM, rajul jain rajuljain...@gmail.com wrote:

 but its speed is uniform i think Don answer is right


 On Wed, Aug 17, 2011 at 11:42 PM, Douglas Diniz dgdi...@gmail.com wrote:

 There are infinite solutions with this logic, because the third
 milestone can have more than 2 digits.

 On Wed, Aug 17, 2011 at 3:08 PM, sagar pareek sagarpar...@gmail.com
 wrote:
  @rajul
 
  61-16 =45
 
  its not 55 miles per hour
 
  On Wed, Aug 17, 2011 at 11:33 PM, Don dondod...@gmail.com wrote:
 
  Actually you are all wrong. His uniform speed was zero, and he was
  sitting by milestone 44 the whole time.
 
  On Aug 17, 11:58 am, priya ramesh love.for.programm...@gmail.com
  wrote:
   A car is traveling at a uniform speed.The driver sees a milestone
   showing a
   2-digit number. After traveling for an hour the driver sees another
   milestone with the same digits in reverse order.After another hour
 the
   driver sees another milestone containing the same two digits. What is
   the
   average speed of the driver?
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  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@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.
 



 --
 ---
 Douglas Gameiro Diniz
 Engenheiro de Computação - 2003 - UNICAMP

 Mobile: (19) 92158777
 Gtalk: dgdiniz
 Msn: thedougdi...@hotmail.com

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
@Douglas
nopes there is only one solution

here it is

*

See

answer is in the question

ques is saying that first there is 2 digit number

after 1 hour number interchanged

so let numbers be

xy
then yx

now third it is saying that both numbers are again repeating

and we also know that yxxy and yx-xy 100

so third number must be

1bc

where bc may be xy or yx or having any one of x or y when one may be '1'

now

x*10+y + z = y*10 + x

also

1bc  = 10*y + x + z

1bc = yx + yx - xy

1bc = 2yx -xy

1bc = 2*(10y+x) - 10x -y

1bc= 20y +2x -10x -y

1bc= 19y - 8x

now let

number be

1xy = 100 + 10*x +y = 19y - 8x

100 + 18x = 18y

50 + 9x = 9y -- no integer solution

now let
number be

1yc where x=1

so 100 + 10y + c = 19y - 8

108 + c = 9y -- gives either y9 or c9

and it will not satisfy the conditions except the following
now let
number be

where x=1

1cy = 100 +10c + y = 19y - 8

108 +10c = 18y -- gives y=6 and c=0

i hope i explain better

:) :)
*



On Wed, Aug 17, 2011 at 11:51 PM, sagar pareek sagarpar...@gmail.comwrote:

 @rajul dave
 45 miles per hour is uniform speed


 On Wed, Aug 17, 2011 at 11:49 PM, rajul jain rajuljain...@gmail.comwrote:

 but its speed is uniform i think Don answer is right


 On Wed, Aug 17, 2011 at 11:42 PM, Douglas Diniz dgdi...@gmail.comwrote:

 There are infinite solutions with this logic, because the third
 milestone can have more than 2 digits.

 On Wed, Aug 17, 2011 at 3:08 PM, sagar pareek sagarpar...@gmail.com
 wrote:
  @rajul
 
  61-16 =45
 
  its not 55 miles per hour
 
  On Wed, Aug 17, 2011 at 11:33 PM, Don dondod...@gmail.com wrote:
 
  Actually you are all wrong. His uniform speed was zero, and he was
  sitting by milestone 44 the whole time.
 
  On Aug 17, 11:58 am, priya ramesh love.for.programm...@gmail.com
  wrote:
   A car is traveling at a uniform speed.The driver sees a milestone
   showing a
   2-digit number. After traveling for an hour the driver sees another
   milestone with the same digits in reverse order.After another hour
 the
   driver sees another milestone containing the same two digits. What
 is
   the
   average speed of the driver?
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  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@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.
 



 --
 ---
 Douglas Gameiro Diniz
 Engenheiro de Computação - 2003 - UNICAMP

 Mobile: (19) 92158777
 Gtalk: dgdiniz
 Msn: thedougdi...@hotmail.com

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


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




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




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



Re: [algogeeks] Re: citrix rd????

2011-08-15 Thread sagar pareek
C++

On Mon, Aug 15, 2011 at 12:37 AM, htross htb...@gmail.com wrote:

 should i study OOP concepts in c++ for the written test??

 On Aug 14, 2:49 pm, sagar pareek sagarpar...@gmail.com wrote:
  in networking give emphasis on protocols
  like ARP, DHCP and all
 
 
 
 
 
 
 
 
 
  On Sun, Aug 14, 2011 at 3:09 PM, htross htb...@gmail.com wrote:
   one more thing from networks should we study theory concepts or
   programming constructs???should we study object oriented concepts???
 
   On Aug 14, 2:04 pm, sagar pareek sagarpar...@gmail.com wrote:
no c
only C++
questions mainly were to get the o/p of program
 
On Sun, Aug 14, 2011 at 1:30 PM, htross htb...@gmail.com wrote:
 was the aptitude on c or c++???i mean did the aptitude contain
 questions on classes and objects???
 
 On Aug 14, 2:00 am, sagar pareek sagarpar...@gmail.com wrote:
  sorry it is 3 hand written codes in 1 hour
 
  On Sun, Aug 14, 2011 at 2:29 AM, sagar pareek 
 sagarpar...@gmail.com
 
 wrote:
   First they have writtwen (45 quwestions in 60 mins)
   Major (70-80% + ) on C++ .. simple... no need to  study in deep
   networking need deep study...
   Some apti
   i dont remember of apti and os (if it is there then it has very
   less
 part)
 
   then 1 hour
   23 hand written codes
 
   logic based...no need a good coder but know how to do in best
 way
   mine questions were
 
   1. array given with two neighbor elements have distance of
 -1,0or 1
   like
 
   6,6,5,5,6,5,4,3,2,1,1,0
 
   find 2
   logic is simple
   take diff b/w given no. and array element and then jump to the
   location
   with the diff
 
   2.
   array given in decreasing then increasing order.
   find number
   like
   9 8 7 6 1 2 3 4 5
 
   3. rotate 2-d matrix in place (mean in O(1) space)
   first transpose and then swap columns
 
   On Sat, Aug 13, 2011 at 11:34 PM, htross htb...@gmail.com
 wrote:
 
   any one else who has wrote citrix rd this year???please
 please
   reply.a last ray of hope
 
   On Aug 13, 10:59 pm, Yasir yasir@gmail.com wrote:
I havn't attended citrix's campus drive this year.
This is the last year's process. Hopefully would be same. :)
 
Good Luck!
 
   --
   You received this message because you are subscribed to the
 Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to
 algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   **Regards
   SAGAR PAREEK
   COMPUTER SCIENCE AND ENGINEERING
   NIT ALLAHABAD
 
  --
  **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...@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 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 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...@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 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.



Re: [algogeeks] array ques

2011-08-15 Thread sagar pareek
int lol=2; // total lol's encountered upto now

lol++;

On Mon, Aug 15, 2011 at 12:41 AM, aditi garg aditi.garg.6...@gmail.comwrote:

 lol


 On Mon, Aug 15, 2011 at 12:40 AM, aditya kumar 
 aditya.kumar130...@gmail.com wrote:

 @aditi : sry i dint realise that n  log n .:P

 On Mon, Aug 15, 2011 at 12:38 AM, aditi garg 
 aditi.garg.6...@gmail.comwrote:

 @aditya : dis is obviously correct bt here complexity will be O(n) bt we
 are asked to gv O(log n) solution

 On Mon, Aug 15, 2011 at 12:37 AM, aditya kumar 
 aditya.kumar130...@gmail.com wrote:

 for(j=0;jn;j++)
 {
 if(a[j]==j)
  return j;
  else
  continue ;
 }

 this shud also be correct right ??

 On Mon, Aug 15, 2011 at 12:31 AM, Akash Mukherjee 
 akash...@gmail.comwrote:

 just my 2 cents  in d binary search, replacing key with mid, ie
 if(a[mid]  mid)
 check lower half
 else upper half

 should work??


 On Mon, Aug 15, 2011 at 12:26 AM, aditi garg 
 aditi.garg.6...@gmail.com wrote:

 Given an ordered array A[1…n] with numbers in strictly increasing
 order. Find a ‘j’ such that A [j]=j or -1 if no such number exist in
 o (log n).

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


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


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




 --
 Aditi Garg
 Undergraduate Student
 Electronics  Communication Divison
 NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
 Sector 3, Dwarka
 New Delhi


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


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




 --
 Aditi Garg
 Undergraduate Student
 Electronics  Communication Divison
 NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
 Sector 3, Dwarka
 New Delhi


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] MS question

2011-08-15 Thread sagar pareek
Well sambyal
i just know that neither trie nor link list is the answer

may be you have to make ur own data structure using *array of structure *having
elements like long carry, long long number and all..
i m not sure

On Mon, Aug 15, 2011 at 11:21 AM, siddharam suresh
siddharam@gmail.comwrote:

 i feel, doubly linked list. Whenever addition/subtraction is done we
 take/put the from/to to next digit. in doubly linked list its easy to
 move/go back and forth.
 Thank you,
 Siddharam



 On Mon, Aug 15, 2011 at 8:41 AM, ankit sambyal ankitsamb...@gmail.comwrote:

 @sagar : What is the best answer for this question ??

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] Assignment!!

2011-08-15 Thread sagar pareek
http://en.wikipedia.org/wiki/Comma_operator

On Mon, Aug 15, 2011 at 11:24 AM, shady sinv...@gmail.com wrote:

 read abt assignments and statements in C


 On Mon, Aug 15, 2011 at 11:14 AM, muthu raj muthura...@gmail.com wrote:

 What is the difference between the following statements.

 int a=1,2,3 ;
  and

 int a;
 a=1,2,3;


 first one is an error while second one is not.

  Can Any one  tell  me y ?







 *Muthuraj R
 IV th Year , ISE
 PESIT , Bangalore*

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-15 Thread sagar pareek
+unsubscribe@**googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at http://groups.google.com/*
 *group/algogeeks?hl=enhttp://groups.google.com/group/algogeeks?hl=en
 .


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




 --
 Aditi Garg
 Undergraduate Student
 Electronics  Communication Divison
 NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
 Sector 3, Dwarka
 New Delhi


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



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




 --
 Aditi Garg
 Undergraduate Student
 Electronics  Communication Divison
 NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
 Sector 3, Dwarka
 New Delhi


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


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




 --
 Regards
 Siddharth Srivastava


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


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




 --
 Ankur Khurana
 Computer Science
 Netaji Subhas Institute Of Technology
 Delhi.

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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



Re: [algogeeks] string confusion

2011-08-14 Thread sagar pareek
arshad
u got my point or not?

On Sun, Aug 14, 2011 at 1:16 PM, Arshad Alam alam3...@gmail.com wrote:

 program is running smooth but I have one confusion at line number 8.
 why it is *while(s[i]!=0)* instead of *while(s[i]!='\0')*



 1.#includestdio.h
 2.#includeconio.h
 3.void main()
 4.{
 5.clrscr();
 6.char s[]=No two viruses;
 7.int i=0;
 8.while(s[i]!=0)
 9.{
 10.printf(\n%c %c,s[i],*(s+i));
 11.printf ( \n%c %c,i[s],*(i+s));
 12.i++;
 13.  }
 14.  getch();
 15.}




 Thanks  Regards
 Arshad Nadeem Alam


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 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@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.



  1   2   3   4   >