Re: [algogeeks] Re: RAID LEVEL

2011-08-10 Thread krishna meena
i think raid level 3 provide high transfer rate with single stream I/O
applications such as graphical imaging processors , CAD/CAM files etc.


On Wed, Aug 10, 2011 at 6:11 AM, Gary Drocella  wrote:

> RAID Level 0 is used for high performance where data loss isn't
> critical.  Bit stripping is still performed
> over multiple disks, but no mirroring or parity bits used for checking
> data integrity.
>
> On Aug 9, 2:56 pm, Vivek Srivastava 
> wrote:
> > On Wed, Aug 10, 2011 at 12:22 AM, raghavendhra rahul <
> >
> >
> >
> >
> >
> >
> >
> > rahulraghavend...@gmail.com> wrote:
> > > @krishnameena: i think its 5
> >
> > > correct me if i m wrong
> >
> > > --
> >
> > > Regards
> > > Raghavendhra
> >
> > > It's Raid level 3
> > > "changing the face" can change nothing .. but "facing the change" can
> > > change everything
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Algorithm Geeks" group.
> > > To post to this group, send email to algogeeks@googlegroups.com.
> > > To unsubscribe from 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.



[algogeeks] Re: goldman sachs paper

2011-08-10 Thread deepikaanand
@UTKARSH i know the selection criteria but i want to know exactly the
qs asked...plzz post a few qs if u knw any...

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

2011-08-10 Thread naveen ms
hey can any1 help me out...how ll be the akamai recruiment
procedure...and if u have any akamai papers please upload it


with regards

naveen

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread siddharam suresh
shortest preemptive  job first
Thank you,
Siddharam


On Thu, Aug 11, 2011 at 10:49 AM, krishna meena
wrote:

> Consider a set of n teaks with known runtimes  r1,r2,r3rn to be
> run on a uni-processor machine. which processor scheduling algorithm
> will result in the maximum throughput?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



[algogeeks] os

2011-08-10 Thread krishna meena
Consider a set of n teaks with known runtimes  r1,r2,r3rn to be
run on a uni-processor machine. which processor scheduling algorithm
will result in the maximum throughput?

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



Re: [algogeeks] c question!

2011-08-10 Thread siddharth srivastava
(sizeof(struct)); ??
>

That doesn't makes sense. Size of struct is what ?? you need the size of
your structure with the variables you have declared in it.


>
> cos malloc returns pointer to memory block and nodeptr itself is a pointer
> and you have used nodeptr* further?
>
>
>
> On Tue, Aug 9, 2011 at 6:32 PM, siddharth srivastava 
> wrote:
>
>>  @sidharth: thanks a lot for correcting me :)
>>> @aditya : no. there was some mistake;
>>>
>>> in the code i pasted above it's giving segmentation fault. Is it cause
>>> i'm initializing h without using malloc??
>>> Please throw light on this problem
>>>
>>
>> Pointer points to a location in memory. You can't use h without making h
>> to reference to some area in memory.
>>
>>
>>
>>> And in the following code
>>> char *s;
>>> scanf("%s", s);
>>> why isn't it possible to store a string in s??
>>>
>>> Please explain both concepts.
>>>
>>> --
>>>  You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Regards
>> Siddharth Srivastava
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
>  "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
Siddharth Srivastava

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



Re: [algogeeks] goldman sachs paper

2011-08-10 Thread arvind kumar
This is for software profile of the intern??

On Thu, Aug 11, 2011 at 1:32 AM, UTKARSH SRIVASTAV
wrote:

> for written prepare for aptitude and c...and then there will be
> gd...then 3-4 interviews of tech,hra...improve communication
> skill for gd
>
>
> On Thu, Aug 11, 2011 at 12:49 AM, Prakash D  wrote:
>
>> +1.. it'll be helpful
>>
>>
>> On Thu, Aug 11, 2011 at 12:12 AM, Prashant Gupta <
>> prashantatn...@gmail.com> wrote:
>>
>>> +1 to deepika.
>>>
>>>
>>> On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand 
>>> wrote:
>>>
 can anyone please post the questions asked in goldman sachs this year

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


>>>
>>>
>>> --
>>> Prashant Gupta
>>> B.Tech Final Year
>>> Computer Science and Engineering
>>> NIT Trichy
>>> Phone : +91 9894462744
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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 3rd Year
> @MNNIT ALLAHABAD*
>
> --
>  You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-08-10 Thread Amethy hobby
it also like Pythagorean theorem;
so the a[k] also with the value where
a[j]-a[i]a[j]>=a[i];

On 8月9日, 下午10时43分, Samba Ganapavarapu  wrote:
> We have an array of integers, we need to find the element a[i],a[j] and a[k]
> values where.. a[i]^2 + a[k]^2 = a[k] ^2
> what would be the fast algorithm to find ?
>
> - Samba

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

2011-08-10 Thread Dave
@Dinoja: No. You can only binary search for 1 thing, so you would have
to choose two elements and then search for the third. Thus, the order
would be O(n^2 log n).

Dave

On Aug 10, 6:11 pm, Dinoja Padmanabhan  wrote:
> After squaring all the elements up and sorting them, couldn't we just do a
> binary search on the array.. so the TC would be O(nlogn)...
>
>
>
>
>
> On Wed, Aug 10, 2011 at 1:18 PM, Kunal Patil  wrote:
> > @Ankit: Ohh Sorry..I didnt actually read the question properly..
> > I didnt see we have to check for sum which must be another element in the
> > array & not some user provided constant value..I mis-understood it with sum
> > upto k problem which can be solved on sorted array in O(n)...
> > thats why gave a wrong comment...my Bad..
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from 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,
> Dinoj

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread Dinoja Padmanabhan
After squaring all the elements up and sorting them, couldn't we just do a
binary search on the array.. so the TC would be O(nlogn)...

On Wed, Aug 10, 2011 at 1:18 PM, Kunal Patil  wrote:

> @Ankit: Ohh Sorry..I didnt actually read the question properly..
> I didnt see we have to check for sum which must be another element in the
> array & not some user provided constant value..I mis-understood it with sum
> upto k problem which can be solved on sorted array in O(n)...
> thats why gave a wrong comment...my Bad..
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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,
Dinoj

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

2011-08-10 Thread payal gupta
do reply if u have it

On Thu, Aug 11, 2011 at 12:24 AM, Brijesh Upadhyay <
brijeshupadhyay...@gmail.com> wrote:

> Yeah...please share questions..it will be of a lot help!
>
> --
> 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/-/cs4XYfgJrooJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] goldman sachs paper

2011-08-10 Thread UTKARSH SRIVASTAV
for written prepare for aptitude and c...and then there will be
gd...then 3-4 interviews of tech,hra...improve communication
skill for gd

On Thu, Aug 11, 2011 at 12:49 AM, Prakash D  wrote:

> +1.. it'll be helpful
>
>
> On Thu, Aug 11, 2011 at 12:12 AM, Prashant Gupta  > wrote:
>
>> +1 to deepika.
>>
>>
>> On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand 
>> wrote:
>>
>>> can anyone please post the questions asked in goldman sachs this year
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>>
>> --
>> Prashant Gupta
>> B.Tech Final Year
>> Computer Science and Engineering
>> NIT Trichy
>> Phone : +91 9894462744
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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 3rd Year
@MNNIT ALLAHABAD*

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



[algogeeks] Re: Problems on Linked List

2011-08-10 Thread Don
Q1: The function below reverses a linked list in place. Call it on one
of the lists, compare the resulting list to the other list. Then call
it again to put the list back in its original order.

list Reverse(list head)
{
  list T, prv, nxt;

  prv = head;
  for(T = head->next; T; T = nxt)
  {
nxt = T->next;
T->next = prv;
prv = T;
T = nxt;
  }
  head->next = 0;
  return prv;
}

Q2:
delete(node *d)
{
  if (d->next)
  {
node nxt = d->next;
d->value = nxt->value;
d->next = nxt->next;
free nxt;
  }
  else
  {
for(node p = head; p; p = p->next)
  if (p->next == d)
  {
p->next = 0;
free d;
  }
  }
}

On Aug 10, 1:14 pm, Piyush Kapoor  wrote:
> Q1)Two linked Lists are given,i.e,their head pointers are given,and the
> problem is to check if the second one is reverse of the first one.Give the
> most efficient algo for it.
> Q2)A linked list is given,and one of its nodes is given.The problem is to
> delete the given node from the linked list.(The head node is not given).
> (In both of the above cases,the linked lists are singly linked lists.)
> --
> *Regards,*
> *Piyush Kapoor,*
> *2nd year,CSE
> IT-BHU*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: Plz tell wat questions are asked by MICROSOFT IDC and IT both...Plz Reply fast.....anyone...!!

2011-08-10 Thread KK
Go through the last 50-100 posts... a lot of Qs have already been
posted!!

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

2011-08-10 Thread aditya kumar
1)for the fst one you dont have to reverse the linked list just traverse the
linked list recursively and read it from back .
  correct me if m wrong !

On Thu, Aug 11, 2011 at 12:41 AM, Piyush Kapoor  wrote:

