Re: [algogeeks] Programs

2011-09-11 Thread Kamakshii Aggarwal
@neha:can u pls explain ur method?

On Sun, Sep 11, 2011 at 9:09 PM, sukran dhawan sukrandha...@gmail.comwrote:

 ya +1 to neha use bitset concept in c++


 On Sun, Sep 11, 2011 at 8:24 PM, Neha Singh neha.ndelhi.1...@gmail.comwrote:

 for ques 1 use bit manipulation
 its more efficient

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



Re: [algogeeks] IOCL

2011-09-09 Thread Kamakshii Aggarwal
dr's get shortlisted and den direct interview..no written test

On Fri, Sep 9, 2011 at 10:27 PM, Dheeraj Sharma dheerajsharma1...@gmail.com
 wrote:

 can anyone tell me the procedure for IOCL?
 paper nd all

 --
 *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.




-- 
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.



Re: [algogeeks] os

2011-09-07 Thread Kamakshii Aggarwal
@mohit:answer is 19.one is the parent process originally.and 19 more
processes have been created.

On Wed, Sep 7, 2011 at 11:21 PM, Mohit Goel mohitgoel291...@gmail.comwrote:

 20 is not in option ..so whats the answer??

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



Re: [algogeeks] activation record

2011-09-02 Thread Kamakshii Aggarwal
what are activation records??

On Fri, Sep 2, 2011 at 9:00 PM, sukran dhawan sukrandha...@gmail.comwrote:

 true


 On Fri, Sep 2, 2011 at 7:44 PM, priya ramesh 
 love.for.programm...@gmail.com wrote:

 Allocation and deallocation of activation records is always done using a
 stack
 (LIFO) structure. True or false??

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



[algogeeks] finding duplicates

2011-08-30 Thread Kamakshii Aggarwal
develop an algorithm to find duplicates in a list of numbers without using a
binary tree..if there are n distinct numbers in the list ,how many times
must two numbers be compared for equality in your algorithm?what if all
numbers are equal?

-- 
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.



Re: [algogeeks] c doubt

2011-08-30 Thread Kamakshii Aggarwal
@prateek:can u pls explain y the o/p will be 8??according to me also o/p
should be 4.

On Tue, Aug 30, 2011 at 11:42 PM, PRATEEK VERMA prateek...@gmail.comwrote:

 @kartik it's wrong output...output will be 8 bytes.I asked this question
 just to give more clear picture of bit field

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



Re: [algogeeks] Re: finding duplicates

2011-08-30 Thread Kamakshii Aggarwal
@dave:is there any other method than sorting?

On Wed, Aug 31, 2011 at 12:19 AM, Dave dave_and_da...@juno.com wrote:

 @Kamakshii: With O(1) extra space, it can be done with O(n)
 comparisons. Do a radix sort on the input (no comparisons), and then
 check adjacent numbers for equality.

 Dave

 On Aug 30, 1:34 pm, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
  develop an algorithm to find duplicates in a list of numbers without
 using a
  binary tree..if there are n distinct numbers in the list ,how many times
  must two numbers be compared for equality in your algorithm?what if all
  numbers are equal?
 
  --
  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.




-- 
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.



Re: [algogeeks] C puzzle

2011-08-29 Thread Kamakshii Aggarwal
http://ideone.com/o4r4o

but it is calling red and green just two times each..

On Mon, Aug 29, 2011 at 11:06 PM, rajeev bharshetty rajeevr...@gmail.comwrote:

 @Anup : I think you should also try to compile and check the answer...
 May be I am wrong But compiler won't


 On Mon, Aug 29, 2011 at 11:02 PM, Anup Ghatage ghat...@gmail.com wrote:

 @Rajeev:

 I had written down the recursion tree on paper but since you said that
 there were 10 reds and greens, I compiled the code and checked it myself.
 I'm afraid you are wrong my friend.

 The correct answer is indeed 6 RED and 10 GREEN calls.

 --
 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
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

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



Re: [algogeeks] Que of Tejas Network

2011-08-28 Thread Kamakshii Aggarwal
let arr[] stores the value of max amount upto each shop that they can rob.

arr[1]=x[1];
arr[2]=x[2];
for(i=3;i=n;i++)
{
arr[i]=max{(arr[i-2]+x[i]),arr[i-1]};
}

arr[n] gives the max amount that can be robbed...
correct me if i am wrong.
@prag:has tejas networks visited ur campus?


On Sun, Aug 28, 2011 at 6:34 PM, Prags onlypr...@gmail.com wrote:

 Q- There are n consecutive shops. two mafias plan to rob the shops. Each
 shop has cash in their locker. there is one restriction that they cannot rob
 any consecutive shop. write a program that will maximize their profit.
 cash in the shops were given in x[i] i=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.




-- 
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.



Re: [algogeeks] algo ques

2011-08-28 Thread Kamakshii Aggarwal
what is the initial value of length that u r passing??

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

 Hi, you can do this by recursion ,

 printPath (int length)
 {
  if(lenght == N) return;
 else
 {
   if(lenght+1 = N)  { Printf ( --one step --) call printPath
 (length+1) }
  else if(lenght+2 = N)  { Printf ( --two steps --) call printPath
 (length+2) }
 else
 return;

 }
 }
 On Sun, Aug 28, 2011 at 5:42 PM, himanshu kansal 
 himanshukansal...@gmail.com wrote:

 you have a path of N steps
 at every step, you can take onl;y 1 step or 2 steps.

 how to print all the possible paths that you can take..

 PS: please dont give the exact code.your approaches will be
 appreciated:)

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



Re: [algogeeks] algo ques

2011-08-28 Thread Kamakshii Aggarwal
@prashant:
if u remove else from this line
else if(lenght+2 = N)
{ Printf ( --two steps --) call printPath (length+2) }
i think then the code will work properly.
correct me if i am wrong
On Sun, Aug 28, 2011 at 7:01 PM, prashant thorat
prashantnit...@gmail.comwrote:

 sorry, pls ignore above code ..a bit modifie code

 I'm passing length  = 0


 printPath (int length)
 {
  if(lenght == N) return;
 else
 {
   if(lenght+1 = N)
  { Printf ( --one step --) call printPath (length+1) }

   else if(lenght+2 = N)
 { Printf ( --two steps --) call printPath (length+2) }

   else
return;
 }
 On Sun, Aug 28, 2011 at 6:54 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 what is the initial value of length that u r passing??

 On Sun, Aug 28, 2011 at 6:47 PM, prashant thorat 
 prashantnit...@gmail.com wrote:

 Hi, you can do this by recursion ,

 printPath (int length)
 {
  if(lenght == N) return;
 else
 {
   if(lenght+1 = N)  { Printf ( --one step --) call printPath
 (length+1) }
  else if(lenght+2 = N)  { Printf ( --two steps --) call printPath
 (length+2) }
 else
 return;

 }
 }
 On Sun, Aug 28, 2011 at 5:42 PM, himanshu kansal 
 himanshukansal...@gmail.com wrote:

 you have a path of N steps
 at every step, you can take onl;y 1 step or 2 steps.

 how to print all the possible paths that you can take..

 PS: please dont give the exact code.your approaches will be
 appreciated:)

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




 --
 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,
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.



Re: [algogeeks] Que of Tejas Network

2011-08-28 Thread Kamakshii Aggarwal
@rohit:i got my mistake..insteat of arr[2]=x[2];
it should be arr[2]=max{x[1],x[2]}


so now my code goes lyk this
let arr[] stores the value of max amount upto each shop that they can rob.

arr[1]=x[1];
arr[2]=max{x[1],x[2]};


for(i=3;i=n;i++)
{
arr[i]=max{(arr[i-2]+x[i]),arr[i-1]};
}

arr[n] gives the max amount that can be robbed...
correct me if i am wrong.


On Sun, Aug 28, 2011 at 7:37 PM, Anurag Narain anuragnar...@gmail.comwrote:

 i tink logic which kamakshi gave is correct



 code for same:::


 #includestdio.h

 int max(int a,int b)
 {
 return (ab?a:b);
 }

 int value(int a[],int l)
 {
 if(l0)
 return 0;
 return max(a[l]+value(a,l-2),value(a,l-1));
 }

 int main()
 {
 int a[]={4,3,2,5,7,8};
 printf(max::%d,value(a,5));
 return 0;

 }

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



[algogeeks] Tejas networks

2011-08-27 Thread Kamakshii Aggarwal
can anyone tell about tejas networks recruitment procedure?
and also what topics are being asked?

-- 
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.



Re: [algogeeks] Tejas networks

2011-08-27 Thread Kamakshii Aggarwal
thanks dheeraj...and yeah u r correct..:)

On Sat, Aug 27, 2011 at 11:54 PM, Dheeraj Sharma 
dheerajsharma1...@gmail.com wrote:

 its still to come in our college..but u can go through this link..i hope it
 wud help u..

 http://sameerbsws.blogspot.com/2010/12/latest-tejas-networks-placement-papers.html
 coz i thnk..u r frnd of one of mah close frnd ;)

 On Sat, Aug 27, 2011 at 11:45 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 can anyone tell about tejas networks recruitment procedure?
 and also what topics are being asked?

 --
 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.




 --
 *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.




-- 
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.



Re: [algogeeks] Doubt

2011-08-21 Thread Kamakshii Aggarwal
But on dev c it is showing o/p as 2 2 ..
I too have a doubt,a similar question was asked in atrenta's written paper.

On Sun, Aug 21, 2011 at 8:14 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:

 can somebody please explain this ?


 On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.comwrote:

 http://www.ideone.com/kRaMj

 I found this in the algogeeks forum only. Can anyone explain how value of
 i is still 0, but *p shows 2 although their addresses are the same.

 --
 Nikhil Gupta

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




-- 
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.



Re: [algogeeks] SAP!!

2011-08-21 Thread Kamakshii Aggarwal
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.



Re: [algogeeks] C dot

2011-08-19 Thread Kamakshii Aggarwal
@aditi: ab c-dot ka kya karna hai tujhe?:P

On Fri, Aug 19, 2011 at 7:26 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 Do u knw wat type of ques asked in interviews?
 Plz post a few as example if u knw...please...

 On Fri, Aug 19, 2011 at 7:25 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 k thanx :)


 On Fri, Aug 19, 2011 at 7:19 PM, Sanjay Rajpal 
 tosanjayraj...@gmail.comwrote:

 In our college, students were shortlisted on the basis of GPA.Then Direct
 interview was conducted.

 *Regards

 Sanju

 Happy to Help :)*




 On Fri, Aug 19, 2011 at 6:44 AM, aditi garg 
 aditi.garg.6...@gmail.comwrote:

 Does anyone know the placement procedure of C Dot?

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





 --
 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,
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.