> thanks all
>
>
> On Thu, Aug 11, 2011 at 12:21 AM, siddharam suresh <
> siddharam@gmail.com> wrote:
>
>> 1)similar to list palindrome problem(soln already there in net)
>> 2)it has discussed 2 day before on same group. please search once
>>
>> Thank you,
>> Siddharam
>>
>>
>> On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor wrote:
>>
>>> @naveen
>>> for the first one,how will u traverse the list backwards..
>>> I didnt understand  your second solution,since the head is not given so
>>> how can u go from a node to the node to be deleted..
>>>
>>>
>>> I forgot that in the first one,we are not allowed to use extra memory.
>>> Also do please mention the time complexity of your solutions..
>>>
>>> On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar <
>>> naveenkumarve...@gmail.com> wrote:
>>>
 for first reverse one of the link list by changing the pointer and
 than traverse one from backward and compare it the the other.

 for second. keep copying data from the next node to the node to be
 delete and remove the tail. This will not work if node to be deleted
 is the last node.

 On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor 
 wrote:
 > Q1)Two linked Lists are given,i.e,their head pointers are given,and
 the
 > problem is to check if the second one is reverse of the first one.Give
 the
 > most efficient algo for it.
 > Q2)A linked list is given,and one of its nodes is given.The problem is
 to
 > delete the given node from the linked list.(The head node is not
 given).
 > (In both of the above cases,the linked lists are singly linked lists.)
 > --
 > Regards,
 > Piyush Kapoor,
 > 2nd year,CSE
 > IT-BHU
 >
 > --
 > You received this message because you are subscribed to the Google
 Groups
 > "Algorithm Geeks" group.
 > To post to this group, send email to algogeeks@googlegroups.com.
 > To unsubscribe from this group, send email to
 > algogeeks+unsubscr...@googlegroups.com.
 > For more options, visit this group at
 > http://groups.google.com/group/algogeeks?hl=en.
 >



 --
 Cheers
 Naveen Kumar

 --
 You received this message because you are subscribed to the Google
 Groups "Algorithm Geeks" group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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,*
>>> *Piyush Kapoor,*
>>> *2nd year,CSE
>>> IT-BHU*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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,*
> *Piyush Kapoor,*
> *2nd year,CSE
> IT-BHU*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks]

2011-08-10 Thread Raju Yadav
void mirror(struct node* node)
{
  if (node==NULL)
  {
return;
  }
  else
  {
struct node* temp;
mirror(node->left);
mirror(node->right);
temp = node->left;
node->left = node->right;
node->right = temp;
  }
}

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

2011-08-10 Thread Prakash D
+1.. it'll be helpful

On Thu, Aug 11, 2011 at 12:12 AM, Prashant Gupta
wrote:

> +1 to deepika.
>
>
> On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand wrote:
>
>> can anyone please post the questions asked in goldman sachs this year
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Prashant Gupta
> B.Tech Final Year
> Computer Science and Engineering
> NIT Trichy
> Phone : +91 9894462744
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Write a program to find the empirical formulae from physical formulae

2011-08-10 Thread Prakash D
i think the given formula's solution should be

c1  h33 o20 n10
check the question..


On Wed, Aug 10, 2011 at 9:49 PM, vikas  wrote:

> Write a program to find the empirical formulae from physical formulae
> ex: ch3((oh)2(nh3)2)5
> has empirical formulae
> c1 h43 o2 n10
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Problems on Linked List

2011-08-10 Thread Piyush Kapoor
thanks all

On Thu, Aug 11, 2011 at 12:21 AM, siddharam suresh
wrote:

> 1)similar to list palindrome problem(soln already there in net)
> 2)it has discussed 2 day before on same group. please search once
>
> Thank you,
> Siddharam
>
>
> On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor wrote:
>
>> @naveen
>> for the first one,how will u traverse the list backwards..
>> I didnt understand  your second solution,since the head is not given so
>> how can u go from a node to the node to be deleted..
>>
>>
>> I forgot that in the first one,we are not allowed to use extra memory.
>> Also do please mention the time complexity of your solutions..
>>
>> On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar <
>> naveenkumarve...@gmail.com> wrote:
>>
>>> for first reverse one of the link list by changing the pointer and
>>> than traverse one from backward and compare it the the other.
>>>
>>> for second. keep copying data from the next node to the node to be
>>> delete and remove the tail. This will not work if node to be deleted
>>> is the last node.
>>>
>>> On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor 
>>> wrote:
>>> > Q1)Two linked Lists are given,i.e,their head pointers are given,and the
>>> > problem is to check if the second one is reverse of the first one.Give
>>> the
>>> > most efficient algo for it.
>>> > Q2)A linked list is given,and one of its nodes is given.The problem is
>>> to
>>> > delete the given node from the linked list.(The head node is not
>>> given).
>>> > (In both of the above cases,the linked lists are singly linked lists.)
>>> > --
>>> > Regards,
>>> > Piyush Kapoor,
>>> > 2nd year,CSE
>>> > IT-BHU
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Algorithm Geeks" group.
>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>>
>>>
>>>
>>> --
>>> Cheers
>>> Naveen Kumar
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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,*
>> *Piyush Kapoor,*
>> *2nd year,CSE
>> IT-BHU*
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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,*
*Piyush Kapoor,*
*2nd year,CSE
IT-BHU*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread Naveen Kumar
at each node swap left & right pointers

On Thu, Aug 11, 2011 at 12:25 AM, sukran dhawan  wrote:
> how to find the mirror image of a binary tree ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Cheers
Naveen Kumar

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

2011-08-10 Thread Avenged
It's an UNDEFINED BEHAVIOR .

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

2011-08-10 Thread sukran dhawan
how to find the mirror image of a binary tree ?

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



[algogeeks] Re: Microsoft Written Test Questions

2011-08-10 Thread Brijesh Upadhyay
Yeah...please share questions..it will be of a lot help!

-- 
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/-/cs4XYfgJrooJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] Problems on Linked List

2011-08-10 Thread siddharam suresh
1)similar to list palindrome problem(soln already there in net)
2)it has discussed 2 day before on same group. please search once

Thank you,
Siddharam


On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor  wrote:

> @naveen
> for the first one,how will u traverse the list backwards..
> I didnt understand  your second solution,since the head is not given so how
> can u go from a node to the node to be deleted..
>
>
> I forgot that in the first one,we are not allowed to use extra memory.
> Also do please mention the time complexity of your solutions..
>
> On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar  > wrote:
>
>> for first reverse one of the link list by changing the pointer and
>> than traverse one from backward and compare it the the other.
>>
>> for second. keep copying data from the next node to the node to be
>> delete and remove the tail. This will not work if node to be deleted
>> is the last node.
>>
>> On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor 
>> wrote:
>> > Q1)Two linked Lists are given,i.e,their head pointers are given,and the
>> > problem is to check if the second one is reverse of the first one.Give
>> the
>> > most efficient algo for it.
>> > Q2)A linked list is given,and one of its nodes is given.The problem is
>> to
>> > delete the given node from the linked list.(The head node is not given).
>> > (In both of the above cases,the linked lists are singly linked lists.)
>> > --
>> > Regards,
>> > Piyush Kapoor,
>> > 2nd year,CSE
>> > IT-BHU
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Algorithm Geeks" group.
>> > To post to this group, send email to algogeeks@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > algogeeks+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/algogeeks?hl=en.
>> >
>>
>>
>>
>> --
>> Cheers
>> Naveen Kumar
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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,*
> *Piyush Kapoor,*
> *2nd year,CSE
> IT-BHU*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



[algogeeks] Re: Microsoft Written Test Questions

2011-08-10 Thread vishwan baghla
hey...is your written test over...plz share the questions dude...!! plz..

-- 
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/-/PWtdOw902rIJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread sukran dhawan
please help me !

On Wed, Aug 10, 2011 at 11:20 PM, sukran dhawan wrote:

> is it sufficient or do we need to refer to any other books?
>
>
> On Wed, Aug 10, 2011 at 10:59 PM, rajoo king without sing <
> rajoo...@gmail.com> wrote:
>
>> **Quantitative
>> Apptitude By R S Agarwal
>>
>>
>> On Wed, Aug 10, 2011 at 10:49 PM, Shashank Jain wrote:
>>
>>> what's the book name plz?
>>>
>>>
>>> Shashank Jain
>>> IIIrd year
>>> Computer Engineering
>>> Delhi College of Engineering
>>>
>>>
>>>
>>> On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary wrote:
>>>
 rs aggarwal

 On 10 August 2011 18:32, Shashank Jain  wrote:

> what is the best book for aptitude questions?
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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 Pratima :)

 --
 You received this message because you are subscribed to the Google
 Groups "Algorithm Geeks" group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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 & Best regards*
>> **
>> **
>> *Rajoo kumar kannaujiya*
>> *Pursuing  M.Tech(cse)*
>> *Motilal Nehru National Institute of Technology,*
>> *Allahabad.*
>> *Contect No. :  8090842100*
>> *Email  :  rajoo...@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.



Re: [algogeeks] Problems on Linked List

2011-08-10 Thread Naveen Kumar
and for second no need to delete that very node pointer, take the data
of the node next to the node  you want to delete and copy that to the
node you want to delete, do it for all next nodes. delete the last
node.

On Thu, Aug 11, 2011 at 12:12 AM, sukran dhawan  wrote:
> reverse the list inplace and compare the two list element by element
>
> On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor  wrote:
>>
>> @naveen
>> for the first one,how will u traverse the list backwards..
>> I didnt understand  your second solution,since the head is not given so
>> how can u go from a node to the node to be deleted..
>>
>>
>> I forgot that in the first one,we are not allowed to use extra memory.
>> Also do please mention the time complexity of your solutions..
>>
>> On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar
>>  wrote:
>>>
>>> for first reverse one of the link list by changing the pointer and
>>> than traverse one from backward and compare it the the other.
>>>
>>> for second. keep copying data from the next node to the node to be
>>> delete and remove the tail. This will not work if node to be deleted
>>> is the last node.
>>>
>>> On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor 
>>> wrote:
>>> > Q1)Two linked Lists are given,i.e,their head pointers are given,and the
>>> > problem is to check if the second one is reverse of the first one.Give
>>> > the
>>> > most efficient algo for it.
>>> > Q2)A linked list is given,and one of its nodes is given.The problem is
>>> > to
>>> > delete the given node from the linked list.(The head node is not
>>> > given).
>>> > (In both of the above cases,the linked lists are singly linked lists.)
>>> > --
>>> > Regards,
>>> > Piyush Kapoor,
>>> > 2nd year,CSE
>>> > IT-BHU
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "Algorithm Geeks" group.
>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>>
>>>
>>>
>>> --
>>> Cheers
>>> Naveen Kumar
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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,
>> Piyush Kapoor,
>> 2nd year,CSE
>> IT-BHU
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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.
>



-- 
Cheers
Naveen Kumar

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

2011-08-10 Thread ankit sambyal
Ques 1:
Let l1 and l2 be the 2 lists.
Step 1 : Reverse l1  O(n)
Step 2 : Compare l1 and l2 by comparing each node and traversing
ahead.--O(n)
Step 3: Reverse l1 -O(n)



Ques 2:
Let cur be the node of the linked list which is to be deleted.

LinkedList temp=cur->next;
cur->data=temp->data;
cur->next=temp->next;
free(temp);

TC : O(1)
This solution does not work if cur is the last node of the link list. In
that case u will have to traverse the whole link list and TC will be O(n)

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



[algogeeks] Plz tell wat questions are asked by MICROSOFT IDC and IT both...Plz Reply fast.....anyone...!!

2011-08-10 Thread vishwan baghla


-- 
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/-/dV-k5A2L7PkJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] goldman sachs paper

2011-08-10 Thread Prashant Gupta
+1 to deepika.

On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand wrote:

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


-- 
Prashant Gupta
B.Tech Final Year
Computer Science and Engineering
NIT Trichy
Phone : +91 9894462744

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

2011-08-10 Thread sukran dhawan
reverse the list inplace and compare the two list element by element

On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor  wrote:

> @naveen
> for the first one,how will u traverse the list backwards..
> I didnt understand  your second solution,since the head is not given so how
> can u go from a node to the node to be deleted..
>
>
> I forgot that in the first one,we are not allowed to use extra memory.
> Also do please mention the time complexity of your solutions..
>
>
> On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar  > wrote:
>
>> for first reverse one of the link list by changing the pointer and
>> than traverse one from backward and compare it the the other.
>>
>> for second. keep copying data from the next node to the node to be
>> delete and remove the tail. This will not work if node to be deleted
>> is the last node.
>>
>> On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor 
>> wrote:
>> > Q1)Two linked Lists are given,i.e,their head pointers are given,and the
>> > problem is to check if the second one is reverse of the first one.Give
>> the
>> > most efficient algo for it.
>> > Q2)A linked list is given,and one of its nodes is given.The problem is
>> to
>> > delete the given node from the linked list.(The head node is not given).
>> > (In both of the above cases,the linked lists are singly linked lists.)
>> > --
>> > Regards,
>> > Piyush Kapoor,
>> > 2nd year,CSE
>> > IT-BHU
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Algorithm Geeks" group.
>> > To post to this group, send email to algogeeks@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > algogeeks+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/algogeeks?hl=en.
>> >
>>
>>
>>
>> --
>> Cheers
>> Naveen Kumar
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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,*
> *Piyush Kapoor,*
> *2nd year,CSE
> IT-BHU*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



[algogeeks] goldman sachs paper

2011-08-10 Thread deepikaanand
can anyone please post the questions asked in goldman sachs this year

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

2011-08-10 Thread Piyush Kapoor
@naveen
for the first one,how will u traverse the list backwards..
I didnt understand  your second solution,since the head is not given so how
can u go from a node to the node to be deleted..


I forgot that in the first one,we are not allowed to use extra memory.
Also do please mention the time complexity of your solutions..

On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar
wrote:

> for first reverse one of the link list by changing the pointer and
> than traverse one from backward and compare it the the other.
>
> for second. keep copying data from the next node to the node to be
> delete and remove the tail. This will not work if node to be deleted
> is the last node.
>
> On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor 
> wrote:
> > Q1)Two linked Lists are given,i.e,their head pointers are given,and the
> > problem is to check if the second one is reverse of the first one.Give
> the
> > most efficient algo for it.
> > Q2)A linked list is given,and one of its nodes is given.The problem is to
> > delete the given node from the linked list.(The head node is not given).
> > (In both of the above cases,the linked lists are singly linked lists.)
> > --
> > Regards,
> > Piyush Kapoor,
> > 2nd year,CSE
> > IT-BHU
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
>
>
>
> --
> Cheers
> Naveen Kumar
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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,*
*Piyush Kapoor,*
*2nd year,CSE
IT-BHU*

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

2011-08-10 Thread Naveen Kumar
for first reverse one of the link list by changing the pointer and
than traverse one from backward and compare it the the other.

for second. keep copying data from the next node to the node to be
delete and remove the tail. This will not work if node to be deleted
is the last node.

On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor  wrote:
> Q1)Two linked Lists are given,i.e,their head pointers are given,and the
> problem is to check if the second one is reverse of the first one.Give the
> most efficient algo for it.
> Q2)A linked list is given,and one of its nodes is given.The problem is to
> delete the given node from the linked list.(The head node is not given).
> (In both of the above cases,the linked lists are singly linked lists.)
> --
> Regards,
> Piyush Kapoor,
> 2nd year,CSE
> IT-BHU
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Cheers
Naveen Kumar

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

2011-08-10 Thread Piyush Kapoor
Q1)Two linked Lists are given,i.e,their head pointers are given,and the
problem is to check if the second one is reverse of the first one.Give the
most efficient algo for it.
Q2)A linked list is given,and one of its nodes is given.The problem is to
delete the given node from the linked list.(The head node is not given).
(In both of the above cases,the linked lists are singly linked lists.)
-- 
*Regards,*
*Piyush Kapoor,*
*2nd year,CSE
IT-BHU*

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

2011-08-10 Thread $hr! k@nth
Tie the rope at the top of the tower
Climb down with the help of the rope up to 100 mt peg possItion
Tie the rope to that peg, Climb up to the top of the tower with that rope.
Now release the rope at the top and hold it. It ll take you down.:P


On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa wrote:

> make two ropes 50m and 100 meter. make a loop kind of thing with that now
> you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
> downward now cut the loop at 100 mtr you have 100 mtr rope then move down
> with the help of that. i hope i am clear.
>
>
> On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C wrote:
>
>> tie the rope to the peg and hold the rope at a little less than 100m
>> point. Then jump.
>>
>>
>> On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava <
>> himanshusri...@gmail.com> wrote:
>>
>>> @Dave oh i thought some logical concept willl be applied in that
>>> case...it is ok!!!
>>> thanks:)
>>>
>>>
>>> On Fri, Aug 5, 2011 at 1:47 AM, Dave  wrote:
>>>
 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava 
 wrote:
 > suppose u tie the rope at 200mt height and now climb down to 100m
 > heightthen u tie the rope at that point then how will you open the
 rope
 > at point above 200mt where u have tied it earlier
 >
 >
 >
 > On Thu, Aug 4, 2011 at 11:15 PM, mohit verma 
 wrote:
 > > can't we tie the rope where we are standing (at height of 200
 meter)?
 >
 > > On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe <
 > > neeraja.marath...@gmail.com> wrote:
 >
 > >> this was the puzzle asked to me in NVIDIA interview:
 > >> you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
 > >> bottom of tower there is a peg where u can tie a rope. You have a
 rope
 > >> of length 150 mt. with you and using this rope you have to get down
 > >> the tower. you can not jump or there is nobody to help you. how
 will u
 > >> get down the tower??
 >
 > >> --
 > >> You received this message because you are subscribed to the Google
 Groups
 > >> "Algorithm Geeks" group.
 > >> To post to this group, send email to algogeeks@googlegroups.com.
 > >> To unsubscribe from this group, send email to
 > >> algogeeks+unsubscr...@googlegroups.com.
 > >> For more options, visit this group at
 > >>http://groups.google.com/group/algogeeks?hl=en.
 >
 > > --
 > > 
 > > *MOHIT VERMA*
 >
 > >  --
 > > You received this message because you are subscribed to the Google
 Groups
 > > "Algorithm Geeks" group.
 > > To post to this group, send email to algogeeks@googlegroups.com.
 > > To unsubscribe from this group, send email to
 > > algogeeks+unsubscr...@googlegroups.com.
 > > For more options, visit this group at
 > >http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text -
 >
 > - Show quoted text -

 --
 You received this message because you are subscribed to the Google
 Groups "Algorithm Geeks" group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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,
>> 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.
>>
>
>
>
> --
> Varun Pahwa
> B.Tech (IT)
> 7th Sem.
> Indian Institute of Information Technology Allahabad.
> Ph : 09793899112
> Official Email :: rit2008...@iiita.ac.in
> Another Email :: varunpahwa.ii...@gmail.com
>
> People who fail to plan are those who plan to fail.
>
>  --
> You received this message because you are subsc

Re: [algogeeks] aptitude

2011-08-10 Thread sukran dhawan
is it sufficient or do we need to refer to any other books?

On Wed, Aug 10, 2011 at 10:59 PM, rajoo king without sing <
rajoo...@gmail.com> wrote:

> **Quantitative
> Apptitude By R S Agarwal
>
>
> On Wed, Aug 10, 2011 at 10:49 PM, Shashank Jain wrote:
>
>> what's the book name plz?
>>
>>
>> Shashank Jain
>> IIIrd year
>> Computer Engineering
>> Delhi College of Engineering
>>
>>
>>
>> On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary wrote:
>>
>>> rs aggarwal
>>>
>>> On 10 August 2011 18:32, Shashank Jain  wrote:
>>>
 what is the best book for aptitude questions?

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering

  --
 You received this message because you are subscribed to the Google
 Groups "Algorithm Geeks" group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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 Pratima :)
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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 & Best regards*
> **
> **
> *Rajoo kumar kannaujiya*
> *Pursuing  M.Tech(cse)*
> *Motilal Nehru National Institute of Technology,*
> *Allahabad.*
> *Contect No. :  8090842100*
> *Email  :  rajoo...@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.



[algogeeks] Re: EMC question paper pattern

2011-08-10 Thread htross
is your interview over???

On Aug 9, 11:31 pm, nandy  wrote:
> Hi all,does anyone know EMC software's(bangalore) written pattern?is
> it purely technical..if so can anyone tell me the areas to concentrate
> on?

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