Re: [algogeeks] Re: mcq-os

2011-08-16 Thread Kamakshii Aggarwal
the one which rajeev posted..

On Tue, Aug 16, 2011 at 8:00 PM, nivedita arora vivaciousnived...@gmail.com
 wrote:

 hey yar whch book are you doing for OS mcq ??


 On Aug 15, 6:07 pm, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
  I am confused about the race around..according  to me it should be
 included
  with other options,but in the book which i am referring its not
 included..
 
  On Mon, Aug 15, 2011 at 6:35 PM, rajeev bharshetty rajeevr...@gmail.com
 wrote:
 
 
 
 
 
 
 
 
 
   All the above 1,2,3
   Semaphores help to prevent race conditions in a program.
   They help in process synchronization by allowing multiple processes
 access
   to a common shared memory .
   and they also solve the problem of mutual exclusion allowing only a
 single
   process in a critical region at a time.
 
   Correct me if i am wrong.
 
   On Mon, Aug 15, 2011 at 6:29 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com
wrote:
 
   semaphores are used to solve the problem of?
   1.process synchronization
   2.race around
   3.mutual exclusion.
 
   --
   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.
 
   --
   Regards
   Rajeev N B http://www.opensourcemania.co.cc
 
   *Winners Don't do Different things , they do things Differently*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.




-- 
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.



[algogeeks] mcq-os

2011-08-15 Thread Kamakshii Aggarwal
semaphores are used to solve the problem of?
1.process synchronization
2.race around
3.mutual exclusion.

-- 
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.



Re: [algogeeks] Operators

2011-08-15 Thread Kamakshii Aggarwal
* - used for multiplication as well as dereferencing
 =use for bit wise and and also for address
# also i guess


On Mon, Aug 15, 2011 at 6:45 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 Pick the operators whose meaning is context dependent?
 1. *
 2.#
 3.
 4.No such operator exists
 Plz gv the diff contexts if applicable...

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



Re: [algogeeks] mcq-os

2011-08-15 Thread Kamakshii Aggarwal
I am confused about the race around..according  to me it should be included
with other options,but in the book which i am referring its not included..

On Mon, Aug 15, 2011 at 6:35 PM, rajeev bharshetty rajeevr...@gmail.comwrote:

 All the above 1,2,3
 Semaphores help to prevent race conditions in a program.
 They help in process synchronization by allowing multiple processes access
 to a common shared memory .
 and they also solve the problem of mutual exclusion allowing only a single
 process in a critical region at a time.

 Correct me if i am wrong.

 On Mon, Aug 15, 2011 at 6:29 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 semaphores are used to solve the problem of?
 1.process synchronization
 2.race around
 3.mutual exclusion.

 --
 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.




 --
 Regards
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

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



Re: [algogeeks] operating system mcq

2011-08-15 Thread Kamakshii Aggarwal
@rajeev: this link is not working...

On Mon, Aug 15, 2011 at 4:21 PM, rajeev bharshetty rajeevr...@gmail.comwrote:

 Timothy J William MCQ's


 http://s244.filesonic.in/download/1662179664/4e47a18f/6312d950/0/1/b4d72a29/0/49e7f6c2daf916cf807a0678329c153d3324519b


 On Mon, Aug 15, 2011 at 3:24 AM, nivedita arora 
 vivaciousnived...@gmail.com wrote:

 hi,
 can someone pls provide good source from where i can prac mcq on OS .
 thx

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

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



Re: [algogeeks] Operators

2011-08-15 Thread Kamakshii Aggarwal
@rajeev:+1

On Mon, Aug 15, 2011 at 6:50 PM, rajeev bharshetty rajeevr...@gmail.comwrote:

 Does context dependent means a single operator having different meaning
 when used in different contexts or scenarios???
 If so then * is dereferencing operator for pointers and also an arithmetic
 operator
 as *a pointer dereference and a*b multiplication

 and  (bitwise and) and also address operator if used as int *a=a

 and # is used for concatenation as s1##s2
 or to keep the name as it is we use #s1

 Correct me if i am wrong

 On Mon, Aug 15, 2011 at 6:45 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 Pick the operators whose meaning is context dependent?
 1. *
 2.#
 3.
 4.No such operator exists
 Plz gv the diff contexts if applicable...

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

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



Re: [algogeeks] mcq-os

2011-08-15 Thread Kamakshii Aggarwal
@rajeev:thanks a lot..the link is really very nice..:)

On Mon, Aug 15, 2011 at 7:41 PM, rajeev bharshetty rajeevr...@gmail.comwrote:

 @kamakshi : Check this link.
 It has a very good explanation

 http://stargazer.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/sync.htm


 On Mon, Aug 15, 2011 at 6:37 PM, sandeep pandey 
 sandeep.masum4...@gmail.com wrote:

 ya i also think all of d above..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

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



Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
@ankur:tere code se wrong answer ayegafor n=4 there are 5 solutions...
therefore arr[2]should be 2,par teer code me its 1...
arr[1]=1
arr[2]=2;
now start from arr[3];

On Sun, Aug 14, 2011 at 9:57 AM, Ankur Khurana ankur.kkhur...@gmail.comwrote:

 it's a simple dp , ned not be knapsack one.

 int arr[n];
 arr[0]=0
 arr[1]=1;

 for(int i=2;i=n;i++)
 {
 arr[i]=arr[i-1]+arr[i-2];
 }

 do you get the code ? i mean , pseudo code was almost similar.


 On Sun, Aug 14, 2011 at 1:34 AM, sagar pareek sagarpar...@gmail.comwrote:

 Sorry 4 above post i thought it a diff ques


 On Sun, Aug 14, 2011 at 1:33 AM, sagar pareek sagarpar...@gmail.comwrote:

 its n/2+1


 On Sat, Aug 13, 2011 at 8:45 PM, Puneet Goyal 
 puneetgoya...@gmail.comwrote:

 I think it's fibonacci series...
 T(n)= T(n-1) + T(n-2)

 Explanation:
 T(n): no. of ways for n stairs

 T(n-1): when it took the first step as 1 stair

 t(n-2): when it took the first step as 2 stairs

 the series can be started as
 T(1)=1
 T(2)=2
 and calculate the rest from above

 On Sat, Aug 13, 2011 at 8:37 PM, Gaurav Menghani 
 gaurav.mengh...@gmail.com wrote:

 Knapsack DP

 On Sat, Aug 13, 2011 at 8:35 PM, Kamakshii Aggarwal
 kamakshi...@gmail.com wrote:
  yes
 
  On Sat, Aug 13, 2011 at 8:30 PM, Puneet Goyal 
 puneetgoya...@gmail.com
  wrote:
 
  1 or 2 stairs?
 
  On Sat, Aug 13, 2011 at 8:24 PM, Kamakshii Aggarwal
  kamakshi...@gmail.com wrote:
 
  Given n stairs, how many number of ways can you climb if u use
 either 1
  or 2 at a time?
  --
  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.
 
 
 
  --
 
 ---
  Puneet Goyal
  Student of B. Tech. III Year (Software Engineering)
  Delhi Technological University, 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,
  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.
 



 --
 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.




 --
 ---
 Puneet Goyal
 Student of B. Tech. III Year (Software Engineering)
 Delhi Technological University, 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




 --
 **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.




 --
 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.




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

-- 
You received this message because you are subscribed to the Google

Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
@aditya i think the input should start with  and also end with 

On Sun, Aug 14, 2011 at 6:38 PM, aditya kumar
aditya.kumar130...@gmail.comwrote:

 the input should start with \ and end with \ . in between you can take any
 string .


 On Sun, Aug 14, 2011 at 6:35 PM, Poised~ dip10c...@gmail.com wrote:

 small correction in my above explanation

 the %[^\] will accept the input till it doesn't encounter a 
 Missed the ^ (XOR) operation completely.

  --
 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/-/Tn6jNNCGeWoJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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,
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.



Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
@arun : first  is the requiremnet of the given scanf format..whenever next
 is encountered it stops accepting any character due to [^\]

On Mon, Aug 15, 2011 at 9:16 AM, Arun Vishwanathan
aaron.nar...@gmail.comwrote:

 so according to the discussions above input should start with  and end
 with  but also there is a thing that input is accepted until  is
 encountered.Is not this contradicting?


 On Sun, Aug 14, 2011 at 3:13 PM, shady sinv...@gmail.com wrote:

 no, input should start and end with a 

 On Sun, Aug 14, 2011 at 6:38 PM, aditya kumar 
 aditya.kumar130...@gmail.com wrote:

 the input should start with \ and end with \ . in between you can take
 any string .


 On Sun, Aug 14, 2011 at 6:35 PM, Poised~ dip10c...@gmail.com wrote:

 small correction in my above explanation

 the %[^\] will accept the input till it doesn't encounter a 
 Missed the ^ (XOR) operation completely.

  --
 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/-/Tn6jNNCGeWoJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.




 --
  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,
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.



[algogeeks] n*n array

2011-08-13 Thread Kamakshii Aggarwal
is printing a n*n array,spirally is same as printing it helically??
or is there any difference between the two??
-- 
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.



[algogeeks] os

2011-08-13 Thread Kamakshii Aggarwal
How do you make sure to unlock a mutex which was locked in a thread that
dies/terminates?
-- 
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.



Re: [algogeeks]

2011-08-13 Thread Kamakshii Aggarwal
yes

On Sat, Aug 13, 2011 at 8:30 PM, Puneet Goyal puneetgoya...@gmail.comwrote:

 1 or 2 stairs?


 On Sat, Aug 13, 2011 at 8:24 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:


 Given n stairs, how many number of ways can you climb if u use either 1 or
 2 at a time?
 --
 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.




 --
 ---
 Puneet Goyal
 Student of B. Tech. III Year (Software Engineering)
 Delhi Technological University, 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,
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.



Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Kamakshii Aggarwal
maintain an array indexed on alphabets 'a' to  'z'.
now count the occurence of each character taking *last character* of each
string
{asdsb,csasaa, bc, bc}
in this case
arr[a]=1;
arr[b]=1;
arr[c]=2;