Re: [algogeeks] c output

2011-08-10 Thread aditi garg
this ques has been answered be4 on this grp...and u missed the macro
definition as welljst a few days bak...search the group

On Wed, Aug 10, 2011 at 11:00 PM, rohit  wrote:

> main()
> {
> int m,n;
> m=3+max(2,3);
> n=2*max(3,2);
> printf(“%d,%d”,m,n);
> }
> ans:-m=2,n=3
> why output is this???
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



[algogeeks] c output

2011-08-10 Thread rohit
main()
{
int m,n;
m=3+max(2,3);
n=2*max(3,2);
printf(“%d,%d”,m,n);
}
ans:-m=2,n=3
why output is this???

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread rajoo king without sing
**Quantitative
Apptitude By R S Agarwal


On Wed, Aug 10, 2011 at 10:49 PM, Shashank Jain wrote:

> what's the book name plz?
>
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
>
>
> On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary wrote:
>
>> rs aggarwal
>>
>> On 10 August 2011 18:32, Shashank Jain  wrote:
>>
>>> what is the best book for aptitude questions?
>>>
>>> Shashank Jain
>>> IIIrd year
>>> Computer Engineering
>>> Delhi College of Engineering
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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 Pratima :)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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 & Best regards*
**
**
*Rajoo kumar kannaujiya*
*Pursuing  M.Tech(cse)*
*Motilal Nehru National Institute of Technology,*
*Allahabad.*
*Contect No. :  8090842100*
*Email  :  rajoo...@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: thought works questions

2011-08-10 Thread keerthana
Hi reynald can u plz post the questions u got..

On Aug 4, 6:17 am, Reynald Suz  wrote:
> Thank you so much! Thoughtworks is visiting our campus on Aug-8, I'll send
> you questions for sure.
>
>
>
>
>
>
>
>
>
> On Wed, Aug 3, 2011 at 11:14 PM, coder dumca  wrote:
>
> > hi reynald
>
> >  i m sending u some question that i have.  thought workd is gooing to visit
> > our campys in few days . if it is visiting ur campus befire us then pls send
> > me the questions.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from 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
> Reynald Reni
> Masters in Software Engineering
> CIT - 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.



Re: [algogeeks] aptitude

2011-08-10 Thread Shashank Jain
what's the book name plz?


Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering



On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary  wrote:

> rs aggarwal
>
> On 10 August 2011 18:32, Shashank Jain  wrote:
>
>> what is the best book for aptitude questions?
>>
>> Shashank Jain
>> IIIrd year
>> Computer Engineering
>> Delhi College of Engineering
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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 Pratima :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: Amazon question.

2011-08-10 Thread Kunal Patil
@Ankit: Ohh Sorry..I didnt actually read the question properly..
I didnt see we have to check for sum which must be another element in the
array & not some user provided constant value..I mis-understood it with sum
upto k problem which can be solved on sorted array in O(n)...
thats why gave a wrong comment...my Bad..

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread ankit sambyal
@kunal, anuj : step 2 of my algo takes O(n^2). So how can the TC be O(nlogn)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] Write a program to find the empirical formulae from physical formulae

2011-08-10 Thread vikas
Write a program to find the empirical formulae from physical formulae
ex: ch3((oh)2(nh3)2)5
has empirical formulae
c1 h43 o2 n10

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

2011-08-10 Thread Kunal Patil
@Ankuj: +1 for different approach. (Though selection algo is more efficient
than this.)

On Wed, Aug 10, 2011 at 1:44 PM, nick  wrote:

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



Re: [algogeeks] Re: Amazon question.

2011-08-10 Thread Kunal Patil
@Ankit Sambyal: Agree with ankuj...TC of your solution is O(nlogn) and not
O(n^2)...

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

2011-08-10 Thread Don
I do love functions that start with "return".
Don

On Aug 10, 10:09 am, Dave  wrote:
> @Don: Beautiful!
>
> Dave
>
> On Aug 10, 10:03 am, Don  wrote:
>
> > int depth(node *root)
> > {
> >   return root ? 1+max(depth(root->left), depth(root->right)) : 0;
>
> > }
>
> > On Aug 8, 8:03 am, jagrati verma  wrote:
>
> > >  finding the depth or height of a tree.

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



Re: [algogeeks] Re: ~ operator

2011-08-10 Thread Ayswarya Srinivasan
thank you dave and amit...

On Wed, Aug 10, 2011 at 8:36 PM, Dave  wrote:

> @Ayswarya: In twos-complement arithmetic, -x = ~x + 1, so
>
> a + ~b + 1 = a +(~b +1) = a + (-b) = a - b.
>
> Dave
>
> On Aug 10, 9:23 am, Ayswarya Srinivasan  wrote:
> > can someone explain how this works-
> > *
> > *
> > *void* *main*(){
> > *int* a,b,d;
> > scanf("%d%d",&a,&b);
> > d=a+~b+1;
> > printf("%d",d);
> > getch();
> >
> > }
> >
> > say if a=5 b=6 then
> > output is -1
> >
> > if ~ is one's complement operator
> > then
> > a=0101
> > ~b=1001
> >
> > d= 0101+1001+1. which is not -1
> >
> > can someone explain how it works.
> >
> > --
> >
> > Regards,
> > Ayswarya S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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,
Ayswarya S

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

2011-08-10 Thread Dave
@Don: Beautiful!

Dave

On Aug 10, 10:03 am, Don  wrote:
> int depth(node *root)
> {
>   return root ? 1+max(depth(root->left), depth(root->right)) : 0;
>
> }
>
> On Aug 8, 8:03 am, jagrati verma  wrote:
>
>
>
> >  finding the depth or height of a tree.

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



[algogeeks] Re: ~ operator

2011-08-10 Thread Dave
@Ayswarya: In twos-complement arithmetic, -x = ~x + 1, so

a + ~b + 1 = a +(~b +1) = a + (-b) = a - b.

Dave

On Aug 10, 9:23 am, Ayswarya Srinivasan  wrote:
> can someone explain how this works-
> *
> *
> *void* *main*(){
>     *int* a,b,d;
>     scanf("%d%d",&a,&b);
>     d=a+~b+1;
>     printf("%d",d);
>     getch();
>
> }
>
> say if a=5 b=6 then
> output is -1
>
> if ~ is one's complement operator
> then
> a=0101
> ~b=1001
>
> d= 0101+1001+1. which is not -1
>
> can someone explain how it works.
>
> --
>
> Regards,
> Ayswarya S

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

2011-08-10 Thread Don
int depth(node *root)
{
  return root ? 1+max(depth(root->left), depth(root->right)) : 0;
}

On Aug 8, 8:03 am, jagrati verma  wrote:
>  finding the depth or height of a tree.

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



[algogeeks] Re: suggest simple code for

2011-08-10 Thread Don
int depth(node *root)
{
  return root ? max(depth(root->left), depth(root->right)) : 0;
}

On Aug 8, 8:03 am, jagrati verma  wrote:
>  finding the depth or height of a tree.

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



[algogeeks] Re: ~ operator

2011-08-10 Thread amit karmakar
calculate 0101+1001+1 as 
Now if the signed numbers are represented using 2's complement system
then  is the representation for -1


On Aug 10, 7:23 pm, Ayswarya Srinivasan  wrote:
> can someone explain how this works-
> *
> *
> *void* *main*(){
>     *int* a,b,d;
>     scanf("%d%d",&a,&b);
>     d=a+~b+1;
>     printf("%d",d);
>     getch();
>
> }
>
> say if a=5 b=6 then
> output is -1
>
> if ~ is one's complement operator
> then
> a=0101
> ~b=1001
>
> d= 0101+1001+1. which is not -1
>
> can someone explain how it works.
>
> --
>
> Regards,
> Ayswarya S

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

2011-08-10 Thread Ayswarya Srinivasan
can someone explain how this works-
*
*
*void* *main*(){
*int* a,b,d;
scanf("%d%d",&a,&b);
d=a+~b+1;
printf("%d",d);
getch();
}

say if a=5 b=6 then
output is -1

if ~ is one's complement operator
then
a=0101
~b=1001

d= 0101+1001+1. which is not -1

can someone explain how it works.



-- 

Regards,
Ayswarya S

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

2011-08-10 Thread varun pahwa
make two ropes 50m and 100 meter. make a loop kind of thing with that now
you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
downward now cut the loop at 100 mtr you have 100 mtr rope then move down
with the help of that. i hope i am clear.

On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C wrote:

> tie the rope to the peg and hold the rope at a little less than 100m point.
> Then jump.
>
>
> On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava <
> himanshusri...@gmail.com> wrote:
>
>> @Dave oh i thought some logical concept willl be applied in that
>> case...it is ok!!!
>> thanks:)
>>
>>
>> On Fri, Aug 5, 2011 at 1:47 AM, Dave  wrote:
>>
>>> @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
>>> of the tower. Then tie a sheepshank knot of a comfortable length in
>>> the rope and cut the middle strand inside the knot. Climb down the
>>> rope to the peg and tie the other end of the rope onto the peg. Then,
>>> while standing on or hanging from the peg, shake the upper rope to
>>> release the sheepshank knot. The upper end will fall down and you can
>>> climb the rest of the way down.
>>>
>>> Dave
>>>
>>>
>>> On Aug 4, 1:50 pm, Himanshu Srivastava 
>>> wrote:
>>> > suppose u tie the rope at 200mt height and now climb down to 100m
>>> > heightthen u tie the rope at that point then how will you open the
>>> rope
>>> > at point above 200mt where u have tied it earlier
>>> >
>>> >
>>> >
>>> > On Thu, Aug 4, 2011 at 11:15 PM, mohit verma 
>>> wrote:
>>> > > can't we tie the rope where we are standing (at height of 200 meter)?
>>> >
>>> > > On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe <
>>> > > neeraja.marath...@gmail.com> wrote:
>>> >
>>> > >> this was the puzzle asked to me in NVIDIA interview:
>>> > >> you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
>>> from
>>> > >> bottom of tower there is a peg where u can tie a rope. You have a
>>> rope
>>> > >> of length 150 mt. with you and using this rope you have to get down
>>> > >> the tower. you can not jump or there is nobody to help you. how will
>>> u
>>> > >> get down the tower??
>>> >
>>> > >> --
>>> > >> You received this message because you are subscribed to the Google
>>> Groups
>>> > >> "Algorithm Geeks" group.
>>> > >> To post to this group, send email to algogeeks@googlegroups.com.
>>> > >> To unsubscribe from this group, send email to
>>> > >> algogeeks+unsubscr...@googlegroups.com.
>>> > >> For more options, visit this group at
>>> > >>http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>> > > --
>>> > > 
>>> > > *MOHIT VERMA*
>>> >
>>> > >  --
>>> > > You received this message because you are subscribed to the Google
>>> Groups
>>> > > "Algorithm Geeks" group.
>>> > > To post to this group, send email to algogeeks@googlegroups.com.
>>> > > To unsubscribe from this group, send email to
>>> > > algogeeks+unsubscr...@googlegroups.com.
>>> > > For more options, visit this group at
>>> > >http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text -
>>> >
>>> > - Show quoted text -
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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,
> 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.
>



-- 
Varun Pahwa
B.Tech (IT)
7th Sem.
Indian Institute of Information Technology Allahabad.
Ph : 09793899112
Official Email :: rit2008...@iiita.ac.in
Another Email :: varunpahwa.ii...@gmail.com

People who fail to plan are those who plan to fail.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread siddharth srivastava
Its completely compiler dependent.
Actually it depends upon how the printf has been implemented.
Generally its a stack based implementation which will give you

4 5 5 5 5

as output.

It was interesting to see your output, have you executed it ? Which compiler
?

On 10 August 2011 19:05, Pratz mary  wrote:

> the evalution starts from right to left bt gets printed from left to right
>
>
> On 10 August 2011 16:14, Naveen Kumar  wrote:
>
>> AFAIK evalution order of parameters in c is compiler dependent.
>>
>> On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh
>>  wrote:
>> > the evaluation of parameters in printf() done from right to left.
>> >
>> > Thank you,
>> > Siddharam
>> >
>> >
>> > On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal <
>> experience...@gmail.com>
>> > wrote:
>> >>
>> >> can anybody explain how its printing
>> >>  4 5 5 4 5
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Algorithm Geeks" group.
>> >> To post to this group, send email to algogeeks@googlegroups.com.
>> >> To unsubscribe from 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.
>> >
>>
>>
>>
>> --
>> Cheers
>> Naveen Kumar
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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 Pratima :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Regards
Siddharth Srivastava

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



[algogeeks] Re: pls help

2011-08-10 Thread Dave
@Nikhil: There is no way to tell how many nodes the ternary tree has.
After all, a ternary tree with one leaf node can contain any number of
nodes.

Dave

On Aug 9, 1:37 pm, NIKHIL  wrote:
> In a ternary Tree No of leaves 28. How many nodes it have?
> An AVL tree with height d. How many children it have?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread Gaurav Menghani
I am just increasing the size of the current string by one. So that a
new character can be appended.

On Sat, Aug 6, 2011 at 11:01 AM, Tushar Bindal  wrote:
> @gaurav
> didn't get this:
> Just to increase the size of the string by one.
>
> Then you can put any character at the the new last position, which is 'l'.
>
> can u pls explain that?
>
> On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan 
> wrote:
>>
>> Ok, Thanks
>>
>> On Fri, Aug 5, 2011 at 2:53 PM, Gaurav Menghani
>>  wrote:
>>>
>>> Even if the number of elements is more than two, it is possible with
>>> bitwise operations, but it gets clumsy.
>>>
>>> Suppose your alphabet has 4 characters. You can either:
>>> - Count from 0 to (1<<4*n)-1 and use four bits to denote the selection
>>> of the alphabet. Also, only one bit amongst those four should be set.
>>> It is highly inefficient.
>>> - Keep n nested loops and inside each loop you iterate from 0 to
>>> (1<<4)-1 and use the standard bitwise operations. The con here is that
>>> you have to hardcode the number of nested loops.
>>>
>>> On Fri, Aug 5, 2011 at 2:44 PM, Nitin Nizhawan 
>>> wrote:
>>> > @Varun  I think it can be done using bits, if input character set has
>>> > only
>>> > two elements. Or could u plz explain?
>>> >
>>> > On Fri, Aug 5, 2011 at 2:29 PM, Varun Jakhoria
>>> > 
>>> > wrote:
>>> >>
>>> >> I think it can be done using bitwise ANDing with a mask
>>> >>
>>> >> On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
>>> >>  wrote:
>>> >> > An Implementation:
>>> >> >
>>> >> > #include
>>> >> > #include
>>> >> > using namespace std;
>>> >> >
>>> >> > string alphabet;
>>> >> > int maxlen;
>>> >> > void backtrack(string s,int l)
>>> >> > {
>>> >> >  if(l==maxlen) { cout<>> >> >  s.push_back('-');
>>> >> >  for(int i=0;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
>>> >> >  wrote:
>>> >> >> @gaurav:i could not understand ur sol.can u explain it again..
>>> >> >>
>>> >> >> On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani
>>> >> >> 
>>> >> >> wrote:
>>> >> >>>
>>> >> >>> On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
>>> >> >>>  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) { cout<>> >> >>>
>>> >> >>>   s.push_back('-');
>>> >> >>>   for(int i=0;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.
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Varun Jakhoria
>>> >> ...it's only about 0's & 1's
>>> >>
>>> >> --
>>> >> You received this message because you are s

Re: [algogeeks] Preprocessor Help !!

2011-08-10 Thread Abhishek Gupta
Answer 2) To prevent use of NULL with any other variable instead of 0(zero), 
it is set at void pointer.
 for ex, you cannot use in C like this, a=b+NULL;
but, i think, in C++ you can do.

-- 
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/-/JEkkEmJOYkkJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread Pratz mary
the evalution starts from right to left bt gets printed from left to right

On 10 August 2011 16:14, Naveen Kumar  wrote:

> AFAIK evalution order of parameters in c is compiler dependent.
>
> On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh
>  wrote:
> > the evaluation of parameters in printf() done from right to left.
> >
> > Thank you,
> > Siddharam
> >
> >
> > On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal <
> experience...@gmail.com>
> > wrote:
> >>
> >> can anybody explain how its printing
> >>  4 5 5 4 5
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Algorithm Geeks" group.
> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> To unsubscribe from 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.
> >
>
>
>
> --
> Cheers
> Naveen Kumar
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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 Pratima :)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread programming love
@sagar: Thanks again :) But my doubt is it'll have more than 28 leaf nodes
when the ques clearly sayd it shud have 28 leaf nodes.
@vamshi: I kind of agree with what you say.

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

but  total nodes will be
1+3+9+27+*2*(not 1)=42


On Wed, Aug 10, 2011 at 6:59 PM, Pratz mary  wrote:

> ya ur right!!!
>
>
> On 10 August 2011 18:44, vamshi vijay  wrote:
>
>> @Sagar
>>
>> See at level 4, 81 leaf  nodes are possible, since in question it has been
>> given 28 leaf  nodes, if i  use just 10 nodes from level 3 (27 nodes), i can
>> get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are
>> also becoming leaf nodes, but in question given as 28 leaf nodes..Plz
>> correct me.
>>
>> What i feel is we can have 2 cases
>>
>> 1) Minimum internal nodes posible
>>
>> If we can observe nodes pattern in each level
>>
>> 1
>> 3
>> 9
>> 27
>>
>> so in 4th level there are 27 leaf nodes, to get 28 leaf nodes, select one
>> from 27 nodes and add 2 childs, so total leaf nodes become (27-1)+2=28
>> In this case, internal nodes= 1+3+9+1=14
>>
>> 2) maximum internal nodes
>>
>> in the 4th level, add one child to each node, we get 27 leaf nodes in 5th
>> level  and similarly select 1nodes  in 5th level and add 2 childs to make
>> nodes 28, now we have interal nodes= 1+3+9+27+1=41
>>
>> Correct me if wrong...
>>
>> On 10 August 2011 05:19, sagar pareek  wrote:
>>
>>> Excatly
>>>
>>> why dont u just make a rough diagram in paper for binary and ternary
>>> trees
>>>
>>> and just see that each level has max of 2/3^i   where 2/3 is for
>>> binary/ternary tree and i is level where root level is 0...
>>>
>>> then make a complete ternary tree and see why leaves with 28 in numbers
>>> have internal nodes 40...
>>> just do it and then u will learn
>>>
>>>
>>> On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay <
>>> brijeshupadhyay...@gmail.com> wrote:
>>>
 It could have a maximum of 81 leaves with the same '40' no of internal
 nodes so for any value between 28 to 81, it would have only 40 internal
 nodes

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

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.
>>>
>>
>>
>>
>> --
>> With Regards,
>> N.Vamshi Vijay,
>> Mtech,CSE
>> IIT Kharagpur
>> Mobile:-07501541110
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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 Pratima :)
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] problem regarding output??

2011-08-10 Thread Arun Vishwanathan
@ankit: does that mean that after the compiler is informed that the void
pointer will point to integer witht he typecast statement and then we point
it to some other type , it will be an error?
i mean after that typecast statement, if i do
char a;
k=&a;is it wrng?

On Tue, Aug 9, 2011 at 2:06 PM, ankit sambyal wrote:

> The typecasting tells the compiler that the void pointer is now pointing to
> an integer and when we use this pointer to access the integer it takes value
> from 4 bytes. But when we try to increment that pointer, it will point to
> the next byte.  Try taking k as pointer to double instead of void, u will c
> the same result.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] pls help

2011-08-10 Thread Pratz mary
ya ur right!!!