now start with each sting let first character be first and last character be
last
while (strings)
{
if(arr[first ]==0)
return false;

if(arr[first]==1)
{
if(first==last)
return false;
}

else{
arr[first--];
}
}/*end while
if at the end all elements of arr =0 then return true
 else
return false;








On Sat, Aug 13, 2011 at 9:44 PM, Yasir yasir@gmail.com wrote:

 An array of strings is given and you have to find out whether a circular
 chain with all character can be formed or not?
 Circular chain is formed in way that:   if last char of a string is equal
 to first char of another string then it can be joined.:
 like ab  bxc  ===   axbbxc  (Notice that it got joined at
 b)

 example
  {asdsb,csasaa, bc}
 Answer:   TRUE

  {asdsb,csasaa, bc, bc}
 Answer: FALSE


  --
 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/-/WGN5GLyIP_QJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.



Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
yes nth term of fibonacci series.
.t(n)=t(n-1)+t(n-2);
where
t(1)=1;
t(2)=2;


On Sat, Aug 13, 2011 at 10:11 PM, aseem garg ase.as...@gmail.com wrote:

 The soln is nth term of fibonacci sequence...isnt it?

 Aseem



 On Sat, Aug 13, 2011 at 9:27 PM, Akash Mukherjee akash...@gmail.comwrote:

 dp problem, refer to dp from AFI


 On Sat, Aug 13, 2011 at 9:01 PM, Decipher ankurseth...@gmail.com wrote:

 There is a river and there are n number of steps between two banks of the
 river to cross the river.

 A frog wants to cross the river with the condition that he can jump max
 one step. Find the number of ways he can cross the river?


 For e.g. if there are 3 steps in between, frog can go from paths: _123_,
 _2_, _13_ so there are 3 different ways frog can cross the river (in the
 example _ is two ends of the river)


 Can this question be done using Dynamic Programming ? If yes, please tell
 how .

 --
 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/-/4HJq5yRGXboJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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,
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.



Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Kamakshii Aggarwal
see the following example:
*a*kdhd*a* ,*b*hdgd*c*, *c*hdjd*b*


On Sat, Aug 13, 2011 at 10:20 PM, Yasir yasir@gmail.com wrote:

 why following?

 if(first==last)
 return false;


 example:
 axxa,  ayyb, bzza  ===  ayybbzzaaxxa

 --
 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/-/iONquZUgbPkJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.



Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Kamakshii Aggarwal
i got error,my sol will not work for all cases

On Sat, Aug 13, 2011 at 10:22 PM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 see the following example:
 *a*kdhd*a* ,*b*hdgd*c*, *c*hdjd*b*


 On Sat, Aug 13, 2011 at 10:20 PM, Yasir yasir@gmail.com wrote:

 why following?

 if(first==last)
 return false;


 example:
 axxa,  ayyb, bzza  ===  ayybbzzaaxxa

 --
 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/-/iONquZUgbPkJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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




-- 
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.



Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
coz i have tried a similar question like dis...also u can check it also...

On Sat, Aug 13, 2011 at 10:47 PM, Decipher ankurseth...@gmail.com wrote:

 How did you know that ?

 --
 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/-/GMle2k9i73wJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.



Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
i am sorry.i misinterpret the question...i dint c that the steps are between
  banks..

On Sun, Aug 14, 2011 at 12:26 AM, ankit tyagi ankittya...@gmail.com wrote:

 seems fine..


 On Sun, Aug 14, 2011 at 12:13 AM, Mohit Goel mohitgoel291...@gmail.comwrote:

 there are 5 possibilities ..5th one is_12_..other as specified by
 ankit...


 t(1) =2  (it can directly jump to anathor bank)
 t(2) =3 ( _2_,_1_,_12_)

 t(3) =5...
 thats how fibonnaci goes on plz correct if wrong...


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



Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
if steps are between banks then try dis.
if n=3 steps
then find t(n+2)
and use the fibonacci formula t(n)=t(n-1)+t(n-2)
t(1)=1;
t(2)=2;
now this will work ...

On Sun, Aug 14, 2011 at 12:34 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 i am sorry.i misinterpret the question...i dint c that the steps are
 between   banks..


 On Sun, Aug 14, 2011 at 12:26 AM, ankit tyagi ankittya...@gmail.comwrote:

 seems fine..


 On Sun, Aug 14, 2011 at 12:13 AM, Mohit Goel 
 mohitgoel291...@gmail.comwrote:

 there are 5 possibilities ..5th one is_12_..other as specified by
 ankit...


 t(1) =2  (it can directly jump to anathor bank)
 t(2) =3 ( _2_,_1_,_12_)

 t(3) =5...
 thats how fibonnaci goes on plz correct if wrong...


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




-- 
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.



Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
typo in above code..find t(n+1)

On Sun, Aug 14, 2011 at 12:37 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 if steps are between banks then try dis.
 if n=3 steps
 then find t(n+2)
 and use the fibonacci formula t(n)=t(n-1)+t(n-2)
 t(1)=1;
 t(2)=2;
 now this will work ...


 On Sun, Aug 14, 2011 at 12:34 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i am sorry.i misinterpret the question...i dint c that the steps are
 between   banks..


 On Sun, Aug 14, 2011 at 12:26 AM, ankit tyagi ankittya...@gmail.comwrote:

 seems fine..


 On Sun, Aug 14, 2011 at 12:13 AM, Mohit Goel 
 mohitgoel291...@gmail.comwrote:

 there are 5 possibilities ..5th one is_12_..other as specified by
 ankit...


 t(1) =2  (it can directly jump to anathor bank)
 t(2) =3 ( _2_,_1_,_12_)

 t(3) =5...
 thats how fibonnaci goes on plz correct if wrong...


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




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




-- 
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.



Re: [algogeeks] mcq

2011-08-09 Thread Kamakshii Aggarwal
please explain

On Tue, Aug 9, 2011 at 9:07 AM, Dipankar Patro dip10c...@gmail.com wrote:

 ans : n + 2nk - k^2 - k



 On 9 August 2011 08:43, Raman raman.u...@gmail.com wrote:

 Yes, the answer is n + 2nk - k^2 -k

 --
 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/-/-gfsoB87QO0J.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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

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



Re: [algogeeks] Re: amazon question

2011-08-08 Thread Kamakshii Aggarwal
then please elaborate?

On Mon, Aug 8, 2011 at 12:34 PM, Pradex pradam.prad...@gmail.com wrote:

 get it..!! :) :)

 On Aug 7, 10:49 pm, Shachindra A C sachindr...@gmail.com wrote:
  8 one's and 8 two's. The order in which they get printed might vary.
 
  On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal
  kamakshi...@gmail.comwrote:
 
 
 
 
 
 
 
 
 
   what will be the o/p of the following program:
 
   main()
   {
   int ret;
   ret=fork();
   ret=fork();
   ret=fork();
   ret=fork();
 
   if(!ret)
   printf(one);
   else
   printf(two);
   }
 
   --
   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.
 
  --
  Regards,
  Shachindra A 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,
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.



[algogeeks] help--code

2011-08-08 Thread Kamakshii Aggarwal
which code executes faster?
 code1:- for(i=0;in;i++)
  for(j=0;jn;j++)
  large_array[i][j]=0;

 code2:- for(j=0;jn;j++)
  for(i=0;in;i++)
   large_array[i][j]=0;




-- 
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.



[algogeeks] o/p

2011-08-08 Thread Kamakshii Aggarwal
#include stdio.h

#define max(a,b)(ab)?a:b
int main()
{
 int m,n;
 m=3+max(2,3);
 n=2*max(3,2);
 printf(%d,%d,m,n);

getchar();
return 0;
}

y the o/p is 2,3,,please explain

-- 
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.



Re: [algogeeks] help--code

2011-08-08 Thread Kamakshii Aggarwal
got it..thanks :)

On Mon, Aug 8, 2011 at 3:27 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:

 Sorry, I was thinking something else.

 Code 1 should be faster since arrays are stored in row-major fashion,
 the entire row will fit in cache, and accessing sequentially in the
 row would be faster because of higher cache hits than Code 2.

 On Mon, Aug 8, 2011 at 3:25 PM, Gaurav Menghani
 gaurav.mengh...@gmail.com wrote:
  If the dimensions are same, both will execute equally fast.
 
  On Mon, Aug 8, 2011 at 3:21 PM, Kamakshii Aggarwal
  kamakshi...@gmail.com wrote:
 
  which code executes faster?
   code1:- for(i=0;in;i++)
for(j=0;jn;j++)
large_array[i][j]=0;
   code2:- for(j=0;jn;j++)
for(i=0;in;i++)
 large_array[i][j]=0;
 
 
 
  --
  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.
 
 
 
 
  --
  Gaurav Menghani
 



 --
 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,
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.



Re: [algogeeks] o/p

2011-08-08 Thread Kamakshii Aggarwal
thanks..got it...

On Mon, Aug 8, 2011 at 3:45 PM, jagrati verma
jagrativermamn...@gmail.comwrote:

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

 use parenthese thn it will giv the correct o/p

 On Mon, Aug 8, 2011 at 3:27 PM, Kamakshii Aggarwal
 kamakshi...@gmail.com wrote:
  #include stdio.h
 
  #define max(a,b)(ab)?a:b
  int main()
  {
   int m,n;
   m=3+max(2,3);
   n=2*max(3,2);
   printf(%d,%d,m,n);
  getchar();
  return 0;
  }
  y the o/p is 2,3,,please explain
  --
  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.
 

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



[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
Which is not an advantage of using subroutines?
(a) Easier maintenance
(b) Runtime reduces
(c) Storage space reduces
(d) Modularity



one of the answer is b.
what about c?
does subroutine reduce space?










-- 
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.



[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
A 1D - array A whose size is N is given and is divided into P partitions and
an element x is to be searched in the
array. Each partition is given to one processor. The elements are searched
with in the partition using a binary search.
What is the time complexity of the algorithm?
(a) O (N/P)
(b) O (P)
(c) O ( log (N/P))
(d) O ( log (N/P)) + O (P log P)

-- 
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.



Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
@aditya:u r talking about the case of dynamic loading.
i got the answer it will reduce the size,suppose if u r not writing
subroutine,then if the main should include that code again and again where
it is to be used,but in case of subroutine u need to write it just once

On Mon, Aug 8, 2011 at 4:36 PM, Aditya Virmani virmanisadi...@gmail.comwrote:

 yes it may reduce the space req...suppose a subroutine is never called by a
 execution, thn the memory req by tht subroutine wnt be allocated.


 On Mon, Aug 8, 2011 at 4:26 PM, vijay goswami vjrockks...@gmail.comwrote:

 it reduces the size of the source file


 On Mon, Aug 8, 2011 at 4:18 PM, sourabh jakhar 
 sourabhjak...@gmail.comwrote:

 b



 On Mon, Aug 8, 2011 at 4:18 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:


 Which is not an advantage of using subroutines?
 (a) Easier maintenance
 (b) Runtime reduces
 (c) Storage space reduces
 (d) Modularity



 one of the answer is b.
 what about c?
 does subroutine reduce space?










 --
 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.




 --
 SOURABH JAKHAR,(CSE)(Final year)
 ROOM NO 167 ,
 TILAK,HOSTEL
 'MNNIT ALLAHABAD

  The Law of Win says, Let's not do it your way or my way; let's do it
 the best way.

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



Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
how??array is not sorted...so first we have to sort na??

On Mon, Aug 8, 2011 at 5:04 PM, Dipankar Patro dip10c...@gmail.com wrote:

 C


 On 8 August 2011 17:03, ankit sambyal ankitsamb...@gmail.com wrote:

 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.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

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



[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
global variable conflicts due to multiple file occurence
is resolved during
a. compile-time
b. run-time
c. link-time
d. load-time

-- 
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.



[algogeeks] os

2011-08-08 Thread Kamakshii Aggarwal
Fastest IPC mechanism is

   1.   ?shared memory
   2.   ?pipes
   3.   ?named pipes
   4.   ?Semaphores

-- 
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.



Re: [algogeeks] os

2011-08-08 Thread Kamakshii Aggarwal
According to me,it should be shared memory..but i have taken this from an
online test which say that the answer is named pipeswhat are named
pipes?
On Mon, Aug 8, 2011 at 5:50 PM, dilip makwana dilipmakwa...@gmail.comwrote:

 Yes NAMED PIPES ... is correct


 On 8 August 2011 17:43, Himanshu Srivastava himanshusri...@gmail.comwrote:

 named pipes!!!

 On Mon, Aug 8, 2011 at 5:36 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:


 Fastest IPC mechanism is

1.   ?shared memory
2.   ?pipes
3.   ?named pipes
4.   ?Semaphores

 --
 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.


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




 --
 *Dilip Makwana*
 VJTI
 BTech Computers Engineering
 2009-2013

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



Re: [algogeeks] Re: amazon question

2011-08-08 Thread Kamakshii Aggarwal
ok ..thanks sagar..:)

On Mon, Aug 8, 2011 at 6:42 PM, sagar pareek sagarpar...@gmail.com wrote:

 lets label your forks :-
 main()
 {
 int ret;
 ret=fork();  -- 1
 ret=fork();  -- 2
 ret=fork(); --- 3
 ret=fork(); --- 4

 if(!ret)
 printf(one);
 else
 printf(two);
 }

 Now
 original main() is suppose named  M
 then after encountering fork() 1st then


  M

 / \

 /\

 /\

 M C1


 now after fork() -2


 M

 / \

 /\

 /\

 M C1

 /   \ /\

 M  C2C1 C3


 after fork()- 4

 it will  be
  M
 C1C2 C3.. C15
now   we have half of them include main() have ret!=0   and
 rest of them ret=0

 i hope its clear now...


 On Mon, Aug 8, 2011 at 12:53 PM, Shachindra A C sachindr...@gmail.comwrote:

 At the point of execution of the 4th fork(), there are 8 processes i.e,
 the 4th fork will get executed 8 times. The final value of ret will depend
 on this fork. the fork will return 0 in the 8 child processes created and
 returns pid of the child in the parent processes.


 On Mon, Aug 8, 2011 at 12:49 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 then please elaborate?


 On Mon, Aug 8, 2011 at 12:34 PM, Pradex pradam.prad...@gmail.comwrote:

 get it..!! :) :)

 On Aug 7, 10:49 pm, Shachindra A C sachindr...@gmail.com wrote:
  8 one's and 8 two's. The order in which they get printed might vary.
 
  On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal
  kamakshi...@gmail.comwrote:
 
 
 
 
 
 
 
 
 
   what will be the o/p of the following program:
 
   main()
   {
   int ret;
   ret=fork();
   ret=fork();
   ret=fork();
   ret=fork();
 
   if(!ret)
   printf(one);
   else
   printf(two);
   }
 
   --
   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.
 
  --
  Regards,
  Shachindra A 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,
 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.




 --
 Regards,
 Shachindra A 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.




-- 
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.



[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
A k-diagonal matrix is a n *n square matrix in which the elements on the
principal diagonal and k diagonals above the
principal diagonal and k diagonals below the principal diagonal only have
none\ zero elements. Other elements are zero’s.
 In order to save the space, the non zero elements are stored in a one
dimensional array.
The no of locations in this array are:
(a) n*(n-k-1)/2
(b) n*(n-1) – (n-k)(n-k-2)
(c) n*(n-1) – (n-k)(n-k-2)
(d) n*n – (n-k-1)

-- 
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.



Re: [algogeeks] Re: amazon question

2011-08-08 Thread Kamakshii Aggarwal
@sagar: i think order has to be fixed...in amazon they gave us four
options
but i dnt remember them now...

On Mon, Aug 8, 2011 at 10:05 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 @sagar thanx :)


 On Mon, Aug 8, 2011 at 9:01 PM, sagar pareek sagarpar...@gmail.comwrote:

 @aditi
 nope... it will run in parallel...so order is not fix


 On Mon, Aug 8, 2011 at 8:48 PM, Pradeep Mishra 
 pradam.prad...@gmail.comwrote:

 no it'll vary as the PID will vary from parent to child.



 On Mon, Aug 8, 2011 at 8:05 AM, aditi garg aditi.garg.6...@gmail.comwrote:

 i was asking about the order in printfso it wud be like 8times  one
 and then 8 times two?


 On Mon, Aug 8, 2011 at 8:23 PM, sagar pareek sagarpar...@gmail.comwrote:



  M

 / \

 /\

 /\

 / \

 / \

 /  \

 /  \
M
   C1
 /   \
   /\
/
 \   /  \
  /
 \  /\
 /
 \  / \
   M
 C2   C1 C3
  /  \
 /  \   / \   /
  \
 /\
 / \/  \
 /\
   M   C4
 C2 C5   C1C6  C3 C7
 /\ /\/
 \/ \/  \ /   \   /
 \ /   \
  M C8  C4  C9   C2  C10  C5 C11 C1
 C12  C6  C13  C4  C14  C7  C15


 M C4 C2 C5 C1 C6 C3 C7  (one level upper will have ret0  and rest will
 have ret =0

  Just think ur self how any process and its child have pid==0 ???


 I hope its clear now...


 On Mon, Aug 8, 2011 at 8:05 PM, aditi garg 
 aditi.garg.6...@gmail.comwrote:

 @ sagar: wat wud be the order? as in all 8 frst wud return non zero
 and rest 0 or wat?


 On Mon, Aug 8, 2011 at 6:50 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 ok ..thanks sagar..:)


 On Mon, Aug 8, 2011 at 6:42 PM, sagar pareek 
 sagarpar...@gmail.comwrote:

 lets label your forks :-
 main()
 {
 int ret;
 ret=fork();  -- 1
 ret=fork();  -- 2
 ret=fork(); --- 3
 ret=fork(); --- 4

 if(!ret)
 printf(one);
 else
 printf(two);
 }

 Now
 original main() is suppose named  M
 then after encountering fork() 1st then


  M

 / \

 /\

 /\

 M C1


 now after fork() -2


 M

 / \

 /\

 /\

 M C1

 /   \ /\

 M  C2C1 C3


 after fork()- 4

 it will  be

 M   C1C2 C3.. C15
now   we have half of them include main() have
 ret!=0   and rest of them ret=0

 i hope its clear now...


 On Mon, Aug 8, 2011 at 12:53 PM, Shachindra A C 
 sachindr...@gmail.com wrote:

 At the point of execution of the 4th fork(), there are 8 processes
 i.e, the 4th fork will get executed 8 times. The final value of ret 
 will
 depend on this fork. the fork will return 0 in the 8 child processes 
 created
 and returns pid of the child in the parent processes.


 On Mon, Aug 8, 2011 at 12:49 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 then please elaborate?


 On Mon, Aug 8, 2011 at 12:34 PM, Pradex pradam.prad...@gmail.com
  wrote:

 get it..!! :) :)

 On Aug 7, 10:49 pm, Shachindra A C sachindr...@gmail.com
 wrote:
  8 one's and 8 two's. The order in which they get printed might
 vary.
 
  On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal
  kamakshi...@gmail.comwrote:
 
 
 
 
 
 
 
 
 
   what will be the o/p of the following program:
 
   main()
   {
   int ret;
   ret=fork();
   ret=fork();
   ret=fork();
   ret=fork();
 
   if(!ret)
   printf(one);
   else
   printf(two);
   }
 
   --
   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

Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
i copied it from net..i dint understand the question. ignore the
options..are u able to solve it?

On Mon, Aug 8, 2011 at 10:16 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 b) and c) options are same??

 On Mon, Aug 8, 2011 at 8:53 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.comwrote:

 A k-diagonal matrix is a n *n square matrix in which the elements on the
 principal diagonal and k diagonals above the
 principal diagonal and k diagonals below the principal diagonal only have
 none\ zero elements. Other elements are zero’s.
  In order to save the space, the non zero elements are stored in a one
 dimensional array.
 The no of locations in this array are:
 (a) n*(n-k-1)/2
 (b) n*(n-1) – (n-k)(n-k-2)
 (c) n*(n-1) – (n-k)(n-k-2)
 (d) n*n – (n-k-1)

 --
 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.




 --
 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,
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.



Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
i dint understand this question.i just cant understand what is the
meaning of k-diaganol..

On Mon, Aug 8, 2011 at 11:01 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 well i ws trying to take some example and  thn verify...if i take 5x5
 matrix and k=2...thn 6 elements will be empty right?or does dis ques mean
 smthing else?


 On Mon, Aug 8, 2011 at 10:58 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 i copied it from net..i dint understand the question. ignore the
 options..are u able to solve it?


 On Mon, Aug 8, 2011 at 10:16 PM, aditi garg aditi.garg.6...@gmail.comwrote:

 b) and c) options are same??

 On Mon, Aug 8, 2011 at 8:53 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 A k-diagonal matrix is a n *n square matrix in which the elements on the
 principal diagonal and k diagonals above the
 principal diagonal and k diagonals below the principal diagonal only
 have none\ zero elements. Other elements are zero’s.
  In order to save the space, the non zero elements are stored in a one
 dimensional array.
 The no of locations in this array are:
 (a) n*(n-k-1)/2
 (b) n*(n-1) – (n-k)(n-k-2)
 (c) n*(n-1) – (n-k)(n-k-2)
 (d) n*n – (n-k-1)

 --
 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.




 --
 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,
 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.




 --
 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,
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.



Re: [algogeeks] amazon question

2011-08-08 Thread Kamakshii Aggarwal
3?

On Mon, Aug 8, 2011 at 11:26 PM, siddharam suresh
siddharam@gmail.comwrote:

 is it 3 ?
 Thank you,
 Siddharam



 On Mon, Aug 8, 2011 at 11:24 PM, rajul jain rajuljain...@gmail.comwrote:

 How many Children process following program produce
 *
 void main() {

 int p1= fork();

 if (p1 == 0) {

  int p2 = fork();

  if (p2 != 0) {

   fork();

  }

 }

 }


 *
 On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 what will be the o/p of the following program:

 main()
 {
 int ret;
 ret=fork();
 ret=fork();
 ret=fork();
 ret=fork();

 if(!ret)
 printf(one);
 else
 printf(two);
 }








 --
 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.


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



[algogeeks] amazon

2011-08-07 Thread Kamakshii Aggarwal
1.what is the best sorting method for almost sorted array?
a.quicksort
c.hapsort
c.shell sort
d.bubble

-- 
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.



[algogeeks] o/p

2011-08-07 Thread Kamakshii Aggarwal
what is the problem with the following code

void fun(int **p)
{
  static int q = 10;

  *p = q;
}

int main()
{
  int r = 20;
  int *p = r;
  fun(*p);

  printf(%d, *p);
  getchar();
  return 0;
}


-- 
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.



[algogeeks] Re: o/p

2011-08-07 Thread Kamakshii Aggarwal
i got my mistake...sorry guys

On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 what is the problem with the following code

 void fun(int **p)
 {
   static int q = 10;

   *p = q;
 }

 int main()
 {
   int r = 20;
   int *p = r;
   fun(*p);

   printf(%d, *p);
   getchar();
   return 0;
 }


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




-- 
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.



Re: [algogeeks] Re: o/p

2011-08-07 Thread Kamakshii Aggarwal
fun(p) hona tha..
but i wrote(*p)


On Mon, Aug 8, 2011 at 12:17 AM, aseem garg ase.as...@gmail.com wrote:

 What was the mistake?
 Aseem



 On Mon, Aug 8, 2011 at 12:15 AM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 i got my mistake...sorry guys


 On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 what is the problem with the following code

 void fun(int **p)
 {
   static int q = 10;

   *p = q;
 }

 int main()
  {
   int r = 20;
   int *p = r;
   fun(*p);

   printf(%d, *p);
   getchar();
   return 0;
 }


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




 --
 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.


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



[algogeeks] output help

2011-08-07 Thread Kamakshii Aggarwal
#includestdio.h
int main()
{
   typedef static int *i;
  static int j;
  i a = j;
  printf(%d, *a);
  getchar();
  return 0;
}

what is the error in the code?
-- 
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.



Re: [algogeeks] output help

2011-08-07 Thread Kamakshii Aggarwal
got it...thanks

On Mon, Aug 8, 2011 at 12:39 AM, aseem garg ase.as...@gmail.com wrote:

 typedef doesn't declare an instance of a variable, it declares a type (type
 alias actually),

 static is a qualifier you apply to an instance, not a type, so you can use
 static when you use the type, but not when you define the type.
 Aseem



 On Mon, Aug 8, 2011 at 12:29 AM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 #includestdio.h
 int main()
 {
typedef static int *i;
   static int j;
   i a = j;
   printf(%d, *a);
   getchar();
   return 0;
 }

 what is the error in the code?
 --
 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.


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



Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Kamakshii Aggarwal
i think the answer will be 1/5+  4/5*1/2=3/5

coz the question is saying what is the probability of getting head* sixth
time*(when 5 heads were already there)..


it is not saying what is the probability of getting heads* 6 times*..(in
this case answer will be 17/180)

On Mon, Aug 8, 2011 at 9:54 AM, D.B. sylve...@gmail.com wrote:

 1/5+1/2^6

 On Aug 7, 8:34 pm, Algo Lover algolear...@gmail.com wrote:
  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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



[algogeeks] amazon question

2011-08-07 Thread Kamakshii Aggarwal
what will be the o/p of the following program:

main()
{
int ret;
ret=fork();
ret=fork();
ret=fork();
ret=fork();

if(!ret)
printf(one);
else
printf(two);
}








-- 
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.



[algogeeks] pls help

2011-08-05 Thread Kamakshii Aggarwal
given a set of letters and a length N, produce all possible output.(Not
permutation). For example, give the letter (p,o) and length of 3, produce
the following output(in any order you want, not just my example order)

ppp ppo poo pop opp opo oop ooo

another example would be given (a,b) and length 2

answer: ab aa bb ba

-- 
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.



Re: [algogeeks] pls help

2011-08-05 Thread Kamakshii Aggarwal
@gaurav:i could not understand ur sol.can u explain it again..

On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:

 On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
 kamakshi...@gmail.com wrote:
  given a set of letters and a length N, produce all possible output.(Not
  permutation). For example, give the letter (p,o) and length of 3, produce
  the following output(in any order you want, not just my example order)
 
  ppp ppo poo pop opp opo oop ooo
 
  another example would be given (a,b) and length 2
 
  answer: ab aa bb ba
 
  --
  Regards,
  Kamakshi
  kamakshi...@gmail.com

 This can be done easily by backtracking

 void backtrack(string s, int l)
 {
   if(l == maxlen) { coutsendl; return; }

   s.push_back('-');
   for(int i=0;ialphabet.size();i++)
   {
 s[l]=alphabet[i];
 backtrack(s,l+1);
   }
 }

 --
 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,
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.



Re: [algogeeks] pls help

2011-08-05 Thread Kamakshii Aggarwal
@gaurav:can u please explain what is the purpose of this line..
s.push_back('-');

On Fri, Aug 5, 2011 at 1:10 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote:

 Or one could just simulate a counting from 0 to (numchars^N)-1 in base
 numchars.
 ...
 code:
 void printit(int N,char chars[],int index[]){
 for(int i=0;iN;i++){
 printf(%c,chars[index[i]]);
 }
 printf(\n);
 }
 void generate(int numchars,char chars[],int N){
 int index[100]={0};
 int allmax=0;
 int maxdigit=numchars-1;
 printit(N,chars,index);
 while(!allmax){
// add one;
index[0]++;
allmax=0;
for(int i=0;iN;i++){
 if(index[i]=numchars){
  index[i]=0; index[i+1]++;
 }
 if(i==0index[i]==maxdigit){
allmax=1;
 }

allmax = (index[i]==maxdigit)?allmax1:0;

}
printit(N,chars,index);
 }
 }
 int  main(){
  char chars [] ={'p','o'};
  int numchars =sizeof(chars)/sizeof(char);
  int N=3;
  generate(numchars,chars,N);
 }

 On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani 
 gaurav.mengh...@gmail.com wrote:

 An Implementation:

 #includeiostream
 #includestring
 using namespace std;

 string alphabet;
 int maxlen;
 void backtrack(string s,int l)
 {
  if(l==maxlen) { coutsendl; return; }
  s.push_back('-');
  for(int i=0;ialphabet.size();i++)
{ s[l]=alphabet[i]; backtrack(s,l+1); }
 }

 int main()
 {
  maxlen=3;
  alphabet=op;
  backtrack(,0);
  return 0;
 }


 On Fri, Aug 5, 2011 at 12:42 PM, Kamakshii Aggarwal
 kamakshi...@gmail.com wrote:
  @gaurav:i could not understand ur sol.can u explain it again..
 
  On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani 
 gaurav.mengh...@gmail.com
  wrote:
 
  On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
  kamakshi...@gmail.com wrote:
   given a set of letters and a length N, produce all possible
 output.(Not
   permutation). For example, give the letter (p,o) and length of 3,
   produce
   the following output(in any order you want, not just my example
 order)
  
   ppp ppo poo pop opp opo oop ooo
  
   another example would be given (a,b) and length 2
  
   answer: ab aa bb ba
  
   --
   Regards,
   Kamakshi
   kamakshi...@gmail.com
 
  This can be done easily by backtracking
 
  void backtrack(string s, int l)
  {
if(l == maxlen) { coutsendl; return; }
 
s.push_back('-');
for(int i=0;ialphabet.size();i++)
{
  s[l]=alphabet[i];
  backtrack(s,l+1);
}
  }
 
  --
  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,
  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.
 



 --
 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.


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



[algogeeks] hash table

2011-08-05 Thread Kamakshii Aggarwal
can we implement random() function on a hash table in O(1) .

-- 
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.



Re: [algogeeks] Re: Printf

2011-08-05 Thread Kamakshii Aggarwal
logical address

On Fri, Aug 5, 2011 at 2:20 PM, Amol Sharma amolsharm...@gmail.com wrote:

 physical address i think
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Fri, Aug 5, 2011 at 1:01 AM, amit karmakar 
 amit.codenam...@gmail.comwrote:

 Some discussions here,
 http://ubuntuforums.org/showthread.php?t=316081
 and some here,
 http://groups.google.com/group/comp.lang.c/msg/21250e8fe083e4f8

 On Aug 5, 12:51 pm, Anurag Narain anuragnar...@gmail.com wrote:
  i think logical address...physical address is never accessible to user
  program
 
  @amit-can u explain why??

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



[algogeeks] probablity

2011-08-05 Thread Kamakshii Aggarwal
 I was given 3 packets, with 2 pens each.

1st Packet has 2 blue pens.

2nd Packet has 1 blue pen,1 black pen.

3rd Packet has 2 black pens.



I took any one packet and pulled out one pen. It turned out to be a blue
one.

What is the probability that the next pen from the same packet will

also be a blue one?

-- 
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.



Re: [algogeeks] difference between the two

2011-08-05 Thread Kamakshii Aggarwal
in case of 64 bit,
size of second structure will also be 16 not 8

On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV
usrivastav...@gmail.comwrote:

 I think voth are just same..


 On Fri, Aug 5, 2011 at 10:57 AM, priya v pria@gmail.com wrote:

 in case of 64 bit machine y doesn't padding happen in the 2nd structure?


 On Fri, Aug 5, 2011 at 11:21 PM, hary rathor harry.rat...@gmail.comwrote:

 no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
 but   in 64 machine that enforce to be size of 8 . where padding will
 take int your given first structure

 so for 32 bit- size will 8 8 for both structure
 for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in
 one structure

 hence 2nd structure is good for use

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




 --
 *UTKARSH SRIVASTAV
 CSE-3
 B-Tech 2nd 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,
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.



[algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
Can anyone please tell what is the procedure for amazon campus recruitment?

-- 
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.



[algogeeks] merging of two sorted arrays

2011-08-04 Thread Kamakshii Aggarwal
how can  two sorted arrays be merged inplace?
-- 
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.



Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
@arvind:in technical online test,do we have to code the program?

On Thu, Aug 4, 2011 at 10:45 PM, arvind kumar arvindk...@gmail.com wrote:

 First round is online test


 On Thu, Aug 4, 2011 at 10:43 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.comwrote:

 Is there an online test too?


 On Thu, Aug 4, 2011 at 10:25 PM, arvind kumar arvindk...@gmail.comwrote:

 Written test(tech+apti),Technical interview n HR interview


 On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 Can anyone please tell what is the procedure for amazon campus
 recruitment?

 --
 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.


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




 --
 Nikhil Gupta
 Senior Co-ordinator, Publicity
 CSI, NSIT Students' Branch
 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.


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



Re: [algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Kamakshii Aggarwal
@dave:how can we find value of 'k' in (log n)

On Thu, Aug 4, 2011 at 5:41 PM, kartik sachan kartik.sac...@gmail.comwrote:

 @amit it's given that array is increasing then decreasing..so where
 there is change from incre to drece that value of i in loop will be k

 in this we can find out k if not given

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



Re: [algogeeks] Puzzle

2011-08-04 Thread Kamakshii Aggarwal
@sagar:please explain..

On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek sagarpar...@gmail.com wrote:

 87.5 %


 On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.comwrote:

 There are 3 magical wells. Any input quantity of water we provide the 1st
 well is returned double (of this double, half is kept inside the well, and
 the other half is used as input to the 2nd well).
 The 2nd well also returns double the quantity of its input (of which half
 is kept inside the well, and the other half is used as input to the 3rd
 well). Same goes with the 3rd, but its half output is the remainder (other
 half being kept inside the well). Now what input should we provide in the
 1st well, so that the remainder at the end comes out to be zero?

 (Asked in classroom coaching of T.I.M.E.)
 --
 Nikhil Gupta
 Senior Co-ordinator, Publicity
 CSI, NSIT Students' Branch
 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.




-- 
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.



Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
@sagar:can u please post the questions that were asked?

On Fri, Aug 5, 2011 at 12:20 AM, sagar pareek sagarpar...@gmail.com wrote:

 same procedure told by arvind were also followed here too


 On Thu, Aug 4, 2011 at 11:02 PM, arvind kumar arvindk...@gmail.comwrote:

 Yup..they asked us to code 2.


 On Thu, Aug 4, 2011 at 11:01 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 @arvind:in technical online test,do we have to code the program?


 On Thu, Aug 4, 2011 at 10:45 PM, arvind kumar arvindk...@gmail.comwrote:

 First round is online test


 On Thu, Aug 4, 2011 at 10:43 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.com wrote:

 Is there an online test too?


 On Thu, Aug 4, 2011 at 10:25 PM, arvind kumar arvindk...@gmail.comwrote:

 Written test(tech+apti),Technical interview n HR interview


 On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 Can anyone please tell what is the procedure for amazon campus
 recruitment?

 --
 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.


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




 --
 Nikhil Gupta
 Senior Co-ordinator, Publicity
 CSI, NSIT Students' Branch
 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.


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


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



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Kamakshii Aggarwal
i have a doubt regarding 3rd questions..acc to me both are valid...what is
the correct answer?

On Fri, Aug 5, 2011 at 12:27 AM, newOne trader.lu...@gmail.com wrote:

 2 issues:
 1. no error handling for malloc failure( can be ignored)
 2. no memset for pq.

 strcat will not work properly: as by definition it will search for the
 null char in first string, removes it then copies the second string
 including the null char of second string.

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



Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
I am from Nsit..adobe and MS have visited till now..

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

 sorry kamakshi u are 5th one who is asking the same question...
 here in my college approx 10 companies have come from last 15-17 days
 amazon was first of them

 so i m so sorry.
 i remembered only a few which will not be enough 4 u

 like they gave some questions on recursion of trees
 i remembered only answers like one of them  was answer :- it will delete
 tree leaves from right to left...

 one was of change of order of with  initial k bits
 some were puzzles easy one

 yes i only remembered 2 question of coding
 they were
 1. find longest increasing sub sequence
 2. print matrix in spiral form...

 now u tell me ur college and how and which companies visited urs ?


 On Fri, Aug 5, 2011 at 12:35 AM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 @sagar:can u please post the questions that were asked?


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

 same procedure told by arvind were also followed here too


 On Thu, Aug 4, 2011 at 11:02 PM, arvind kumar arvindk...@gmail.comwrote:

 Yup..they asked us to code 2.


 On Thu, Aug 4, 2011 at 11:01 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 @arvind:in technical online test,do we have to code the program?


 On Thu, Aug 4, 2011 at 10:45 PM, arvind kumar arvindk...@gmail.comwrote:

 First round is online test


 On Thu, Aug 4, 2011 at 10:43 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.com wrote:

 Is there an online test too?


 On Thu, Aug 4, 2011 at 10:25 PM, arvind kumar 
 arvindk...@gmail.comwrote:

 Written test(tech+apti),Technical interview n HR interview


 On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 Can anyone please tell what is the procedure for amazon campus
 recruitment?

 --
 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.


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




 --
 Nikhil Gupta
 Senior Co-ordinator, Publicity
 CSI, NSIT Students' Branch
 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.


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


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

[algogeeks] aptitude

2011-08-03 Thread Kamakshii Aggarwal
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.



Re: [algogeeks] aptitude

2011-08-03 Thread Kamakshii Aggarwal
vaibhav can u please explain.i know the answer already..i m just not able to
solve the equations fully

On Wed, Aug 3, 2011 at 7:09 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote:

 in general, if u guys get any answer, please post a short explanation even
 if it the solution is very obvious to u...not everyone gets it when looking
 at the answer...


 On Wed, Aug 3, 2011 at 3:34 PM, vaibhavmitta...@gmail.com wrote:

 45 km/hr

 VM
 NSIT, COE, 3rd year


 On , Kamakshii Aggarwal kamakshi...@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.
 
 
 
 

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



Re: Re: [algogeeks] aptitude

2011-08-03 Thread Kamakshii Aggarwal
@abhishek:
[(100b+a)or(100a+b)]-(10b+a).
how do u know that this no cantains 1 zero??

On Wed, Aug 3, 2011 at 8:03 PM, abhishek iyer abhishekr.iye...@gmail.comwrote:

 (10b+a)-(10a+b)=[(100b+a)or(100a+b)]-(10b+a)... [uniform speed] where a,b
 are natural numbers less than 10...

 *1st case*

 9(b-a)=90b

 a=-9b...not acceptable

 *2nd case*

 9(b-a)=99a-9b

 b-a=11a-b

 b=6a...acceptable

 and only value which abides by the condition a,b are natural numbers less
 than 10 is a=1,b=6

 therefore,number is 16...avg speed is equal to 61-16=45


 On Wed, Aug 3, 2011 at 7:25 PM, vaibhavmitta...@gmail.com wrote:
 
  first milestone 16
  second milestone 61
  third milestone 106
 
  its an observation..ntn like nethn..onli thing i tht ws dat as speed is
 uniform so distance traveled per hr is constant..so two milestones with
 reverse numbers wil hv difference as 9x-9y i.e multiple of 9..also third
 milestone wil be very near to 100 to so 1 is fixed as a digit..odrs can be
 found out by hit and trial..
 
  VM
  NSIT, COE, 3rd year
 
  On , Kamakshii Aggarwal kamakshi...@gmail.com wrote:
   vaibhav can u please explain.i know the answer already..i m just not
 able to solve the equations fully
  
   On Wed, Aug 3, 2011 at 7:09 PM, Arun Vishwanathan
 aaron.nar...@gmail.com wrote:
  
   in general, if u guys get any answer, please post a short explanation
 even if it the solution is very obvious to u...not everyone gets it when
 looking at the answer...
  
  
  
  
   On Wed, Aug 3, 2011 at 3:34 PM, vaibhavmitta...@gmail.com wrote:
  
   45 km/hr
  
   VM
   NSIT, COE, 3rd year
  
  
  
  
  
   On , Kamakshii Aggarwal kamakshi...@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.
  
  
   
   
   
   
  
   --
   You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
  
  
   To unsubscribe from 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,
   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.
  
  
  
  
 
  --
  You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



 --
 Thanks  Regards
 Abhishek Iyer

 If You Obey All the Rules, You Will Miss All the Fun. 

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



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
i think dere is nothing wrong in ques 1.is there any error?

On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

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



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
i think answer for 5th should be 11/23. Am i right?


On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

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




-- 
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.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
prakash its 11/23 only

On Wed, Aug 3, 2011 at 10:45 PM, Prakash D cegprak...@gmail.com wrote:

 18/33?


 On Wed, Aug 3, 2011 at 10:42 PM, muthu raj muthura...@gmail.com wrote:

 5)
 Sample space=24C2= 276
 N(S) = 12 C 2 + 12 C 2 =132

 Probability= 132/276= 11/23


 *Muthuraj R
 IV th Year , ISE
 PESIT , Bangalore*



 On Wed, Aug 3, 2011 at 10:36 PM, Prakash D cegprak...@gmail.com wrote:

 assume there are 6 1's and 6 0's

 if two are selected together randomly%
 the possible outcomes are 00, 11, 01, 10

 00- 30 possibilities
 11 - 30 possibilities

 10 - 36 possibilities
 01 - 36 possibilities


 probability of 10  or 01 =  (36+36)/(30+30+36+36)

 =18/31

  is it one of the options?


 On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV jaid...@gmail.com wrote:

 there is no error in first question ... u thik so.. correct me if wrong
 ...


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.comwrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

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




 --
 JaiDev Yadav
 (National Yoga Champion)
 Computer Engg. Dept.
 National Institute of Technology
 Kurukshetra,Haryana

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



[algogeeks] MS

2011-08-02 Thread Kamakshii Aggarwal
Given a rectangle with known width and height, design an algorithm to fill
the rectangle using n squares(n is integer given) and make sure in the
result the wasting area is minimized. Length of square doesn't have to be
integer.
i.e, given width=3,height=2,n=5, one solution is that rectangle can be
filled with five 1x1 squares and the wasting area is 1. Another solution
could be filled with five 0.9x0.9 squares, but the wasting area is more than
first solution.

-- 
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.



Re: [algogeeks] Re: MS

2011-08-02 Thread Kamakshii Aggarwal
@sunny:yes all the squares should be of same size

On Tue, Aug 2, 2011 at 5:03 PM, Poised~ dip10c...@gmail.com wrote:

 @ narain-
 i didn't see that coming. thanks for the heads up.

 --
 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/-/oSuB8bJuqDcJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.



Re: [algogeeks] Re: MS

2011-08-02 Thread Kamakshii Aggarwal
@vaibhav:can u please elaborate?

On Tue, Aug 2, 2011 at 6:31 PM, Vaibhav Mittal vaibhavmitta...@gmail.comwrote:

 dynamic programming with binary search should do it..

 Regards
 VM
 NSIT, COE, 3rd yr


 On Tue, Aug 2, 2011 at 6:19 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.comwrote:

 @sunny:yes all the squares should be of same size


 On Tue, Aug 2, 2011 at 5:03 PM, Poised~ dip10c...@gmail.com wrote:

 @ narain-
 i didn't see that coming. thanks for the heads up.

 --
 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/-/oSuB8bJuqDcJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.


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



Re: [algogeeks] Any help on bits?

2011-07-31 Thread Kamakshii Aggarwal
@what kind of operations can be applied to 'A'?

On Sun, Jul 31, 2011 at 6:54 PM, Amol Sharma amolsharm...@gmail.com wrote:

 yupxor would do the required task eaisly !!

 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Sun, Jul 31, 2011 at 6:42 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.comwrote:

 @Surya, ^ operator mean XOR operation.


 On Sun, Jul 31, 2011 at 6:41 PM, Surya Prakash suryaprakash...@gmail.com
  wrote:

 we can just apply xor operation rightit's more easier!!

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




 --
 Nikhil Gupta
 Senior Co-ordinator, Publicity
 CSI, NSIT Students' Branch
 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.


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



Re: [algogeeks]

2011-07-30 Thread Kamakshii Aggarwal
a+1 will point to the next array(i.e it will skip the whole array)
where as (a+1)will print address of element 2.

On Sun, Jul 31, 2011 at 1:21 AM, Sanchit Manchanda sanchit...@gmail.comwrote:

 Sorry my bad. I was wrong.

 On Sun, Jul 31, 2011 at 1:15 AM, gaurav gupta grvgupta...@gmail.comwrote:

 main()
 {
 int a[5]={1,2,3,4,5};
 printf(%d%d,a+1,(a+1));
 }
 plz explain me the difference in ans.
 thanx..

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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
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.



Re: [algogeeks] Output Help.

2011-07-30 Thread Kamakshii Aggarwal
3.it is same as b=b+1;

On Sun, Jul 31, 2011 at 1:32 AM, aseem garg ase.as...@gmail.com wrote:

 int b=2;b=b++;
 b=???

 Plz explain..
 Aseem

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



Re: [algogeeks] Re: Array doubt

2011-07-30 Thread Kamakshii Aggarwal
@neeraj:deleting after printing  will adds to complexity..

On Sun, Jul 31, 2011 at 1:34 AM, Neeraj Gupta neeraj.gupta...@gmail.comwrote:

 Create a balance BST.
 Maintain counter. Whenever You hit duplicate increase the counter while
 inserting.
 O(nlogn) for creating it and O(N) space.
 Now while traverse the array.
 If you find the element, then print it acco the counter value. After
 printing delete it.
 if not found continue traversing.
 - Show quoted text -

 On Sun, Jul 31, 2011 at 1:21 AM, rahul mittal rahulmitta...@gmail.comwrote:

 @nivedita:can u do this in o(n) time , i suppose your algorithm takes
 0(nlogn) time


 On Sun, Jul 31, 2011 at 1:14 AM, nivedita arora 
 vivaciousnived...@gmail.com wrote:

 @rahul- balanced BST can be maintained.to remove worst case !
 @sukhmeet- i did not gt your method completely ..u are trying to
 maintain hashmap or double dimension array of number and count?
 @aditi- for array we will have overhead of searching if element is
 present or not ..in O(n) time while it will be O(logn) in BST.
  in array we cannot do binary search as it will not be sorted to
 improve search .


 On Jul 31, 12:31 am, rahul mittal rahulmitta...@gmail.com wrote:
  maintaining the bst of n element in worst case will take n square time
  complexity ..do we have a better solution for worst case
 
  On Sun, Jul 31, 2011 at 12:53 AM, sukhmeet singh 
 sukhmeet2...@gmail.comwrote:
 
 
 
 
 
 
 
 
 
   nivedita: wts the use to maintaining BST.. if the same purpose can be
   fulfilled by an array ..
   but this can be a good method if the range of numbers is pretty
 large.. den
   making a hash count can be difficult..
 
   On Sun, Jul 31, 2011 at 12:43 AM, nivedita arora 
   vivaciousnived...@gmail.com wrote:
 
   take a BST whose node has an element of frequency .and another array
   which will store order of elements.
   for each array element search BST if node already exists increase
 the
   freq count ..other wise  add that element in the order array we took
   and insert new node in BST.
 
   now , scan the order array find its corresponding element in BST and
   its frequency, print it that many times.
 
   let me know if there is any bttr method
   thx!
 
   On Jul 30, 11:58 pm, sukhmeet singh sukhmeet2...@gmail.com wrote:
maintain a count array of all elements..
now traverse the array again and the count array .. and build the
 new
   array
 
On Sun, Jul 31, 2011 at 12:24 AM, aditi garg 
 aditi.garg.6...@gmail.com
   wrote:
 
 Q1) Given an array with some repeating numbers. Like 12,6,5,12,6
 output: 12,12,6,6,5
 
 12 shud come before 6 since it is earlier in list. Please
 provide a
 gud algo fr dis
 
 --
 You received this message because you are subscribed to the
 Google
   Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com
 .
 To unsubscribe from 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.
 
  --
  *With Regards *
  *RAHUL MITTAL*
  *3rd YEAR*
  *CSE*
  *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.




 --
 *With Regards *
 *RAHUL MITTAL*
 *3rd YEAR*
 *CSE*
 *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.


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

Re: [algogeeks] Output Help.

2011-07-30 Thread Kamakshii Aggarwal
oh sorry,mane galat pad lia..mane sirf b++ dekha...
it is compiler dependent.value of b is changing twice b/w two serial points

On Sun, Jul 31, 2011 at 1:37 AM, aseem garg ase.as...@gmail.com wrote:

 @Kamakshi: Run karke dekh leti pehle.  :-/
 Aseem



 On Sun, Jul 31, 2011 at 1:34 AM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 3.it is same as b=b+1;

 On Sun, Jul 31, 2011 at 1:32 AM, aseem garg ase.as...@gmail.com wrote:

 int b=2;b=b++;
 b=???

 Plz explain..
 Aseem

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


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



Re: [algogeeks] Re: Array doubt

2011-07-30 Thread Kamakshii Aggarwal
@nivedita :hashing will not work if the range of nos is high

On Sun, Jul 31, 2011 at 1:40 AM, nivedita arora vivaciousnived...@gmail.com
 wrote:

 ok lets think in terms of hashmap of number and frequency
 we definitly have to maintain an order array .
 traverse original array ,  we check if its present in hashmap ..if not
 - 1)add it to hashmap and set frequency to 1 2)add it in order array
 if yes then increment frequency by 1.
 searching taking O(1) time .

 now traverse order array..search for corresponding freq and print

 this should take o(n) time...let me know if i faultered anywhere.

 @aditi- pls dont use just arrays..its not efficient way.

 On Jul 31, 12:51 am, rahul mittal rahulmitta...@gmail.com wrote:
  @nivedita:can u do this in o(n) time , i suppose your algorithm takes
  0(nlogn) time
 
  On Sun, Jul 31, 2011 at 1:14 AM, nivedita arora 
 vivaciousnived...@gmail.com
 
 
 
 
 
 
 
 
 
   wrote:
   @rahul- balanced BST can be maintained.to remove worst case !
   @sukhmeet- i did not gt your method completely ..u are trying to
   maintain hashmap or double dimension array of number and count?
   @aditi- for array we will have overhead of searching if element is
   present or not ..in O(n) time while it will be O(logn) in BST.
in array we cannot do binary search as it will not be sorted to
   improve search .
 
   On Jul 31, 12:31 am, rahul mittal rahulmitta...@gmail.com wrote:
maintaining the bst of n element in worst case will take n square
 time
complexity ..do we have a better solution for worst case
 
On Sun, Jul 31, 2011 at 12:53 AM, sukhmeet singh 
 sukhmeet2...@gmail.com
   wrote:
 
 nivedita: wts the use to maintaining BST.. if the same purpose can
 be
 fulfilled by an array ..
 but this can be a good method if the range of numbers is pretty
 large..
   den
 making a hash count can be difficult..
 
 On Sun, Jul 31, 2011 at 12:43 AM, nivedita arora 
 vivaciousnived...@gmail.com wrote:
 
 take a BST whose node has an element of frequency .and another
 array
 which will store order of elements.
 for each array element search BST if node already exists increase
 the
 freq count ..other wise  add that element in the order array we
 took
 and insert new node in BST.
 
 now , scan the order array find its corresponding element in BST
 and
 its frequency, print it that many times.
 
 let me know if there is any bttr method
 thx!
 
 On Jul 30, 11:58 pm, sukhmeet singh sukhmeet2...@gmail.com
 wrote:
  maintain a count array of all elements..
  now traverse the array again and the count array .. and build
 the
   new
 array
 
  On Sun, Jul 31, 2011 at 12:24 AM, aditi garg 
   aditi.garg.6...@gmail.com
 wrote:
 
   Q1) Given an array with some repeating numbers. Like
 12,6,5,12,6
   output: 12,12,6,6,5
 
   12 shud come before 6 since it is earlier in list. Please
 provide
   a
   gud algo fr dis
 
   --
   You received this message because you are subscribed to the
 Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to
 algogeeks@googlegroups.com.
   To unsubscribe from 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.
 
--
*With Regards *
*RAHUL MITTAL*
*3rd YEAR*
*CSE*
*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.
 
  --
  *With Regards *
  *RAHUL MITTAL*
  *3rd YEAR*
  *CSE*
  *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
 

Re: [algogeeks]

2011-07-30 Thread Kamakshii Aggarwal
@sanchit:(*(a+1)) points to 2nd element,(*(a+2)) points to 3rd element and
so on.

On Sun, Jul 31, 2011 at 1:40 AM, Sanchit Manchanda sanchit...@gmail.comwrote:

 @gaurav- a takes you to the address 1st element of the array.
 a+1 takes you to the next address after the last element. this mean if int
 is 4bits. then arrays of 5 int values is 20 bits. so *+1 *in a+1 covers
 20 bits in memory. similarly a+2 covers next 20 bits. and so on.

 where as (*(a+1)) points to 1st element,(*(a+2)) points to 2nd element
 and so on.

 i hope this helps


 On Sun, Jul 31, 2011 at 1:35 AM, gaurav gupta grvgupta...@gmail.comwrote:

 so u mean der is difference between a and a[0]


 On Sun, Jul 31, 2011 at 1:30 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 a points to the array.so when u increment it by 1 it will get
 incremented by the size of array.


 On Sun, Jul 31, 2011 at 1:28 AM, gaurav gupta grvgupta...@gmail.comwrote:

 a+1 takes to the last element of the array bt is the logic behind dis


 On Sun, Jul 31, 2011 at 1:25 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 a+1 will point to the next array(i.e it will skip the whole array)
 where as (a+1)will print address of element 2.

 On Sun, Jul 31, 2011 at 1:21 AM, Sanchit Manchanda 
 sanchit...@gmail.com wrote:

 Sorry my bad. I was wrong.

 On Sun, Jul 31, 2011 at 1:15 AM, gaurav gupta 
 grvgupta...@gmail.comwrote:

 main()
 {
 int a[5]={1,2,3,4,5};
 printf(%d%d,a+1,(a+1));
 }
 plz explain me the difference in ans.
 thanx..

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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
 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.


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


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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
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.



Re: [algogeeks] Output Help.

2011-07-30 Thread Kamakshii Aggarwal
@sanchit:it is undefined..

On Sun, Jul 31, 2011 at 1:47 AM, Sanchit Manchanda sanchit...@gmail.comwrote:

 I am getting b=2.
 Maybe coz we are assigning 2 to b then incrementing b. But still acc to me
 it should be 3.
 :-\
 No warnings in dev cpp.



 On Sun, Jul 31, 2011 at 1:43 AM, Amol Sharma amolsharm...@gmail.comwrote:

 yup it is undefined and the warning is justified
 b=b++ will assign 2 to b then increment b hence 3 is printed

 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Sun, Jul 31, 2011 at 1:41 AM, Neeraj Gupta 
 neeraj.gupta...@gmail.comwrote:

 Yes, it's UB.
 For such ques, try to run it on ideone.
 It will give a warning if any operation is not standard.
 http://ideone.com/bJBGl

  http://ideone.com/bJBGl

 On Sun, Jul 31, 2011 at 1:38 AM, aditi garg 
 aditi.garg.6...@gmail.comwrote:

 it would be undefined...

 On Sun, Jul 31, 2011 at 1:34 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 3.it is same as b=b+1;


 On Sun, Jul 31, 2011 at 1:32 AM, aseem garg ase.as...@gmail.comwrote:

 int b=2;b=b++;
 b=???

 Plz explain..
 Aseem

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




 --
 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.


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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
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.



Re: [algogeeks] Re: Array doubt

2011-07-30 Thread Kamakshii Aggarwal
@nivedita:ohhh :P

On Sun, Jul 31, 2011 at 1:46 AM, nivedita arora vivaciousnived...@gmail.com
 wrote:

 that is why i gave BST algo first :)
 but rahul wanted me to give O(n) algo

 On Jul 31, 1:15 am, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
  @nivedita :hashing will not work if the range of nos is high
 
  On Sun, Jul 31, 2011 at 1:40 AM, nivedita arora 
 vivaciousnived...@gmail.com
 
 
 
 
 
 
 
 
 
   wrote:
   ok lets think in terms of hashmap of number and frequency
   we definitly have to maintain an order array .
   traverse original array ,  we check if its present in hashmap ..if not
   - 1)add it to hashmap and set frequency to 1 2)add it in order array
   if yes then increment frequency by 1.
   searching taking O(1) time .
 
   now traverse order array..search for corresponding freq and print
 
   this should take o(n) time...let me know if i faultered anywhere.
 
   @aditi- pls dont use just arrays..its not efficient way.
 
   On Jul 31, 12:51 am, rahul mittal rahulmitta...@gmail.com wrote:
@nivedita:can u do this in o(n) time , i suppose your algorithm takes
0(nlogn) time
 
On Sun, Jul 31, 2011 at 1:14 AM, nivedita arora 
   vivaciousnived...@gmail.com
 
 wrote:
 @rahul- balanced BST can be maintained.to remove worst case !
 @sukhmeet- i did not gt your method completely ..u are trying to
 maintain hashmap or double dimension array of number and count?
 @aditi- for array we will have overhead of searching if element is
 present or not ..in O(n) time while it will be O(logn) in BST.
  in array we cannot do binary search as it will not be sorted to
 improve search .
 
 On Jul 31, 12:31 am, rahul mittal rahulmitta...@gmail.com wrote:
  maintaining the bst of n element in worst case will take n square
   time
  complexity ..do we have a better solution for worst case
 
  On Sun, Jul 31, 2011 at 12:53 AM, sukhmeet singh 
   sukhmeet2...@gmail.com
 wrote:
 
   nivedita: wts the use to maintaining BST.. if the same purpose
 can
   be
   fulfilled by an array ..
   but this can be a good method if the range of numbers is pretty
   large..
 den
   making a hash count can be difficult..
 
   On Sun, Jul 31, 2011 at 12:43 AM, nivedita arora 
   vivaciousnived...@gmail.com wrote:
 
   take a BST whose node has an element of frequency .and another
   array
   which will store order of elements.
   for each array element search BST if node already exists
 increase
   the
   freq count ..other wise  add that element in the order array
 we
   took
   and insert new node in BST.
 
   now , scan the order array find its corresponding element in
 BST
   and
   its frequency, print it that many times.
 
   let me know if there is any bttr method
   thx!
 
   On Jul 30, 11:58 pm, sukhmeet singh sukhmeet2...@gmail.com
   wrote:
maintain a count array of all elements..
now traverse the array again and the count array .. and
 build
   the
 new
   array
 
On Sun, Jul 31, 2011 at 12:24 AM, aditi garg 
 aditi.garg.6...@gmail.com
   wrote:
 
 Q1) Given an array with some repeating numbers. Like
   12,6,5,12,6
 output: 12,12,6,6,5
 
 12 shud come before 6 since it is earlier in list. Please
   provide
 a
 gud algo fr dis
 
 --
 You received this message because you are subscribed to
 the
   Google
   Groups
 Algorithm Geeks group.
 To post to this group, send email to
   algogeeks@googlegroups.com.
 To unsubscribe from 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.
 
  --
  *With Regards *
  *RAHUL MITTAL*
  *3rd YEAR*
  *CSE*
  *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

Re: [algogeeks]

2011-07-30 Thread Kamakshii Aggarwal
haan haan,i got my mistake,thanks
On Sun, Jul 31, 2011 at 1:49 AM, Sanchit Manchanda sanchit...@gmail.comwrote:

 sorry. yeah likhen mein galti kardi. but take the point what i was trying
 to say. (a+1) to galat hai.


 On Sun, Jul 31, 2011 at 1:47 AM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 @sanchit:(*(a+1)) points to 2nd element,(*(a+2)) points to 3rd element
 and so on.


 On Sun, Jul 31, 2011 at 1:40 AM, Sanchit Manchanda 
 sanchit...@gmail.comwrote:

 @gaurav- a takes you to the address 1st element of the array.
 a+1 takes you to the next address after the last element. this mean if
 int is 4bits. then arrays of 5 int values is 20 bits. so *+1 *in a+1
 covers 20 bits in memory. similarly a+2 covers next 20 bits. and so on.

 where as (*(a+1)) points to 1st element,(*(a+2)) points to 2nd element
 and so on.

 i hope this helps


 On Sun, Jul 31, 2011 at 1:35 AM, gaurav gupta grvgupta...@gmail.comwrote:

 so u mean der is difference between a and a[0]


 On Sun, Jul 31, 2011 at 1:30 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 a points to the array.so when u increment it by 1 it will get
 incremented by the size of array.


 On Sun, Jul 31, 2011 at 1:28 AM, gaurav gupta 
 grvgupta...@gmail.comwrote:

 a+1 takes to the last element of the array bt is the logic behind dis


 On Sun, Jul 31, 2011 at 1:25 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 a+1 will point to the next array(i.e it will skip the whole array)
 where as (a+1)will print address of element 2.

 On Sun, Jul 31, 2011 at 1:21 AM, Sanchit Manchanda 
 sanchit...@gmail.com wrote:

 Sorry my bad. I was wrong.

 On Sun, Jul 31, 2011 at 1:15 AM, gaurav gupta 
 grvgupta...@gmail.com wrote:

 main()
 {
 int a[5]={1,2,3,4,5};
 printf(%d%d,a+1,(a+1));
 }
 plz explain me the difference in ans.
 thanx..

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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
 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.


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


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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
 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.




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http

Re: [algogeeks] Output Help.

2011-07-30 Thread Kamakshii Aggarwal
@gaurav:refer the link below
http://c-faq.com/expr/seqpoints.html

On Sun, Jul 31, 2011 at 1:53 AM, gaurav gupta grvgupta...@gmail.com wrote:

 bt y it sud b undefind?


 On Sun, Jul 31, 2011 at 1:51 AM, Sanchit Manchanda 
 sanchit...@gmail.comwrote:

 I dint get any error, not even warning. it might depend from compiler to
 compiler. but yeah it should be undefined.


 On Sun, Jul 31, 2011 at 1:49 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 @sanchit:it is undefined..


 On Sun, Jul 31, 2011 at 1:47 AM, Sanchit Manchanda sanchit...@gmail.com
  wrote:

 I am getting b=2.
 Maybe coz we are assigning 2 to b then incrementing b. But still acc to
 me it should be 3.
 :-\
 No warnings in dev cpp.



 On Sun, Jul 31, 2011 at 1:43 AM, Amol Sharma amolsharm...@gmail.comwrote:

 yup it is undefined and the warning is justified
 b=b++ will assign 2 to b then increment b hence 3 is printed

 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Sun, Jul 31, 2011 at 1:41 AM, Neeraj Gupta 
 neeraj.gupta...@gmail.com wrote:

 Yes, it's UB.
 For such ques, try to run it on ideone.
 It will give a warning if any operation is not standard.
 http://ideone.com/bJBGl

  http://ideone.com/bJBGl

 On Sun, Jul 31, 2011 at 1:38 AM, aditi garg 
 aditi.garg.6...@gmail.com wrote:

 it would be undefined...

 On Sun, Jul 31, 2011 at 1:34 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 3.it is same as b=b+1;


 On Sun, Jul 31, 2011 at 1:32 AM, aseem garg ase.as...@gmail.comwrote:

 int b=2;b=b++;
 b=???

 Plz explain..
 Aseem

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




 --
 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.


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




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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,
 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.




 --
 Sanchit Manchanda
 COE(3rd year) , NSIT
 http://iblogmythots.wordpress.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

  1   2   >