On 10 August 2011 18:44, vamshi vijay  wrote:

> @Sagar
>
> See at level 4, 81 leaf  nodes are possible, since in question it has been
> given 28 leaf  nodes, if i  use just 10 nodes from level 3 (27 nodes), i can
> get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are
> also becoming leaf nodes, but in question given as 28 leaf nodes..Plz
> correct me.
>
> What i feel is we can have 2 cases
>
> 1) Minimum internal nodes posible
>
> If we can observe nodes pattern in each level
>
> 1
> 3
> 9
> 27
>
> so in 4th level there are 27 leaf nodes, to get 28 leaf nodes, select one
> from 27 nodes and add 2 childs, so total leaf nodes become (27-1)+2=28
> In this case, internal nodes= 1+3+9+1=14
>
> 2) maximum internal nodes
>
> in the 4th level, add one child to each node, we get 27 leaf nodes in 5th
> level  and similarly select 1nodes  in 5th level and add 2 childs to make
> nodes 28, now we have interal nodes= 1+3+9+27+1=41
>
> Correct me if wrong...
>
> On 10 August 2011 05:19, sagar pareek  wrote:
>
>> Excatly
>>
>> why dont u just make a rough diagram in paper for binary and ternary trees
>>
>> and just see that each level has max of 2/3^i   where 2/3 is for
>> binary/ternary tree and i is level where root level is 0...
>>
>> then make a complete ternary tree and see why leaves with 28 in numbers
>> have internal nodes 40...
>> just do it and then u will learn
>>
>>
>> On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay <
>> brijeshupadhyay...@gmail.com> wrote:
>>
>>> It could have a maximum of 81 leaves with the same '40' no of internal
>>> nodes so for any value between 28 to 81, it would have only 40 internal
>>> nodes
>>>
>>> --
>>> 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/-/hb7mifIIe1kJ.
>>>
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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.
>>
>
>
>
> --
> With Regards,
> N.Vamshi Vijay,
> Mtech,CSE
> IIT Kharagpur
> Mobile:-07501541110
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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 Pratima :)

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



Re: [algogeeks] C question

2011-08-10 Thread Karthikeyan palani
@ram got it. tanx :)

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

2011-08-10 Thread Amethy hobby
is it like a  number base problem? where a set of alpha is (0,1,2),
and the n is the lenght  of number
such as
(p,n) 3 >(0,1) of length 3
so the value is (000)(001)(010)...

On 8月10日, 下午9时19分, Amethy hobby  wrote:
> I thought the backtracking  is the method to solve this problem ,but
> it may not be the better one. who has the better one.
>
> On 8月5日, 下午3时02分, Gaurav Menghani  wrote:
>
>
>
>
>
>
>
> > On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
>
> >  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) { cout<
> >s.push_back('-');
> >for(int i=0;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.



Re: [algogeeks] STL sort

2011-08-10 Thread Amol Sharma
instead of struct you can use *pair* which will make the work
easier for you
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Wed, Aug 10, 2011 at 6:47 PM, Nitin Nizhawan wrote:

> bool operator()(point a, point b){
>return a.x  }
>
> remove references it should work. following is working code.
> #include
> #include
> #include
>
> using namespace std;
>
>
> typedef struct
> {
>  int x;
>  int y;
> }point;
>
> struct comp_x
> {
>  bool operator()(point a, point b){
>return a.x  }
> } compx;
>
> struct comp_y
> {
>  bool operator()(point a, point b){
>   return a.y  }
> } compy;
>
> int main()
> {
>  vector vc;
>  int n;
>  cin>>n;
>  point a;
>
>  for(int i=0;i  {
>   cin>>a.x;
>   cin>>a.y;
>   vc.push_back(a);
>  }
>  cout<
>  sort(vc.begin(), vc.end(), compx);
>  cout<<"By X\n";
>   for(int i=0;i  {
>   cout<  }
>  sort(vc.begin(), vc.end(), compy);
> cout<<"By Y\n";
> for(int i=0;i  {
>   cout<  }
>
>  return 0;
> }
>
>
> On Wed, Aug 10, 2011 at 6:31 PM, aanchal goyal 
> wrote:
>
>> sorry, comp is either comp_x or comp_y
>>
>>
>> On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan > > wrote:
>>
>>> what is "comp" in your code?
>>>
>>>
>>> On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal >> > wrote:
>>>
 I have a vector of stuct, how to sort this vector?
 problem is I can't overload the '<' operator in struct definition, as i
 want to sort by 'x' one time, and then by 'y'. I tried to write the
 comparator function separatley but its no working. How to do it?

 #include
 #include
 #include

 using namespace std;


 typedef struct
 {
  int x;
  int y;
 }point;

 struct comp_x
 {
  bool operator()(point &a, point &b)
   return a.x>>> }

 struct comp_y
 {
  bool operator()(point &a, point &b)
   return a.y>>> }

 int main()
 {
  vector vc;
  int n;
  cin>>n;
  point a;

  for(int i=0;i>>>  {
   cin>>a.x;
   cin>>a.y;
   vc.push_back(a);
  }
  cout<>>>  sort(vc.begin(), vc.end(), comp);

  for(int i=0;i>>>  {
   cout<>>>  }

  system("pause");
  return 0;
 }


 --
 Regards,*
 Aanchal Goyal*.

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



[algogeeks] Re: pls help

2011-08-10 Thread Amethy hobby
I thought the backtracking  is the method to solve this problem ,but
it may not be the better one. who has the better one.

On 8月5日, 下午3时02分, Gaurav Menghani  wrote:
> On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
>
>  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) { cout<
>s.push_back('-');
>for(int i=0;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.



Re: [algogeeks] STL sort

2011-08-10 Thread Nitin Nizhawan
bool operator()(point a, point b){
   return a.x
#include
#include

using namespace std;


typedef struct
{
 int x;
 int y;
}point;

struct comp_x
{
 bool operator()(point a, point b){
   return a.x vc;
 int n;
 cin>>n;
 point a;

 for(int i=0;i>a.x;
  cin>>a.y;
  vc.push_back(a);
 }
 cout sorry, comp is either comp_x or comp_y
>
>
> On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan 
> wrote:
>
>> what is "comp" in your code?
>>
>>
>> On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal 
>> wrote:
>>
>>> I have a vector of stuct, how to sort this vector?
>>> problem is I can't overload the '<' operator in struct definition, as i
>>> want to sort by 'x' one time, and then by 'y'. I tried to write the
>>> comparator function separatley but its no working. How to do it?
>>>
>>> #include
>>> #include
>>> #include
>>>
>>> using namespace std;
>>>
>>>
>>> typedef struct
>>> {
>>>  int x;
>>>  int y;
>>> }point;
>>>
>>> struct comp_x
>>> {
>>>  bool operator()(point &a, point &b)
>>>   return a.x>> }
>>>
>>> struct comp_y
>>> {
>>>  bool operator()(point &a, point &b)
>>>   return a.y>> }
>>>
>>> int main()
>>> {
>>>  vector vc;
>>>  int n;
>>>  cin>>n;
>>>  point a;
>>>
>>>  for(int i=0;i>>  {
>>>   cin>>a.x;
>>>   cin>>a.y;
>>>   vc.push_back(a);
>>>  }
>>>  cout<>>  sort(vc.begin(), vc.end(), comp);
>>>
>>>  for(int i=0;i>>  {
>>>   cout<>>  }
>>>
>>>  system("pause");
>>>  return 0;
>>> }
>>>
>>>
>>> --
>>> Regards,*
>>> Aanchal Goyal*.
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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,*
> Aanchal Goyal*.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] pls help

2011-08-10 Thread vamshi vijay
@Sagar

See at level 4, 81 leaf  nodes are possible, since in question it has been
given 28 leaf  nodes, if i  use just 10 nodes from level 3 (27 nodes), i can
get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are
also becoming leaf nodes, but in question given as 28 leaf nodes..Plz
correct me.

What i feel is we can have 2 cases

1) Minimum internal nodes posible

If we can observe nodes pattern in each level

1
3
9
27

so in 4th level there are 27 leaf nodes, to get 28 leaf nodes, select one
from 27 nodes and add 2 childs, so total leaf nodes become (27-1)+2=28
In this case, internal nodes= 1+3+9+1=14

2) maximum internal nodes

in the 4th level, add one child to each node, we get 27 leaf nodes in 5th
level  and similarly select 1nodes  in 5th level and add 2 childs to make
nodes 28, now we have interal nodes= 1+3+9+27+1=41

Correct me if wrong...

On 10 August 2011 05:19, sagar pareek  wrote:

> Excatly
>
> why dont u just make a rough diagram in paper for binary and ternary trees
>
> and just see that each level has max of 2/3^i   where 2/3 is for
> binary/ternary tree and i is level where root level is 0...
>
> then make a complete ternary tree and see why leaves with 28 in numbers
> have internal nodes 40...
> just do it and then u will learn
>
>
> On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay <
> brijeshupadhyay...@gmail.com> wrote:
>
>> It could have a maximum of 81 leaves with the same '40' no of internal
>> nodes so for any value between 28 to 81, it would have only 40 internal
>> nodes
>>
>> --
>> 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/-/hb7mifIIe1kJ.
>>
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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.
>



-- 
With Regards,
N.Vamshi Vijay,
Mtech,CSE
IIT Kharagpur
Mobile:-07501541110

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

2011-08-10 Thread aanchal goyal
got it.

On Wed, Aug 10, 2011 at 6:31 PM, aanchal goyal wrote:

> sorry, comp is either comp_x or comp_y
>
>
> On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan 
> wrote:
>
>> what is "comp" in your code?
>>
>>
>> On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal 
>> wrote:
>>
>>> I have a vector of stuct, how to sort this vector?
>>> problem is I can't overload the '<' operator in struct definition, as i
>>> want to sort by 'x' one time, and then by 'y'. I tried to write the
>>> comparator function separatley but its no working. How to do it?
>>>
>>> #include
>>> #include
>>> #include
>>>
>>> using namespace std;
>>>
>>>
>>> typedef struct
>>> {
>>>  int x;
>>>  int y;
>>> }point;
>>>
>>> struct comp_x
>>> {
>>>  bool operator()(point &a, point &b)
>>>   return a.x>> }
>>>
>>> struct comp_y
>>> {
>>>  bool operator()(point &a, point &b)
>>>   return a.y>> }
>>>
>>> int main()
>>> {
>>>  vector vc;
>>>  int n;
>>>  cin>>n;
>>>  point a;
>>>
>>>  for(int i=0;i>>  {
>>>   cin>>a.x;
>>>   cin>>a.y;
>>>   vc.push_back(a);
>>>  }
>>>  cout<>>  sort(vc.begin(), vc.end(), comp);
>>>
>>>  for(int i=0;i>>  {
>>>   cout<>>  }
>>>
>>>  system("pause");
>>>  return 0;
>>> }
>>>
>>>
>>> --
>>> Regards,*
>>> Aanchal Goyal*.
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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,*
> Aanchal Goyal*.
>
>


-- 
Regards,*
Aanchal Goyal*.

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

On 10 August 2011 18:32, Shashank Jain  wrote:

> what is the best book for aptitude questions?
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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 Pratima :)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread Shashank Jain
what is the best book for aptitude questions?

Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering

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

2011-08-10 Thread aanchal goyal
sorry, comp is either comp_x or comp_y

On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan wrote:

> what is "comp" in your code?
>
>
> On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal 
> wrote:
>
>> I have a vector of stuct, how to sort this vector?
>> problem is I can't overload the '<' operator in struct definition, as i
>> want to sort by 'x' one time, and then by 'y'. I tried to write the
>> comparator function separatley but its no working. How to do it?
>>
>> #include
>> #include
>> #include
>>
>> using namespace std;
>>
>>
>> typedef struct
>> {
>>  int x;
>>  int y;
>> }point;
>>
>> struct comp_x
>> {
>>  bool operator()(point &a, point &b)
>>   return a.x> }
>>
>> struct comp_y
>> {
>>  bool operator()(point &a, point &b)
>>   return a.y> }
>>
>> int main()
>> {
>>  vector vc;
>>  int n;
>>  cin>>n;
>>  point a;
>>
>>  for(int i=0;i>  {
>>   cin>>a.x;
>>   cin>>a.y;
>>   vc.push_back(a);
>>  }
>>  cout<>  sort(vc.begin(), vc.end(), comp);
>>
>>  for(int i=0;i>  {
>>   cout<>  }
>>
>>  system("pause");
>>  return 0;
>> }
>>
>>
>> --
>> Regards,*
>> Aanchal Goyal*.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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,*
Aanchal Goyal*.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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/processor dependencies of object file(C compiled file)

2011-08-10 Thread mithun bs
Hi,

I know that the compiled code of a C file(after assembler converts assembly
code to opcode) cannot be run on a different OS or it cannot be run on a
different processor architecture.

So, I need to know what are the machine dependencies which are added in
object file.

One thing is the opcode will be different for each processor architecture.
But how is it dependent on Operating system?


-- 
Mithun.B.S
M:9916775380

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

2011-08-10 Thread Nitin Nizhawan
what is "comp" in your code?


On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal wrote:

> I have a vector of stuct, how to sort this vector?
> problem is I can't overload the '<' operator in struct definition, as i
> want to sort by 'x' one time, and then by 'y'. I tried to write the
> comparator function separatley but its no working. How to do it?
>
> #include
> #include
> #include
>
> using namespace std;
>
>
> typedef struct
> {
>  int x;
>  int y;
> }point;
>
> struct comp_x
> {
>  bool operator()(point &a, point &b)
>   return a.x }
>
> struct comp_y
> {
>  bool operator()(point &a, point &b)
>   return a.y }
>
> int main()
> {
>  vector vc;
>  int n;
>  cin>>n;
>  point a;
>
>  for(int i=0;i  {
>   cin>>a.x;
>   cin>>a.y;
>   vc.push_back(a);
>  }
>  cout<  sort(vc.begin(), vc.end(), comp);
>
>  for(int i=0;i  {
>   cout<  }
>
>  system("pause");
>  return 0;
> }
>
>
> --
> Regards,*
> Aanchal Goyal*.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] MS question

2011-08-10 Thread keyan karthi
May be this way We dont display de title of a movie as a thumbnail
 So may be the first frame which has a wide distribution of
colours , assuring it has some other part of de clip other than de
title.. Ignore this if it sounds funny...!!

On 8/9/11, *$*  wrote:
> I guess , it can be done using indexing , with time stamp as key , and frame
> pointer as data ..
> Please correct me if I am wrong.
>
> On Tue, Aug 9, 2011 at 11:03 PM, Priyanshu  wrote:
>
>> Anyone??
>>
>> Regards,
>> Priyanshu Gupta
>>
>>
>> On Fri, Aug 5, 2011 at 6:09 PM, priyanshu wrote:
>>
>>> Give an efficient algorithm  to determine which part of the video
>>> should be displayed as a thumbnail??
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Thx,
> --Gopi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
Sent from my mobile device

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

2011-08-10 Thread aanchal goyal
I have a vector of stuct, how to sort this vector?
problem is I can't overload the '<' operator in struct definition, as i want
to sort by 'x' one time, and then by 'y'. I tried to write the comparator
function separatley but its no working. How to do it?

#include
#include
#include

using namespace std;


typedef struct
{
 int x;
 int y;
}point;

struct comp_x
{
 bool operator()(point &a, point &b)
  return a.x vc;
 int n;
 cin>>n;
 point a;

 for(int i=0;i>a.x;
  cin>>a.y;
  vc.push_back(a);
 }
 cout

Re: [algogeeks] pls help

2011-08-10 Thread sagar pareek
Excatly

why dont u just make a rough diagram in paper for binary and ternary trees

and just see that each level has max of 2/3^i   where 2/3 is for
binary/ternary tree and i is level where root level is 0...

then make a complete ternary tree and see why leaves with 28 in numbers have
internal nodes 40...
just do it and then u will learn

On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay <
brijeshupadhyay...@gmail.com> wrote:

> It could have a maximum of 81 leaves with the same '40' no of internal
> nodes so for any value between 28 to 81, it would have only 40 internal
> nodes
>
> --
> 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/-/hb7mifIIe1kJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread Brijesh Upadhyay
thank u , i couldnot  have answered this :P

-- 
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/-/Gppo1P-Gr9oJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread Brijesh Upadhyay
It could have a maximum of 81 leaves with the same '40' no of internal 
nodes so for any value between 28 to 81, it would have only 40 internal 
nodes

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

2011-08-10 Thread Arun Vishwanathan
@sandeep: so the statement becomes if(ch=0) since printf returns integer
0...whats does this mean now actually?0 is ascii for NULL and so ch is
assinged to null? I am slightly confused..

On Tue, Aug 9, 2011 at 7:04 PM, SANDEEP CHUGH wrote:

> @all sorry i give wrong explanation by mistake..:P :P
>
> printf("")  returns no if characters.. in this case returns 0 . which is
> assigned to ch
>
> so in ch 0 is stored and 0 is the ascii value of null character
> when we using ch in --- if (ch) --> it will reduce to if(0) -- as 0 is the
> ascii value of null character
>
> so the output "it doesn't matter"
>
>
> On Tue, Aug 9, 2011 at 10:28 PM, Dipankar Patro wrote:
>
>> o/p:
>> It doesn't matter
>>
>> Reason:
>> printf() returns the number of characters printed to screen.
>> since printf("") will return 0, hence the *else* is selected.
>>
>>
>> On 9 August 2011 22:25, siddharth srivastava  wrote:
>>
>>>
>>>
>>>  On 9 August 2011 22:20, tech rascal  wrote:
>>>
 #include
 int main()
 {
 char ch;
 if((ch=printf("")))
 printf("it matters");
 else
 printf("it doesn't matter");
 return 0;
 }


>>> It doesn't matter
>>>
>>>
>>>

 what will b the output??

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

>>>
>>>
>>>
>>> --
>>> Regards
>>> Siddharth Srivastava
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>>
>> ___
>>
>> 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.
>>
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks]

2011-08-10 Thread Naveen Kumar
AFAIK evalution order of parameters in c is compiler dependent.

On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh
 wrote:
> the evaluation of parameters in printf() done from right to left.
>
> Thank you,
> Siddharam
>
>
> On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal 
> wrote:
>>
>> can anybody explain how its printing
>>  4 5 5 4 5
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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.
>



-- 
Cheers
Naveen Kumar

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

2011-08-10 Thread Arun Vishwanathan
@jiten: that staement means pa is a pointer to 3 ints not an array of
pointers.. int *pa[3] means it is an array of pointers



On Fri, Aug 5, 2011 at 8:44 PM, Jiten  wrote:

> (*pa)[3] ;// pa is array of pointers to int type;
> so pa = arr;  doesn't make any sense ,bcoz arr represents the base address
> of it(address of arr[0]).
> and pa represent
> the address of pa[0](which hold a pointer).
>
> I hope it's clear now
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks]

2011-08-10 Thread siddharam suresh
the evaluation of parameters in printf() done from right to left.


Thank you,
Siddharam


On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal
wrote:

> can anybody explain how its printing
>  4 5 5 4 5
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] c question!

2011-08-10 Thread Arun Vishwanathan
@siddarth:

should not the statement you mentioned above as
nodeptr h = (nodeptr*)malloc(sizeof(nodeptr*));

be
nodeptr h =(struct*)malloc(sizeof(struct)); ??

cos malloc returns pointer to memory block and nodeptr itself is a pointer
and you have used nodeptr* further?



On Tue, Aug 9, 2011 at 6:32 PM, siddharth srivastava wrote:

>  @sidharth: thanks a lot for correcting me :)
>> @aditya : no. there was some mistake;
>>
>> in the code i pasted above it's giving segmentation fault. Is it cause i'm
>> initializing h without using malloc??
>> Please throw light on this problem
>>
>
> Pointer points to a location in memory. You can't use h without making h to
> reference to some area in memory.
>
>
>
>> And in the following code
>> char *s;
>> scanf("%s", s);
>> why isn't it possible to store a string in s??
>>
>> Please explain both concepts.
>>
>> --
>>  You received this message because you are subscribed to the Google
>> Groups "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Siddharth Srivastava
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks]

2011-08-10 Thread Anubhav Aggarwal
can anybody explain how its printing
 4 5 5 4 5

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread siddharam suresh
depends on the compiler to compiler
Thank you,
Siddharam


On Wed, Aug 10, 2011 at 3:53 PM, Rajeshwar Patra
wrote:

> can someone predict the output  and give an explanation
>
> main()
> {
> int i=5;
> printf("%d %d %d %d %d",i++,i--,++i,--i,i);
> }
>
> --
> *Rajeshwar Patra,*
> *MCA final year,*
> *Nit Durgapur*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



[algogeeks]

2011-08-10 Thread Rajeshwar Patra
can someone predict the output  and give an explanation

main()
{
int i=5;
printf("%d %d %d %d %d",i++,i--,++i,--i,i);
}

-- 
*Rajeshwar Patra,*
*MCA final year,*
*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.



Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread Mohit Goel
@muthu raj:
it will also come out ,when loop condition will not be statisfied.i.e when
'p' is not the right child of its parent...in such a case it will not reach
root ..
in the ex given by u   it will stop at 4 .

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-10 Thread programming love
@sagar and @brijesh: awesome explanation!!! too good! 1 doubt!

the question says it has only 28 leaves. According to uour explanations, it
has 81 leaves. how is it possible??

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

2011-08-10 Thread Aditya Virmani
is it 100 men & 100 women?

On Wed, Aug 10, 2011 at 3:25 PM, programming love <
love.for.programm...@gmail.com> wrote:

> is it 101/200??
>
>
> On Wed, Aug 10, 2011 at 3:41 AM, Prakash D  wrote:
>
>> is there anything like there should be atleast one man and one women
>> should dance together?
>>
>>
>> On Wed, Aug 10, 2011 at 2:26 AM, Shuaib Khan wrote:
>>
>>>
>>>
>>> On Wed, Aug 10, 2011 at 1:45 AM, Brijesh Upadhyay <
>>> brijeshupadhyay...@gmail.com> wrote:
>>>
 No thers is not.. someone has asked me this., dont know anything else
 about the question  :|
>>>
>>>
>>> Seems like you got half of the question there.
>>>
>>>
  --
 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/-/mqMvDgb6TqUJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

>>>
>>>
>>>
>>> --
>>> Shuaib
>>> http://www.bytehood.com
>>> http://twitter.com/ShuaibKhan
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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.



Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread muthu raj
Tell me if this Pseudo code Works.

Initial conditions tp be checked are:

node * leftmostRightCousin(node *root,node *p)
{
if(root==p || root->left==p || root->right==p)  // in dis
case der cant be any cousins for any node at first level.
return NULL;

  while(root)
{
 //   perform level order traversal the tree and at each
level check if the node *p exists at each level.
// If it exists then check all sucessive nodes in that level
after node *p are having same parent as node *p.
  // If same parent dey r brothers.proceed to next node at same
leve.
  // continue dis until u find a node in dat level in which p is
present and u get a node which does nt have same parent as that of p. that
is the leftmost right cousin of p.

}

}

correct me if i am wrong :)


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



On Wed, Aug 10, 2011 at 3:28 PM, muthu raj  wrote:

> @Mohit : in ur code u are breaking out when there parent reaches root. But
> not every time will we have to reach root. For example:  Leftmost right
> cousin of 1 is 9...in dat case parent should stop at 4. which is not the
> root.
>
> *Muthuraj R
> IV th Year , ISE
> PESIT , Bangalore*
>
>
>
> On Wed, Aug 10, 2011 at 3:26 PM, muthu raj  wrote:
>
>> @coder dumca: If u apply DFS  u will get a brother and not cousin. And yes
>> it works only for some cases.
>>
>> *Muthuraj R
>> IV th Year , ISE
>> PESIT , Bangalore*
>>
>>
>>
>> On Wed, Aug 10, 2011 at 2:24 PM, coder dumca wrote:
>>
>>> apply BFS
>>> the node after the particular node(whode cousin to be find) will be the
>>> required node
>>>
>>> On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla <
>>> puneetchawla...@gmail.com> wrote:
>>>

 Agree with mohit goel..

 On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel >>> > wrote:

>10
>  4  5
>2  7  6 11
>1 39   8 12  13   14   15
>
>
> i think we should first  find the parent of the particular node ..then
> apply the concept as told by Brijesh on it 
>
> p =parent(q);
> r = parent(p);
> count =1;
> while(p ==isright(r))
> {
> p=r;
> r=parent(r);
> count++;
> if(r==root)
> break;
>
> }
>
> if(d =right(r))
> {
> while(count!=0)
> {
> if(d->left)
> d=d->left;
> else d=d->right;
> count--;
> }
> }
> else return NULL;
> o/p=d->value;
>
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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
   
 Puneet Chawla
 Computer Engineering Student
 NIT Kurukshetra

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



Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread muthu raj
@Mohit : in ur code u are breaking out when there parent reaches root. But
not every time will we have to reach root. For example:  Leftmost right
cousin of 1 is 9...in dat case parent should stop at 4. which is not the
root.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*



On Wed, Aug 10, 2011 at 3:26 PM, muthu raj  wrote:

> @coder dumca: If u apply DFS  u will get a brother and not cousin. And yes
> it works only for some cases.
>
> *Muthuraj R
> IV th Year , ISE
> PESIT , Bangalore*
>
>
>
> On Wed, Aug 10, 2011 at 2:24 PM, coder dumca wrote:
>
>> apply BFS
>> the node after the particular node(whode cousin to be find) will be the
>> required node
>>
>> On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla > > wrote:
>>
>>>
>>> Agree with mohit goel..
>>>
>>> On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel 
>>> wrote:
>>>
10
  4  5
2  7  6 11
1 39   8 12  13   14   15


 i think we should first  find the parent of the particular node ..then
 apply the concept as told by Brijesh on it 

 p =parent(q);
 r = parent(p);
 count =1;
 while(p ==isright(r))
 {
 p=r;
 r=parent(r);
 count++;
 if(r==root)
 break;

 }

 if(d =right(r))
 {
 while(count!=0)
 {
 if(d->left)
 d=d->left;
 else d=d->right;
 count--;
 }
 }
 else return NULL;
 o/p=d->value;



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



Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread muthu raj
@coder dumca: If u apply DFS  u will get a brother and not cousin. And yes
it works only for some cases.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*



On Wed, Aug 10, 2011 at 2:24 PM, coder dumca  wrote:

> apply BFS
> the node after the particular node(whode cousin to be find) will be the
> required node
>
> On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla 
> wrote:
>
>>
>> Agree with mohit goel..
>>
>> On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel 
>> wrote:
>>
>>>10
>>>  4  5
>>>2  7  6 11
>>>1 39   8 12  13   14   15
>>>
>>>
>>> i think we should first  find the parent of the particular node ..then
>>> apply the concept as told by Brijesh on it 
>>>
>>> p =parent(q);
>>> r = parent(p);
>>> count =1;
>>> while(p ==isright(r))
>>> {
>>> p=r;
>>> r=parent(r);
>>> count++;
>>> if(r==root)
>>> break;
>>>
>>> }
>>>
>>> if(d =right(r))
>>> {
>>> while(count!=0)
>>> {
>>> if(d->left)
>>> d=d->left;
>>> else d=d->right;
>>> count--;
>>> }
>>> }
>>> else return NULL;
>>> o/p=d->value;
>>>
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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
>>   
>> Puneet Chawla
>> Computer Engineering Student
>> NIT Kurukshetra
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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.



Re: [algogeeks] Probability question.. help

2011-08-10 Thread programming love
is it 101/200??

On Wed, Aug 10, 2011 at 3:41 AM, Prakash D  wrote:

> is there anything like there should be atleast one man and one women should
> dance together?
>
>
> On Wed, Aug 10, 2011 at 2:26 AM, Shuaib Khan wrote:
>
>>
>>
>> On Wed, Aug 10, 2011 at 1:45 AM, Brijesh Upadhyay <
>> brijeshupadhyay...@gmail.com> wrote:
>>
>>> No thers is not.. someone has asked me this., dont know anything else
>>> about the question  :|
>>
>>
>> Seems like you got half of the question there.
>>
>>
>>>  --
>>> 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/-/mqMvDgb6TqUJ.
>>>
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Shuaib
>> http://www.bytehood.com
>> http://twitter.com/ShuaibKhan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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.



[algogeeks] Re: Tejas networks and MAQ

2011-08-10 Thread sagar pareek
Please anyone

On Wed, Aug 10, 2011 at 2:19 PM, sagar pareek  wrote:

>
> Hi
> if anyone recently faced written or interview of those companies then pls
> discuss here
>
> Thanks in advance
> --
> **Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>


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

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



[algogeeks] Re: need the book google resume and algorithms for interviews

2011-08-10 Thread jonee
please share "algorithm for interviews" book as the link mentioned in
algogeeks post does not work anymore.

On Jul 26, 3:34 pm, coder dumca  wrote:
> @ Raghvendra  thanks dude
>
> On Mon, Jul 25, 2011 at 7:20 PM, raghavendhra rahul <
>
>
>
>
>
>
>
> rahulraghavend...@gmail.com> wrote:
>
> > hi ,
>
> > i think this s the link for algorithm for interviews ebook
>
> >http://code.google.com/p/interview/downloads/detail?name=Algorithms%2...
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from 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.



  1   2   >