[algogeeks] MCI

2011-12-22 Thread aditi garg
Has anyone appeared fr Microsoft sales and marketing interview...if so
plz throw some light on it...

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-09-06 Thread aditi garg
It is basically comparing the addresses  of the two and since p contains the
memory address of "persons" it gives the output as technical persons...
infact ull be surprised to see dis

#include
main(){char p[]="persons";char q[]="persons";if(p==q)printf
<http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("technical
%s",p);elseprintf
<http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("true
%s",p);return 0;}

output : true persons


#include
main(){char *p="persons";char *q="persons";if(p==q)printf
<http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("technical
%s",p);elseprintf
<http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("true
%s",p);return 0;

}
bt Here output will be Technical persons
On Tue, Sep 6, 2011 at 9:04 PM, sivaviknesh s wrote:

>
> main()
> {
> char *p="persons";
> clrscr();
> if(p=="persons")
> printf("technical %s",p);
> else
> printf("true %s",p);
> return 0;
> }
>
> ..op : technical persons ..plz explain .. how come it works like an strcmp
> operation???
> --
> Regards,
> $iva
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] C output

2011-08-31 Thread aditi garg
8 3

On Wed, Aug 31, 2011 at 9:22 PM, rohit  wrote:

> output??
>
> int main()
> {
> char *d = "abc\0def\0";
> printf("%d %d",sizeof(d),strlen(d));
> getch();
> }
>
> --
> 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/-/nf_M_Yoep_EJ.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] C output

2011-08-31 Thread aditi garg
@dheeraj yea true,,,bt ut ws an array...its a pointer here...so output will
be 4  3...
infact it wud be 9 3 in the case u r considering

On Wed, Aug 31, 2011 at 9:32 PM, Dheeraj Sharma  wrote:

> 8 3 is correct..winshuttle mein aaya tha ;)
>
>
> On Wed, Aug 31, 2011 at 9:30 PM, aditi garg wrote:
>
>> No sizeof ignores \0
>>
>>
>> On Wed, Aug 31, 2011 at 9:27 PM, SANDEEP CHUGH 
>> wrote:
>>
>>> its 4 3   i think
>>>
>>>
>>> On Wed, Aug 31, 2011 at 9:25 PM, aditi garg 
>>> wrote:
>>>
>>>> 8 3
>>>>
>>>>
>>>> On Wed, Aug 31, 2011 at 9:22 PM, rohit  wrote:
>>>>
>>>>> output??
>>>>>
>>>>> int main()
>>>>> {
>>>>> char *d = "abc\0def\0";
>>>>> printf("%d %d",sizeof(d),strlen(d));
>>>>> getch();
>>>>> }
>>>>>
>>>>> --
>>>>> 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/-/nf_M_Yoep_EJ.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Aditi Garg
>>>> Undergraduate Student
>>>> Electronics & Communication Divison
>>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>>> Sector 3, Dwarka
>>>> New Delhi
>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> *Dheeraj Sharma*
> Comp Engg.
> NIT Kurukshetra
> +91 8950264227
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] C output

2011-08-31 Thread aditi garg
sorry my mistake...
it wud be 4 3

On Wed, Aug 31, 2011 at 9:30 PM, sachin goyal  wrote:

> 2 3 because d is pointer avriable
>
> On Wed, Aug 31, 2011 at 9:25 PM, aditi garg wrote:
>
>> 8 3
>>
>>
>> On Wed, Aug 31, 2011 at 9:22 PM, rohit  wrote:
>>
>>> output??
>>>
>>> int main()
>>> {
>>> char *d = "abc\0def\0";
>>> printf("%d %d",sizeof(d),strlen(d));
>>> getch();
>>> }
>>>
>>> --
>>> 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/-/nf_M_Yoep_EJ.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] C output

2011-08-31 Thread aditi garg
No sizeof ignores \0

On Wed, Aug 31, 2011 at 9:27 PM, SANDEEP CHUGH wrote:

> its 4 3   i think
>
>
> On Wed, Aug 31, 2011 at 9:25 PM, aditi garg wrote:
>
>> 8 3
>>
>>
>> On Wed, Aug 31, 2011 at 9:22 PM, rohit  wrote:
>>
>>> output??
>>>
>>> int main()
>>> {
>>> char *d = "abc\0def\0";
>>> printf("%d %d",sizeof(d),strlen(d));
>>> getch();
>>> }
>>>
>>> --
>>> 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/-/nf_M_Yoep_EJ.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Re: Static variable

2011-08-31 Thread aditi garg
@ rohit y does it stop at -8 then?


On Wed, Aug 31, 2011 at 8:37 PM, rohit  wrote:

> while(--i > 0) //suppose i = 1 here, so --i becomes 0, hence the condition
> fails...so it will go 1 step back in recursion
> {
> main();
> printf("%d",i);
> }
>
> it will execute
>
> printf("%d",i) of prev recursion where i=0 now, so 0 gets printed...now
> again the condition is checked i=0, thrfore --i becomes -1, so condition
> fails
>
> it now executes printf("%d",i) of still prev recursion and i=-1
> herethis continues...
> I hope this clarifies
>
>  --
> 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/-/bAkVsFcLH_oJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: Static variable

2011-08-31 Thread aditi garg
@abhishek: y till -8?

On Wed, Aug 31, 2011 at 7:50 PM, vishal jain  wrote:

> I executed on linux machine..
>
> I am gettign output
>
> 0-1-2-3-4-5-6-7-8 :(
>
> for code
> int main()
>
> {
> static int i=10;
> while(--i>0)
> {
>  main();
>  printf("%d",i);
> }
> return 0;
> }
>
>
> On Wed, Aug 31, 2011 at 7:48 PM, Abhishek Mallick <
> abhishek.mallick2...@gmail.com> wrote:
>
>> The recursion will run 10 times printing nothing. Then ones it returns
>> on the 10th one. It will start printing from 0 to -8 (As i is static).
>>
>> On Aug 31, 6:33 pm, ravi maggon  wrote:
>> > Ans would be 00, keep in mind that i is static variable.
>> >
>>  > On Wed, Aug 31, 2011 at 6:59 PM, rohit  wrote:
>> > > 123456789
>> >
>> > > --
>> > > 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/-/OsL6-Vp91qoJ.
>> > > To post to this group, send email to algogeeks@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > algogeeks+unsubscr...@googlegroups.com.
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/algogeeks?hl=en.
>> >
>> > --
>> >
>> > Regards
>> > Ravi Maggon
>> > Final Year, B.E. CSE
>> > Thapar University
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Re: APTITUDE QUESTIONS

2011-08-31 Thread aditi garg
For the third ques the method is...
1. Calculate the no .of zeros whch come out to be 15...
2.thn remove all the 5's and 15 2's from 67!
3.thn multiply the unit digit of the rest of the numbers!!!
ull get 2



On Wed, Aug 31, 2011 at 12:21 PM, Siddhartha Banerjee <
thefourrup...@gmail.com> wrote:

> i couldnt get the first question... for any perfect cube... the cube root
> is an integer, in any base... for example, the cube roots of 1,8,27,81,125,
> etc... will be integers in base 10, and integers in base 10 are integers in
> any other base... so am i missing something here???
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: APTITUDE QUESTIONS

2011-08-30 Thread aditi garg
For ques 3,the ans shud be 2...but its not thr in the options...

On Wed, Aug 31, 2011 at 2:14 AM, icy`  wrote:

> For the third one by hand, I was just trying to keep track of 1-2 of
> the first digits for each section.
>
> I broke into sections as follows  (^ to mean power here):
>
> 9! = (I just did this by hand, 1728x210=362880) ,  so we take  36.
> 10! to 19! =  approx 1^10 = 1
> 20! to 29! = approx 2^10 = 1024 = 10
> 30! to 39! = approx 3^10 =  3, 6, 9, 27, 81, 243, 72.., 216.., 63...,
> 189..  =  1
> 40! to 49! = 4^10 = 4, 16, 64, 25.., 10.., 4..  = this looked like a
> pattern, the tenth one should be 1.. again   = 1
> 50! to 59! = 5^10 = 5, 25, 125, 60.. , 30.., 150.., 75..,  37.., 18..,
> 90  =  9
> 60! to 67! = 6^8 = 6, 36, 216, 126.. , 72..., 43.., 25..,  15..  = 1
>
> so actually to correct what I had above, I was really looking to do
> 9*36  , (not 9*3=27), which gives  about 324,  or 3 for the first
> digit.  This is just an approximation but it seems to work.
>
> On Aug 30, 4:06 pm, kartik sachan  wrote:
> > for 1st question ans will be a,b,e as (125)^1/3 is 5 sum is 8
> > for 2nd question we see pattern in 7 power i.e 7,9,3,1 and this pattern
> > reapeats for inerval of 4
> > and second term of of any power of 7>=2 is 4
> > so diff is 5
> > ans will be 5
> >
> > how to find the ans of third question??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


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



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

2011-08-27 Thread aditi garg
This grp is full of MS interview ques..search the archives...

On Sat, Aug 27, 2011 at 6:55 PM, teja bala wrote:

>
>
> if any one aware of microsoft written test please give me the suggestions
> and respective links
> thx.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] reverse

2011-08-24 Thread aditi garg
though im very unsure abt this,but how abt converting the number to BCD and
then normal swapping of the two nibbles?? Bt i guess this would work only
for 2 digit numbers...

On Wed, Aug 24, 2011 at 8:20 PM, aditya kumar
wrote:

> does anyone know the correct solution this problem ??
> problem : i/p :: 39
> o/p:: 93 (using bitwise operator)
>
>
> On Fri, Aug 12, 2011 at 1:41 PM, Prakash D  wrote:
>
>> how does the above code work?
>>
>>
>> On Fri, Aug 12, 2011 at 1:14 PM, Rahul  wrote:
>>
>>> I understand. where I find some more tricks like these , I mean I
>>> really. find. bit thinking hacks. difficult to understand.
>>>
>>>
>>> On 8/12/11, Tarun Arya  wrote:
>>> > RAHUL@
>>> > d question was to reverse d 2 numbers...it can b done by wat i hav
>>> said...
>>> > if u want 2 extract numbers then
>>> > a&0x0f   //this wil giv number in units place...
>>> > a&0xf0   a>>4//this wil give number in tens place
>>> >
>>> > correct me if i m wrong
>>> > Tarun
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Algorithm Geeks" group.
>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>> >
>>>
>>>
>>> --
>>> Rahul
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks]

2011-08-23 Thread aditi garg
i wud suggest u to write one urself...ill help u improve it...u already have
the logic now...

On Tue, Aug 23, 2011 at 11:43 PM, aayush jain  wrote:

> thanx aditi 
> n can u know  code of alternate delete in even or odd places 
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks]

2011-08-23 Thread aditi garg
p=head;
q=head->next; count=0;
 while(p!=NULL && q!=NULL)
 { if(p==q)
  { //Loop detected! exit(0); }
  p=p->next; count ++;
  q=(q->next)?(q->next->next):q->next;
  }

On Tue, Aug 23, 2011 at 11:35 PM, aayush jain  wrote:

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



Re: [algogeeks]

2011-08-23 Thread aditi garg
oh well u can keep a variable count and increment it wid p...u can get the
position dat way...
Does dis help?

On Tue, Aug 23, 2011 at 11:30 PM, aayush jain  wrote:

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



Re: [algogeeks]

2011-08-23 Thread aditi garg
for loop...
take two pointers p and q,increment p by 1 and q by two nodes till neither
of dem is null...if at any instance dey point to the same value thn loop
exists owise not...
I hope im clear

On Tue, Aug 23, 2011 at 11:11 PM, aayush jain  wrote:

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



Re: [algogeeks] Concept of Pointer

2011-08-22 Thread aditi garg
in frst printf we acess *s and s is incremented later...so it prints A bt at
the same time s points to B now...
In 2nd printf s is incremented frst and thn dereferencd...after incrementing
it points to C and whn we dereference it we get C
in the third printf *s=C whn we increment this we get D
so the ans wud be ACD...
I hope its  clear

On Mon, Aug 22, 2011 at 4:03 PM, MANNU  wrote:

> main()
> {
> char ch[]="ABCD";
> char *s;
> s=ch;
> printf("%c",*s++);
> printf("%c",*++s);
> printf("%c",++*s);
> }
>
> Can anyone plz tell me the concept behind 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.
>



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



Re: [algogeeks] Re: Process memory Layout

2011-08-22 Thread aditi garg
@ kumar
if we hav
 char *p="hello world";
p[5]= 'a';
it generates only run time error and not compile time error

On Mon, Aug 22, 2011 at 10:47 AM, kumar raja wrote:

> What i am saying is
>
> if i write it like
> p[5]= 'a';
>
> Then the compiler will raise an error . Because the memory where the string
> constant "Hello world" gets stored is read only.
>
> But it i do it like
>
> char s[] = "hello world",*p;
>
> p=s;
>
> p[5]='a';
>
> It is valid becoz the string is now stored in stack segment of program .
>
> So my doubt is where the string constant gets stored exactly in the first
> case...and why it cant be altered..
>
>
> On 21 August 2011 22:06, Sanjay Rajpal  wrote:
>
>> You can change the pointer only, not the content.
>>
>> But in case of static int, u can also change the value also. if u specify
>> const, u can't change the value then.
>>
>>
>> Sanju
>> :)
>>
>>
>>
>> On Sun, Aug 21, 2011 at 9:56 PM, Dave  wrote:
>>
>>> @Kumar: You've declared a pointer, and you can change the pointer,
>>> just as in int i=10 declares an integer that you can change.
>>>
>>> Dave
>>>
>>> On Aug 21, 11:28 pm, kumar raja  wrote:
>>> > char *p= "hello world";
>>> >
>>> > When we try to modify the  above string it will raise an error. I heard
>>> that
>>> > the String constant is stored in the Data segment of the process . The
>>> data
>>> > segment consists of two parts .
>>> > 1)Initialized data segment
>>> > 2)Uninitialized data segment
>>> >
>>> > If we use some other global variable in the same program  say static
>>> int
>>> > i=10;
>>> >
>>> > But it could be modified at later.So why not the string constant cant
>>> be
>>> > modified??? Someone said that it is stored in Text/Code segment . I
>>> think
>>> > thats wrong . the Text segment is only a set of machine instructions to
>>> > execute the program ,but does not contain  any  data  values.
>>> >
>>> > So, Where the above String constant is stored and why it cant be
>>> altered???
>>> >
>>> > --
>>> > Regards
>>> > Kumar Raja
>>> > M.Tech(SIT)
>>> > IIT Kharagpur,
>>> > 10it60...@iitkgp.ac.in
>>>  > 7797137043.
>>> > 09491690115.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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
> Kumar Raja
> M.Tech(SIT)
> IIT Kharagpur,
> 10it60...@iitkgp.ac.in
> 7797137043.
> 09491690115.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: C dot

2011-08-20 Thread aditi garg
Thnks:)

On Sat, Aug 20, 2011 at 1:00 AM, sachin sabbarwal
wrote:

> they ask very easy questions in interviews.
> i had faced their interview.
> first of all they asked me if i had done any project work.
> then they asked about the platform used and why i had chosen it.
> then few easy questions about algo of the project.
>
> they questioned me on bubble sort.
> then i was asked to write a program to reverse the words of a string.
> for example "hi how r u"
> reversed-> "u r how hi"
>
> some other questions they asked some of my friends were
> ->how to declare an integer pointer.
> ->what is .net.
> ->what are features of opp(object oriented prog).
>
> On Aug 19, 6:56 pm, aditi garg  wrote:
> > Do u knw wat type of ques asked in interviews?
> > Plz post a few as example if u knw...please...
> > On Fri, Aug 19, 2011 at 7:25 PM, aditi garg  >wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > k thanx :)
> >
> > > On Fri, Aug 19, 2011 at 7:19 PM, Sanjay Rajpal <
> tosanjayraj...@gmail.com>wrote:
> >
> > >> In our college, students were shortlisted on the basis of GPA.Then
> Direct
> > >> interview was conducted.
> >
> > >> *Regards
> >
> > >> Sanju
> >
> > >> Happy to Help :)*
> >
> > >> On Fri, Aug 19, 2011 at 6:44 AM, aditi garg <
> aditi.garg.6...@gmail.com>wrote:
> >
> > >>> Does anyone know the placement procedure of C Dot?
> >
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> Groups
> > >>> "Algorithm Geeks" group.
> > >>> To post to this group, send email to algogeeks@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > >>> algogeeks+unsubscr...@googlegroups.com.
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/algogeeks?hl=en.
> >
> > >>  --
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "Algorithm Geeks" group.
> > >> To post to this group, send email to algogeeks@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> algogeeks+unsubscr...@googlegroups.com.
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/algogeeks?hl=en.
> >
> > > --
> > > Aditi Garg
> > > Undergraduate Student
> > > Electronics & Communication Divison
> > > NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
> > > Sector 3, Dwarka
> > > New Delhi
> >
> > --
> > Aditi Garg
> > Undergraduate Student
> > Electronics & Communication Divison
> > NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
> > Sector 3, Dwarka
> > New Delhi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


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



Re: [algogeeks] C dot

2011-08-19 Thread aditi garg
@kamakshi: kritika ko info chahiye thi :)

On Fri, Aug 19, 2011 at 7:40 PM, Kamakshii Aggarwal
wrote:

> @aditi: ab c-dot ka kya karna hai tujhe?:P
>
> On Fri, Aug 19, 2011 at 7:26 PM, aditi garg wrote:
>
>> Do u knw wat type of ques asked in interviews?
>> Plz post a few as example if u knw...please...
>>
>> On Fri, Aug 19, 2011 at 7:25 PM, aditi garg wrote:
>>
>>> k thanx :)
>>>
>>>
>>> On Fri, Aug 19, 2011 at 7:19 PM, Sanjay Rajpal >> > wrote:
>>>
>>>> In our college, students were shortlisted on the basis of GPA.Then
>>>> Direct interview was conducted.
>>>>
>>>> *Regards
>>>>
>>>> Sanju
>>>>
>>>> Happy to Help :)*
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Aug 19, 2011 at 6:44 AM, aditi garg 
>>>> wrote:
>>>>
>>>>> Does anyone know the placement procedure of C Dot?
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> Aditi Garg
>>> Undergraduate Student
>>> Electronics & Communication Divison
>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>> Sector 3, Dwarka
>>> New Delhi
>>>
>>>
>>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] C dot

2011-08-19 Thread aditi garg
Do u knw wat type of ques asked in interviews?
Plz post a few as example if u knw...please...
On Fri, Aug 19, 2011 at 7:25 PM, aditi garg wrote:

> k thanx :)
>
>
> On Fri, Aug 19, 2011 at 7:19 PM, Sanjay Rajpal 
> wrote:
>
>> In our college, students were shortlisted on the basis of GPA.Then Direct
>> interview was conducted.
>>
>> *Regards
>>
>> Sanju
>>
>> Happy to Help :)*
>>
>>
>>
>>
>> On Fri, Aug 19, 2011 at 6:44 AM, aditi garg wrote:
>>
>>> Does anyone know the placement procedure of C Dot?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Aditi Garg
> Undergraduate Student
> Electronics & Communication Divison
> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
> Sector 3, Dwarka
> New Delhi
>
>
>


-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] C dot

2011-08-19 Thread aditi garg
k thanx :)

On Fri, Aug 19, 2011 at 7:19 PM, Sanjay Rajpal wrote:

> In our college, students were shortlisted on the basis of GPA.Then Direct
> interview was conducted.
>
> *Regards
>
> Sanju
>
> Happy to Help :)*
>
>
>
>
> On Fri, Aug 19, 2011 at 6:44 AM, aditi garg wrote:
>
>> Does anyone know the placement procedure of C Dot?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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

2011-08-19 Thread aditi garg
Does anyone know the placement procedure of C Dot?

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



Re: [algogeeks] Re: Urgent...plz help

2011-08-17 Thread aditi garg
@ dave : i hv one doubt,we wud be maintaining a max or a min heap??

On Thu, Aug 18, 2011 at 9:11 AM, aditi garg wrote:

> thank u so much dave :)
>
>
> On Thu, Aug 18, 2011 at 8:44 AM, Dave  wrote:
>
>> @Aditi: Form a max-heap of the first 100 numbers. Then as you read the
>> remaining numbers, if a number is less than the root of the max-heap,
>> replace the root with it and restore the heap condition. When you
>> reach the end of the million numbers, the heap will contain the
>> smallest 100 numbers.
>>
>> If there are n numbers and you want the smallest k, this algorithm is
>> O(n log k).
>>
>> Dave
>>
>> On Aug 17, 10:05 pm, aditi garg  wrote:
>> > How to find the set of smallest 100 numbers out of 1 million numbers...
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Aditi Garg
> Undergraduate Student
> Electronics & Communication Divison
> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
> Sector 3, Dwarka
> New Delhi
>
>
>


-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Re: Urgent...plz help

2011-08-17 Thread aditi garg
thank u so much dave :)

On Thu, Aug 18, 2011 at 8:44 AM, Dave  wrote:

> @Aditi: Form a max-heap of the first 100 numbers. Then as you read the
> remaining numbers, if a number is less than the root of the max-heap,
> replace the root with it and restore the heap condition. When you
> reach the end of the million numbers, the heap will contain the
> smallest 100 numbers.
>
> If there are n numbers and you want the smallest k, this algorithm is
> O(n log k).
>
> Dave
>
> On Aug 17, 10:05 pm, aditi garg  wrote:
> > How to find the set of smallest 100 numbers out of 1 million numbers...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread aditi garg
@payal: im getting compile time errors fr both the strings...
Chk dis :http://ideone.com/BRbkf

On Thu, Aug 18, 2011 at 4:12 AM, payal gupta  wrote:

> i modified the code a lil bit
> #include
> #include
> int main()
> { clrscr();
>  char arr[5] = "geeks";
>  printf("%s\n", arr);
>  char b[1]="t";
>  printf("%s\n",b);
>  getchar();
>  return 0;
> }
>
> the output in dis case is somewhat diff..cud someone explain...
>
> On Thu, Aug 18, 2011 at 3:28 AM, Ayush Kapoor wrote:
>
>> There is no null character in this string,as its length is 5 and the
>> number of characters is 5(Geeks),and printf("%s",arr) should output the
>> string till the null character
>>
>>
>> On Thu, Aug 18, 2011 at 2:40 AM, bihari  wrote:
>>
>>> upto null charchter..
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>>
>> --
>> Ayush
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



[algogeeks] Urgent...plz help

2011-08-17 Thread aditi garg
How to find the set of smallest 100 numbers out of 1 million numbers...

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

2011-08-15 Thread aditi garg
Pick the operators whose meaning is context dependent?
1. *
2.#
3.&
4.No such operator exists
Plz gv the diff contexts if applicable...

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



Re: [algogeeks] mcq-os

2011-08-15 Thread aditi garg
process synchronization.

On Mon, Aug 15, 2011 at 6:29 PM, Kamakshii Aggarwal
wrote:

> semaphores are used to solve the problem of?
> 1.process synchronization
> 2.race around
> 3.mutual exclusion.
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] operating system mcq

2011-08-15 Thread aditi garg
Thanks a lot :)

On Mon, Aug 15, 2011 at 5:08 PM, rajeev bharshetty wrote:

> Here is the alternative link 
>
> http://www.mediafire.com/?e69mami0u2mvt67
>
> On Mon, Aug 15, 2011 at 4:52 PM, aditi garg wrote:
>
>> @rajeev: it is saying that the link has expired...Do u hv any alternative
>> link...??
>>
>> On Mon, Aug 15, 2011 at 4:21 PM, rajeev bharshetty 
>> wrote:
>>
>>> Timothy J William MCQ's
>>>
>>>
>>> http://s244.filesonic.in/download/1662179664/4e47a18f/6312d950/0/1/b4d72a29/0/49e7f6c2daf916cf807a0678329c153d3324519b
>>>
>>>
>>> On Mon, Aug 15, 2011 at 3:24 AM, nivedita arora <
>>> vivaciousnived...@gmail.com> wrote:
>>>
>>>> hi,
>>>> can someone pls provide good source from where i can prac mcq on OS .
>>>> thx
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards
>>> Rajeev N B <http://www.opensourcemania.co.cc>
>>>
>>> "*Winners Don't do Different things , they do things Differently"*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Rajeev N B <http://www.opensourcemania.co.cc>
>
> "*Winners Don't do Different things , they do things Differently"*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] operating system mcq

2011-08-15 Thread aditi garg
@rajeev: it is saying that the link has expired...Do u hv any alternative
link...??

On Mon, Aug 15, 2011 at 4:21 PM, rajeev bharshetty wrote:

> Timothy J William MCQ's
>
>
> http://s244.filesonic.in/download/1662179664/4e47a18f/6312d950/0/1/b4d72a29/0/49e7f6c2daf916cf807a0678329c153d3324519b
>
>
> On Mon, Aug 15, 2011 at 3:24 AM, nivedita arora <
> vivaciousnived...@gmail.com> wrote:
>
>> hi,
>> can someone pls provide good source from where i can prac mcq on OS .
>> thx
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Regards
> Rajeev N B <http://www.opensourcemania.co.cc>
>
> "*Winners Don't do Different things , they do things Differently"*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] reason

2011-08-15 Thread aditi garg
I think dis is bec int occupies 4 bytes while char occupies 1 byte so in the
memory when we save as int dey are saved as 2000 3000 4000
now whn u take a char pointer pointing to dis array and u increment it by 1
dey will move only by 1 byte and thus u get 0...
u can verify the result by removing char* typecast and u will get the ans as
2 3

On Mon, Aug 15, 2011 at 1:59 PM, Nitin  wrote:

> #include
> main()
> {
> int arr[3]={2,3,4};
> char *p;
> p=arr;
> p=(char *)((int *)(p));
> printf("%d",*p);
> p=(char *)((int *)(p+1));
> printf("%d",*p);
> }
> it is giving 2,0 why it is giving 0 ..>??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] reason

2011-08-15 Thread aditi garg
For the first ques the output will be have fun...have fun...have fun...have
fun...have fun...
dis is because printf will not take into consideration \n because of its
format...unless and untill we do not write sm %d or %s or %u etc it wont
access the portion of the statement after comma operator...
i hope it is clear...

On Mon, Aug 15, 2011 at 1:40 PM, Anil Arya  wrote:

> a##b means you are using the value of ab whatever the value of a and b is
> given.
>
>
> On Mon, Aug 15, 2011 at 1:13 PM, Sanjay Rajpal wrote:
>
>> ## is used for concatenation in C.
>>
>>
>>
>> On Mon, Aug 15, 2011 at 12:40 AM, Nitin  wrote:
>>
>>> #include
>>> #define fun(arg) do\
>>> {\
>>> if(arg)\
>>> printf("have fun...","\n");\
>>> }while(i--)
>>>
>>> main()
>>> {
>>> int i=6;
>>> fun(i<5);
>>> }
>>>
>>> give the answer and please give the reason for this
>>>
>>> #include
>>> #define fun(a,b) a##b
>>>  main()
>>> {
>>> int a, b, ab;
>>> a = 1, b = 2, ab = 3;
>>> printf("%d %d", fun(a,b), ab);
>>> return -1;
>>>
>>> }
>>> please tell me the use of this # in this program
>>> ~
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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.
>>
>
>
>
> --
> Anil Kumar Arya
> B.Tech  III year
> computer science & engineering
> M.N.N.I.T 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.
>



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



Re: [algogeeks] best book??

2011-08-14 Thread aditi garg
@ raj: no im sorry i dnt hv...

On Mon, Aug 15, 2011 at 2:07 AM, raj singh  wrote:

>
>
> @aditi- have u ebbok of tanenbaum(data structure)..
> please mail me if u have.
> thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-14 Thread aditi garg
some how im not able to get the logic...how will i be able to find max and
min of the entire matrix by jst traversing 3 rows??

for eg
 1 2 3 4 5
 8 1 3 6 9
4 6 3 2 10
9 0 5 8 12
18 2 6 7 3
fr dis matrix how will u find max and min??

On Mon, Aug 15, 2011 at 1:04 AM, aditya kumar
wrote:

> just traverse the three rows and get the max and min out of the three rows
> . print the row in which their is no max and min .
>
>
> On Mon, Aug 15, 2011 at 1:02 AM, aditya kumar <
> aditya.kumar130...@gmail.com> wrote:
>
>> yes
>>
>>
>> On Mon, Aug 15, 2011 at 12:58 AM, aditi garg 
>> wrote:
>>
>>> @shady : does O(3n) include the time required to find the max and min
>>> element as well??
>>>
>>>
>>> On Mon, Aug 15, 2011 at 12:50 AM, shady  wrote:
>>>
>>>> no it is 3*n only read it again
>>>>
>>>>
>>>> On Mon, Aug 15, 2011 at 12:45 AM, Amir Aavani wrote:
>>>>
>>>>>
>>>>> On 08/14/2011 11:46 AM, aditya kumar wrote:
>>>>>
>>>>>> it can be done in O(3n). in worst case one row will have max and
>>>>>> anothr row
>>>>>> will have min so the third row will be your o/p to print
>>>>>>
>>>>> Do you mean O(n^3)?
>>>>>
>>>>> Consider this { O(n^2) }:
>>>>>
>>>>>  1- Scan the whole matrix and find minimum and maximum entries in the
>>>>> matrix. Let Delta be the difference between maximum and minimum.
>>>>>  2- For each row, find the minimum and maximum entries in that row. If
>>>>> their difference is exactly Delta, then print that row.
>>>>>
>>>>>
>>>>> Amir
>>>>>
>>>>>
>>>>>
>>>>>> On Mon, Aug 15, 2011 at 12:00 AM, Karthikeyan palani<
>>>>>> karthikeyan...@gmail.com>  wrote:
>>>>>>
>>>>>>  sorry O(n^2) s the time complexity
>>>>>>>
>>>>>>>
>>>>>>> On 14 August 2011 23:56, shady  wrote:
>>>>>>>
>>>>>>>  how can it be O(n) when there are itself n*n elements..
>>>>>>>>
>>>>>>>> PS : no sharing of code, else the inevitable
>>>>>>>>
>>>>>>>> On Sun, Aug 14, 2011 at 11:51 PM, Karthikeyan palani<
>>>>>>>> karthikeyan...@gmail.com>  wrote:
>>>>>>>>
>>>>>>>>  Given a n x n matrix. .number are randomly placed. .print any one
>>>>>>>>> row
>>>>>>>>> which doesn’t have min
>>>>>>>>> and max elements. Time Complexity : 0(n)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> if anyone know the code.. pls share!!!
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> karthikeyankkn
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups
>>>>>>>>> "Algorithm Geeks" group.
>>>>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>>> algogeeks+unsubscribe@**googlegroups.com
>>>>>>>>> .
>>>>>>>>> For more options, visit this group at
>>>>>>>>> http://groups.google.com/**group/algogeeks?hl=en<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+unsubscribe@**googlegroups.com
>>>>>>>> .
>>>>>>>> For more options, visit this group at
>>>>>>>> http://groups.google.com/**gro

Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-14 Thread aditi garg
@shady : does O(3n) include the time required to find the max and min
element as well??

On Mon, Aug 15, 2011 at 12:50 AM, shady  wrote:

> no it is 3*n only read it again
>
>
> On Mon, Aug 15, 2011 at 12:45 AM, Amir Aavani wrote:
>
>>
>> On 08/14/2011 11:46 AM, aditya kumar wrote:
>>
>>> it can be done in O(3n). in worst case one row will have max and anothr
>>> row
>>> will have min so the third row will be your o/p to print
>>>
>> Do you mean O(n^3)?
>>
>> Consider this { O(n^2) }:
>>
>>  1- Scan the whole matrix and find minimum and maximum entries in the
>> matrix. Let Delta be the difference between maximum and minimum.
>>  2- For each row, find the minimum and maximum entries in that row. If
>> their difference is exactly Delta, then print that row.
>>
>>
>> Amir
>>
>>
>>
>>> On Mon, Aug 15, 2011 at 12:00 AM, Karthikeyan palani<
>>> karthikeyan...@gmail.com>  wrote:
>>>
>>>  sorry O(n^2) s the time complexity
>>>>
>>>>
>>>> On 14 August 2011 23:56, shady  wrote:
>>>>
>>>>  how can it be O(n) when there are itself n*n elements..
>>>>>
>>>>> PS : no sharing of code, else the inevitable
>>>>>
>>>>> On Sun, Aug 14, 2011 at 11:51 PM, Karthikeyan palani<
>>>>> karthikeyan...@gmail.com>  wrote:
>>>>>
>>>>>  Given a n x n matrix. .number are randomly placed. .print any one row
>>>>>> which doesn’t have min
>>>>>> and max elements. Time Complexity : 0(n)
>>>>>>
>>>>>>
>>>>>>
>>>>>> if anyone know the code.. pls share!!!
>>>>>>
>>>>>> --
>>>>>> karthikeyankkn
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> "Algorithm Geeks" group.
>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to
>>>>>> algogeeks+unsubscribe@**googlegroups.com
>>>>>> .
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/**group/algogeeks?hl=en<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+unsubscribe@**googlegroups.com
>>>>> .
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/**group/algogeeks?hl=en<http://groups.google.com/group/algogeeks?hl=en>
>>>>> .
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> karthikeyankkn
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups
>>>> "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscribe@**googlegroups.com
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/**group/algogeeks?hl=en<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+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/algogeeks?hl=en <http://groups.google.com/group/algogeeks?hl=en>.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Todays PEP question

2011-08-14 Thread aditi garg
3

On Mon, Aug 15, 2011 at 12:38 AM, Adi Srikanth wrote:

> int main()
> {
>int x=0,t=0;
>
>switch(x)
>{
>case 0: x++;
>do {
>
>case 1:t++;
>case 2:t++;
>case 3:t++;
>
>
>x++;
>} while(x>2);
>
>
>
>
>}
>printf("%d\n",t);
>return 0;
>
> }
>
>
> t will be wat???...3, 6 or 9
>
> Regards,
> Srikanth.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] best book??

2011-08-14 Thread aditi garg
tanenbaum

On Mon, Aug 15, 2011 at 12:40 AM, arvind kumar  wrote:

> Hi
> Can anyone please tell me which is the best book to refer for data
> structures,from placements point of view?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] array ques

2011-08-14 Thread aditi garg
lol

On Mon, Aug 15, 2011 at 12:40 AM, aditya kumar  wrote:

> @aditi : sry i dint realise that n > log n .:P
>
> On Mon, Aug 15, 2011 at 12:38 AM, aditi garg wrote:
>
>> @aditya : dis is obviously correct bt here complexity will be O(n) bt we
>> are asked to gv O(log n) solution
>>
>> On Mon, Aug 15, 2011 at 12:37 AM, aditya kumar <
>> aditya.kumar130...@gmail.com> wrote:
>>
>>> for(j=0;j>> {
>>> if(a[j]==j)
>>>  return j;
>>>  else
>>>  continue ;
>>> }
>>>
>>> this shud also be correct right ??
>>>
>>> On Mon, Aug 15, 2011 at 12:31 AM, Akash Mukherjee wrote:
>>>
>>>> just my 2 cents  in d binary search, replacing key with mid, ie
>>>> if(a[mid] > mid)
>>>> check lower half
>>>> else upper half
>>>>
>>>> should work??
>>>>
>>>>
>>>> On Mon, Aug 15, 2011 at 12:26 AM, aditi garg >>> > wrote:
>>>>
>>>>> Given an ordered array A[1…n] with numbers in strictly increasing
>>>>> order. Find a ‘j’ such that A [j]=j or -1 if no such number exist in
>>>>> o (log n).
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] array ques

2011-08-14 Thread aditi garg
@aditya : dis is obviously correct bt here complexity will be O(n) bt we are
asked to gv O(log n) solution

On Mon, Aug 15, 2011 at 12:37 AM, aditya kumar  wrote:

> for(j=0;j {
> if(a[j]==j)
>  return j;
>  else
>  continue ;
> }
>
> this shud also be correct right ??
>
> On Mon, Aug 15, 2011 at 12:31 AM, Akash Mukherjee wrote:
>
>> just my 2 cents  in d binary search, replacing key with mid, ie
>> if(a[mid] > mid)
>> check lower half
>> else upper half
>>
>> should work??
>>
>>
>> On Mon, Aug 15, 2011 at 12:26 AM, aditi garg 
>> wrote:
>>
>>> Given an ordered array A[1…n] with numbers in strictly increasing
>>> order. Find a ‘j’ such that A [j]=j or -1 if no such number exist in
>>> o (log n).
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



[algogeeks] array ques

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

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



Re: [algogeeks] Re: Storing of data in memory (endianness)

2011-08-14 Thread aditi garg
@dipankar: ur system is little endian as well most prolly...mine is...and as
far as things related to x 86 are concerned or be it anything...u nvr knw
how mch is enuff..dere are endless things

On Sun, Aug 14, 2011 at 11:59 PM, Dipankar Patro wrote:

> @ Aditi:
> Oops. Missed that out completely. That explains the question now. Thanks
> for the heads up.
> Any other x86 properties that we need to know? These things are really hard
> to come by.
>
> @ Dave:
> I think Aditi has pointed out my mistake.
>
>
> On 14 August 2011 23:47, Dave  wrote:
>
>> @Dipankar: You are correct. The answer, like the answer to so many
>> questions, is "It depends."
>>
>> Dave
>>
>> On Aug 14, 1:11 pm, Dipankar Patro  wrote:
>> > Hi all,
>> >
>> > I have come across quite a few questions like
>> > "
>> > What is the way in which int m = 2 will be stored in memory?
>> > 2 0 0 0 or 0 0 0 2
>> > "
>> > Doesn't the answer depend upon the machine you are working on? I mean
>> both
>> > are perfectly possible situations if you see.
>> > First option is little-endian, second one is big-endian.
>> >
>> > Which one should I probably go for in case I am not provided a "machine
>> > dependent" option?
>> >
>> > Reference:http://en.wikipedia.org/wiki/Endianness#Big-endian
>> > --
>> >
>> ___­
>> >
>> > 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.
>>
>>
>
>
> --
>
> ___
>
>
> 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.
>



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



Re: [algogeeks] Storing of data in memory (endianness)

2011-08-14 Thread aditi garg
@ dipankar : if ur talking abt todays winshuttle ppr thn it ws mentioned
that its using x86 whch is little endian...

On Sun, Aug 14, 2011 at 11:41 PM, Dipankar Patro wrote:

> Hi all,
>
> I have come across quite a few questions like
> "
> What is the way in which int m = 2 will be stored in memory?
> 2 0 0 0 or 0 0 0 2
> "
> Doesn't the answer depend upon the machine you are working on? I mean both
> are perfectly possible situations if you see.
> First option is little-endian, second one is big-endian.
>
> Which one should I probably go for in case I am not provided a "machine
> dependent" option?
>
> Reference:
> http://en.wikipedia.org/wiki/Endianness#Big-endian
> --
>
> ___
>
> 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.
>



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



Re: [algogeeks] Re: atrenta

2011-08-14 Thread aditi garg
@ raj : do dey ask questions based on gate even for software profile??and
wat is multiple seretc???

On Sun, Aug 14, 2011 at 5:08 PM, raj singh  wrote:

>
> written test format-
> part1.technical c:- and c++ questions;
> part2:hardware ques-gates,multipleseretc
> part3:aptitude quest
>
>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] Re: atrenta

2011-08-14 Thread aditi garg
Hey neha whch colg r u in??
has atrenta visited ur colg??
If yes plz provide the details and some questions as well...its
visiting our campus soon...

On Aug 11, 12:47 pm, Neha Sharan  wrote:
> atrenta is coming in my campus..if anyone know the recruiting procedure or
> have the placement papers..plz share.
> thanks
>
> with regards
> neha

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

2011-08-13 Thread aditi garg
its wrking!!!

On Sat, Aug 13, 2011 at 11:14 PM, Vidit Sinha  wrote:

> The link doesnt seem to work. Can somebody mail it again?
>
>
> On Sat, Aug 13, 2011 at 10:22 PM, Yasir  wrote:
>
>> Kudos to Aditi.  :D
>>
>> --
>> 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/-/gnhokgp_zV0J.
>>
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] differnce between malloc calloc and new

2011-08-13 Thread aditi garg
malloc fr one element only...fr eg new node in linked listgarbage values
assigned
calloc can be used to dynamically allocate memory fr arrays...values
assigned to 0 by default
new same as malloc except dat it is used in c++ and malloc in C

On Sat, Aug 13, 2011 at 10:32 PM, Ankur pratik wrote:

> what is d basic diff between malloc calloc and new command as all are
> used for dynamic allocation
>
> --
> Warm Regards--
>
> Ankur Pratik
> Computer Science & Engg Dept
> Undergraduate Student
> National Institute of Technology
> Durgapur
> 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.
>



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



Re: [algogeeks] Re: an array question

2011-08-13 Thread aditi garg
@ kunal : arent we supposed to construct the string fr each number equal to
the max length of any number...
whr r v doing dat chking in dis algo?

On Sat, Aug 13, 2011 at 10:25 PM, Kunal Patil  wrote:

> I dont know whether this is best approach to do step 2 or not. But it's
> certainly good.
>
>
> //I will show for two strings s1 and s2
>
> len1 = s1.length();
> len2 = s2.length();
> ind1 = 0; //Index in the first string
> ind2 = 0; //Index in the second string
>
> while( ind1 function returns
> {
> if(ind1 == len1)  // String s1 has exhausted, so start over it
> ind1 = 0;
>
> if(ind2 == len2)  // String s2 has exhausted, so start over it
> ind2 = 0;
>
> for(; ind1 < len1 && ind2  // Go on comparing until any of the string exhausts or function returns
> {
> if( s1[ind1] == s2[ind2] ) //Same current char in both string so we need to
> match more char
> continue;
> else // mismatch
> return (s1[ind1] > s2 [ind2] );
> }
> }
>
> if (ind1==len1 && ind2==len2) // same strings
> return true;
>
> //If I missed anything in the code, let me know
>
>
> On Sat, Aug 13, 2011 at 9:29 PM, aditi garg wrote:
>
>> @kunal: what is the best way to implement step 2?
>>
>>
>> On Sat, Aug 13, 2011 at 7:33 PM, Ashish Sachdeva <
>> ashish.asachd...@gmail.com> wrote:
>>
>>> @kunal: seems fine.. tried it on some cases...
>>>
>>>
>>> On Sat, Aug 13, 2011 at 5:17 PM, Kunal Patil  wrote:
>>>
>>>> Following approach should work:
>>>>
>>>> 1)  Count max number of digit in any integer of input. Let it be m.
>>>> (Thanks to dave..)
>>>>
>>>> 2) For each int having less than m digits:
>>>>   Convert it to string of length m where you append circularly.
>>>>   For e.g. if m=5
>>>>53 --> 53535
>>>>100 --> 10010
>>>>34343 --> 34343
>>>>8 --> 8
>>>>
>>>> 3) Now lexicographically sort all those strings. Apply same permutations
>>>> to first array of integers. (again, thanx to Dave)
>>>>
>>>> 4) Concatenate integers of first array.
>>>>
>>>> For e.g.
>>>> 8   53   147  159  1471470   71
>>>> m=7
>>>> corresponding string array becomes:
>>>> "888"
>>>> "5353535"
>>>> "1471471"
>>>> "1591591"
>>>> "1471470"
>>>> "7171717"
>>>>
>>>> Apply step 3. This gives int array as 8  71  53  15  147  1471470
>>>>
>>>> Thus, solution is 87153151471471470.
>>>>
>>>> Let me know about any counter-examples...
>>>>
>>>> You can apply tricks in programming language that will allow you to save
>>>> actually calculating these strings.
>>>> For e.g. while comparing two unequal length strings char by char if you
>>>> find chars of str1 have exhausted but not of str2, you can set index in 
>>>> str1
>>>> to start of the str1 and continue comparison.
>>>>
>>>>
>>>> On Sat, Aug 13, 2011 at 2:06 PM, Ashish Sachdeva <
>>>> ashish.asachd...@gmail.com> wrote:
>>>>
>>>>> @ $: how ll you manage something like this:
>>>>> 2,3,100,90,10
>>>>>
>>>>> 2nd array becomes: 200,300,100,900,100
>>>>> descendng order: 900,300,200,100,100
>>>>>
>>>>> how to take care which 100 is of 10 cos we need 10 1st...??
>>>>> On Aug 13, 1:00 pm, rahul aravind  wrote:
>>>>> > awesome alogoritm dave:):)
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> > On Fri, Aug 12, 2011 at 6:48 PM, Dave 
>>>>> wrote:
>>>>> > > @Yasir: I think the following will work. Counterexamples welcome.
>>>>> >
>>>>> > > Find the number of digits in each of the integers, and find the max
>>>>> of
>>>>> > > that number, say m.
>>>>> >
>>>>> > > Fill a second array as follows: If the ith integer has m digits,
>>>>> copy
>>>>> > > it into the second array. If the ith number has less than m digits,
>>>>> > > concatenate duplicates of the last digi

[algogeeks] Algorithms for Interviews _scan ocr_.pdf

2011-08-13 Thread aditi garg
**
If you fail to see this message correctly,
copy this link to your browser: http://www.fileflyer.com/view/XyBZGA8

[image: FileFlyer]Store and Send your files, fast!

Hello,


You can click on the following link to retrieve your file.

Algorithms for Interviews _scan ocr_.pdf<http://www.fileflyer.com/view/XyBZGA8>


This email was automatically generated, please do not reply to it.

If you have any questions, please email supp...@fileflyer.com.


The FileFlyer Team


Terms <http://www.fileflyer.com/legal/terms.aspx> | Privacy
Policy<http://www.speedbit.com/Legal/PRIVACY.ASP>|
Support <http://www.fileflyer.com/feedback> |
DMCA<http://www.fileflyer.com/legal/dmca.aspx>





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



Re: [algogeeks] String Question

2011-08-13 Thread aditi garg
@raghavan: can u explain wid an example plz

On Sat, Aug 13, 2011 at 4:11 PM, Raghavan  wrote:

>
>- Keep an counter for first stuck number(0/1)
>- increment it, if you stuck on other number, start decrementing  it
>- if the counter becomes zero,note that seq
>- finally take the longest seq
>
> Hope this could solve the problem.
>
> On Sat, Aug 13, 2011 at 1:56 PM, vicky S  wrote:
>
>> Given a string which oly has 0's and 1's . Find the maximum largest
>> substring which have equal no of 0's and 1's and give the length of the
>> substring .
>> whether it can be solved in DP ?? or any other soln ?
>> for example :
>> given string : 001101000
>> output :0101
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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 and Regards,
> Raghavan KL
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: an array question

2011-08-13 Thread aditi garg
@kunal: what is the best way to implement step 2?

On Sat, Aug 13, 2011 at 7:33 PM, Ashish Sachdeva  wrote:

> @kunal: seems fine.. tried it on some cases...
>
>
> On Sat, Aug 13, 2011 at 5:17 PM, Kunal Patil  wrote:
>
>> Following approach should work:
>>
>> 1)  Count max number of digit in any integer of input. Let it be m.
>> (Thanks to dave..)
>>
>> 2) For each int having less than m digits:
>>   Convert it to string of length m where you append circularly.
>>   For e.g. if m=5
>>53 --> 53535
>>100 --> 10010
>>34343 --> 34343
>>8 --> 8
>>
>> 3) Now lexicographically sort all those strings. Apply same permutations
>> to first array of integers. (again, thanx to Dave)
>>
>> 4) Concatenate integers of first array.
>>
>> For e.g.
>> 8   53   147  159  1471470   71
>> m=7
>> corresponding string array becomes:
>> "888"
>> "5353535"
>> "1471471"
>> "1591591"
>> "1471470"
>> "7171717"
>>
>> Apply step 3. This gives int array as 8  71  53  15  147  1471470
>>
>> Thus, solution is 87153151471471470.
>>
>> Let me know about any counter-examples...
>>
>> You can apply tricks in programming language that will allow you to save
>> actually calculating these strings.
>> For e.g. while comparing two unequal length strings char by char if you
>> find chars of str1 have exhausted but not of str2, you can set index in str1
>> to start of the str1 and continue comparison.
>>
>>
>> On Sat, Aug 13, 2011 at 2:06 PM, Ashish Sachdeva <
>> ashish.asachd...@gmail.com> wrote:
>>
>>> @ $: how ll you manage something like this:
>>> 2,3,100,90,10
>>>
>>> 2nd array becomes: 200,300,100,900,100
>>> descendng order: 900,300,200,100,100
>>>
>>> how to take care which 100 is of 10 cos we need 10 1st...??
>>> On Aug 13, 1:00 pm, rahul aravind  wrote:
>>> > awesome alogoritm dave:):)
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Fri, Aug 12, 2011 at 6:48 PM, Dave  wrote:
>>> > > @Yasir: I think the following will work. Counterexamples welcome.
>>> >
>>> > > Find the number of digits in each of the integers, and find the max
>>> of
>>> > > that number, say m.
>>> >
>>> > > Fill a second array as follows: If the ith integer has m digits, copy
>>> > > it into the second array. If the ith number has less than m digits,
>>> > > concatenate duplicates of the last digit of the integer to the right
>>> > > end to expand it to m digits. Examples: m = 3, 7 goes to 777; 82 goes
>>> > > to 822; 29 goes to 299; 0 goes to 000.
>>> >
>>> > > Sort the second array into descending order and carry the first array
>>> > > along (apply the same permutations to the first array as you do to
>>> the
>>> > > second).
>>> >
>>> > > Concatenate the integers in the first array to get the result.
>>> >
>>> > > Dave
>>> >
>>> > > On Aug 12, 7:34 am, Yasir Imteyaz  wrote:
>>> > > > An array of integers is given and you have to find the largest
>>> possible
>>> > > > integer by concatenating all elements:
>>> >
>>> > > > example:
>>> > > > array:  87  36  52
>>> > > > answer:  875236
>>> >
>>> > > > array: 87 9 52
>>> > > > answer: 98752
>>> >
>>> > > --
>>> > > You received this message because you are subscribed to the Google
>>> Groups
>>> > > "Algorithm Geeks" group.
>>> > > To post to this group, send email to algogeeks@googlegroups.com.
>>> > > To unsubscribe from 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.

Re: [algogeeks] Re: microsoft paper that i wrote today..

2011-08-12 Thread aditi garg
thanks:)

On Fri, Aug 12, 2011 at 11:06 PM, Anil Arya  wrote:

> Q.5 . [warning] initialization  makes integer from pointer without
> a cast.
>
>
> On Fri, Aug 12, 2011 at 10:56 PM, sagar pareek wrote:
>
>> well if we write the code simply as
>> #include
>>  int main()
>>  {
>>  1+2+"4"
>>  }
>>
>> it gives compilation error
>>
>> if like this
>> #include
>>  int main()
>>  {
>>  1+2+"4";
>>  }
>>
>> it will give warning:- no effect of code
>>
>>
>>
>> if like this
>> #include
>>  int main()
>>  {
>> int a= 1+2+"4";
>> printf("%d",a);
>>  }
>> it will give error
>> cannot convert char* to int
>>
>>
>>
>> On Fri, Aug 12, 2011 at 10:44 PM, aditi garg 
>> wrote:
>>
>>> wats the ans to the 5th ques??
>>>
>>>
>>> On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar wrote:
>>>
>>>> thanks a lot mate .
>>>>
>>>>
>>>> On Aug 11, 4:51 pm, sindhu  wrote:
>>>> > 1. write a method to find the smallest angle between two hands when
>>>> > the time is given as input???
>>>> > 2. given a number between 1 to 1000 convert it to words..example
>>>> > 235..it should print as two hundred thirty five..
>>>> > 3. write test cases for elevator in a multistory building..
>>>> > 4. a chessboard of size 64 blocks is given..a knight can move two n
>>>> > half moves at a time..how many steps will it take to cover all the 64
>>>> > blocks...and change the algorithm if the knight moves three and a half
>>>> > moves.
>>>> > 5. what will be the result if you execute the following code segment:
>>>> > 1+2+"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.
>>>>
>>>>
>>>
>>>
>>> --
>>> Aditi Garg
>>> Undergraduate Student
>>> Electronics & Communication Divison
>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>> Sector 3, Dwarka
>>> New Delhi
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Anil Kumar Arya
> computer science & engineering
> M.N.N.I.T 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.
>



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



Re: [algogeeks] Re: microsoft paper that i wrote today..

2011-08-12 Thread aditi garg
wats the ans to the 5th ques??

On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar  wrote:

> thanks a lot mate .
>
>
> On Aug 11, 4:51 pm, sindhu  wrote:
> > 1. write a method to find the smallest angle between two hands when
> > the time is given as input???
> > 2. given a number between 1 to 1000 convert it to words..example
> > 235..it should print as two hundred thirty five..
> > 3. write test cases for elevator in a multistory building..
> > 4. a chessboard of size 64 blocks is given..a knight can move two n
> > half moves at a time..how many steps will it take to cover all the 64
> > blocks...and change the algorithm if the knight moves three and a half
> > moves.
> > 5. what will be the result if you execute the following code segment:
> > 1+2+"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.
>
>


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



Re: [algogeeks] Re: Quantz

2011-08-11 Thread aditi garg
@aseem: using powers of 3 we have to use both sides of the balance...bt if
we have the constraint dat we can use only one side thn powers of 2...i hope
its clear

On Fri, Aug 12, 2011 at 2:02 AM, aseem garg  wrote:

> @Aditi: Why use powers of 2 when we can use powers of three in case of
> weights??
> Aseem
>
>
>
> On Fri, Aug 12, 2011 at 1:53 AM, aditi garg wrote:
>
>> @sagar  : :):)
>>
>>
>> On Fri, Aug 12, 2011 at 1:51 AM, sagar pareek wrote:
>>
>>> thanks aditi for the explanation
>>>
>>>
>>> On Fri, Aug 12, 2011 at 1:28 AM, aditi garg 
>>> wrote:
>>>
>>>> well it is like i sed fr eg dey ask u the min num of weights required to
>>>> count all weights from 1-127
>>>> thn the ans wud be 1 2 4 8 16 32 64 ie. 7 weights...
>>>> similar concept fr the powers of 3 as well
>>>>
>>>>
>>>> On Fri, Aug 12, 2011 at 1:15 AM, Swati Sarraf wrote:
>>>>
>>>>> @aditi,
>>>>> Could you explain it more clearly ..
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 3:36 PM, aditi garg >>>> > wrote:
>>>>>
>>>>>> well dis is sm maths trick whch we shud knw...
>>>>>> dis is applicable even wid multiples of 2
>>>>>> fr eg if u have 1 2 4 8 u can measure any weight from 1 - 15
>>>>>> if u have like 1 2 4 8 16 thn we can measure any weight from 1 -31...
>>>>>>
>>>>>> simi;larly fr 3 as well
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 12, 2011 at 12:44 AM, Swati Sarraf 
>>>>>> wrote:
>>>>>>
>>>>>>> @sagar, Could you explain how you find these five weights . I  mean
>>>>>>> is it a guess or any mathematical explaination it there  ??
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 11, 2011 at 3:12 PM, sagar pareek >>>>>> > wrote:
>>>>>>>
>>>>>>>> 81-27+3 =57
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Aug 12, 2011 at 12:39 AM, Tarun Arya 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> sagar...cud u pls explain d weight distribution for 57...
>>>>>>>>> Tarun
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>>>>> To unsubscribe from this 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,
>>>>>>> Swati Sarraf
>>>>>>>
>>>>>>>  --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>> To post to this group, sen

Re: [algogeeks]

2011-08-11 Thread aditi garg
@sagar.: Now i get it:)
Thanks a ton :)

On Fri, Aug 12, 2011 at 1:51 AM, sagar pareek  wrote:

> @additi
> in gcc whenever compiler loads first two x's then before multiplying it
> increments x twice for each pre increment
> like if we have
> x=3;
> c=++x*x++;
> here
> it will be done as
> c=4*4
> which is same as
> c=x++*++x;
>
> is it clear?
>
> On Fri, Aug 12, 2011 at 1:38 AM, Avenged  wrote:
>
>> Like he said earlier , its a compiler implementation.
>>
>> On Aug 12, 12:55 am, aditi garg  wrote:
>> > @sagar: why doesnt it take place sequentially like 4*5*6*7??
>> > why do the frst two increments take place like dat??
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Aug 12, 2011 at 1:19 AM, sagar pareek 
>> wrote:
>> > > told u before
>> > > in turbo c it increments all values of x
>> > > x=3;
>> > > c=7*7*7*7;
>> > > c=2401
>> >
>> > > On Fri, Aug 12, 2011 at 1:16 AM, Puneet Chawla <
>> puneetchawla...@gmail.com>wrote:
>> >
>> > >> In turbo it is showing o/p 2401 again still confused...
>> >
>> > >> On Fri, Aug 12, 2011 at 1:14 AM, sagar pareek > >wrote:
>> >
>> > >>> ok if we have the scenario like u stated then it will be done in gcc
>> as
>> > >>> :-
>> > >>> x=3;
>> > >>> c=5*5*(++x)*(++x);
>> > >>> c=25*6*(++x);
>> > >>> c=150*7;
>> > >>> c=1050;
>> >
>> > >>> On Fri, Aug 12, 2011 at 1:10 AM, aditi garg <
>> aditi.garg.6...@gmail.com>wrote:
>> >
>> > >>>> @sagar: bt i dint understand how is it done
>> > >>>> what if we had something like (++x)*(++x)*(++x)*(++x) thn how wud
>> it be
>> > >>>> evaluated in gcc?
>> > >>>> and since it is giving diff ans on diff compilers that is wat i
>> mean by
>> > >>>> being undefined...
>> >
>> > >>>> On Fri, Aug 12, 2011 at 1:05 AM, Puneet Chawla <
>> > >>>> puneetchawla...@gmail.com> wrote:
>> >
>> > >>>>> @Aditi i thnk sagar parteek is right ...in turbo compiler it's
>> > >>>>> incrementing and finally max of all values and multiply the value
>> means pre
>> > >>>>> increment->evaluate->postincrement
>> >
>> > >>>>> On Fri, Aug 12, 2011 at 1:02 AM, sagar pareek <
>> sagarpar...@gmail.com>wrote:
>> >
>> > >>>>>> well its always depends on compiler to compiler
>> > >>>>>> in turbo c it will first increment all x
>> > >>>>>> results in
>> > >>>>>> c=6*6*6
>> > >>>>>> c=216
>> >
>> > >>>>>> but in gcc it will be as explained by me above
>> >
>> > >>>>>> On Fri, Aug 12, 2011 at 12:56 AM, aditi garg <
>> > >>>>>> aditi.garg.6...@gmail.com> wrote:
>> >
>> > >>>>>>> i think it wud be undefined...the value is getting modified more
>> than
>> > >>>>>>> once and hence violating the sequence points rule...plz corect
>> me if im
>> > >>>>>>> wrong...
>> >
>> > >>>>>>> On Fri, Aug 12, 2011 at 12:48 AM, Puneet Chawla <
>> > >>>>>>> puneetchawla...@gmail.com> wrote:
>> >
>> > >>>>>>>> In turbo compiler it's o/p is 216 and in dev it's 150..
>> > >>>>>>>> Help me out..
>> >
>> > >>>>>>>> On Fri, Aug 12, 2011 at 12:45 AM, sagar pareek <
>> > >>>>>>>> sagarpar...@gmail.com> wrote:
>> >
>> > >>>>>>>>> after expansion of macro
>> > >>>>>>>>> it will be c=(++x)*(++x)*(++x);
>> >
>> > >>>>>>>>> now it be solved as
>> > >>>>>>>>>  c= 5*5*(++x);
>> > >>>>>>>>> c=25*6;
>> > >>>>>>>>> c=150
>> >
>> > >>>>>>>>> On Fri, Aug 12, 2011 at 12:38 AM, Puneet Chawla <
>> > >>>

Re: [algogeeks] Re: Quantz

2011-08-11 Thread aditi garg
@sagar  : :):)

On Fri, Aug 12, 2011 at 1:51 AM, sagar pareek  wrote:

> thanks aditi for the explanation
>
>
> On Fri, Aug 12, 2011 at 1:28 AM, aditi garg wrote:
>
>> well it is like i sed fr eg dey ask u the min num of weights required to
>> count all weights from 1-127
>> thn the ans wud be 1 2 4 8 16 32 64 ie. 7 weights...
>> similar concept fr the powers of 3 as well
>>
>>
>> On Fri, Aug 12, 2011 at 1:15 AM, Swati Sarraf wrote:
>>
>>> @aditi,
>>> Could you explain it more clearly ..
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 3:36 PM, aditi garg 
>>> wrote:
>>>
>>>> well dis is sm maths trick whch we shud knw...
>>>> dis is applicable even wid multiples of 2
>>>> fr eg if u have 1 2 4 8 u can measure any weight from 1 - 15
>>>> if u have like 1 2 4 8 16 thn we can measure any weight from 1 -31...
>>>>
>>>> simi;larly fr 3 as well
>>>>
>>>>
>>>> On Fri, Aug 12, 2011 at 12:44 AM, Swati Sarraf wrote:
>>>>
>>>>> @sagar, Could you explain how you find these five weights . I  mean is
>>>>> it a guess or any mathematical explaination it there  ??
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 3:12 PM, sagar pareek 
>>>>> wrote:
>>>>>
>>>>>> 81-27+3 =57
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 12, 2011 at 12:39 AM, Tarun Arya wrote:
>>>>>>
>>>>>>> sagar...cud u pls explain d weight distribution for 57...
>>>>>>> Tarun
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>>> To unsubscribe from this 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,
>>>>> Swati Sarraf
>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from 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.
>>>>
>>>
>>>
>>>
>>

Re: [algogeeks] Hash

2011-08-11 Thread aditi garg
cud u xplain how?

On Thu, Aug 11, 2011 at 11:31 PM, Tarun Arya  wrote:

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



Re: [algogeeks] Re: Quantz

2011-08-11 Thread aditi garg
well it is like i sed fr eg dey ask u the min num of weights required to
count all weights from 1-127
thn the ans wud be 1 2 4 8 16 32 64 ie. 7 weights...
similar concept fr the powers of 3 as well

On Fri, Aug 12, 2011 at 1:15 AM, Swati Sarraf  wrote:

> @aditi,
> Could you explain it more clearly ..
>
>
>
> On Thu, Aug 11, 2011 at 3:36 PM, aditi garg wrote:
>
>> well dis is sm maths trick whch we shud knw...
>> dis is applicable even wid multiples of 2
>> fr eg if u have 1 2 4 8 u can measure any weight from 1 - 15
>> if u have like 1 2 4 8 16 thn we can measure any weight from 1 -31...
>>
>> simi;larly fr 3 as well
>>
>>
>> On Fri, Aug 12, 2011 at 12:44 AM, Swati Sarraf wrote:
>>
>>> @sagar, Could you explain how you find these five weights . I  mean is it
>>> a guess or any mathematical explaination it there  ??
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 3:12 PM, sagar pareek wrote:
>>>
>>>> 81-27+3 =57
>>>>
>>>>
>>>> On Fri, Aug 12, 2011 at 12:39 AM, Tarun Arya wrote:
>>>>
>>>>> sagar...cud u pls explain d weight distribution for 57...
>>>>> Tarun
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this 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,
>>> Swati Sarraf
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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.
>>
>
>
>
> --
> With Regards,
> Swati Sarraf
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks]

2011-08-11 Thread aditi garg
@sagar: why doesnt it take place sequentially like 4*5*6*7??
why do the frst two increments take place like dat??

On Fri, Aug 12, 2011 at 1:19 AM, sagar pareek  wrote:

> told u before
> in turbo c it increments all values of x
> x=3;
> c=7*7*7*7;
> c=2401
>
>
> On Fri, Aug 12, 2011 at 1:16 AM, Puneet Chawla 
> wrote:
>
>> In turbo it is showing o/p 2401 again still confused...
>>
>>
>> On Fri, Aug 12, 2011 at 1:14 AM, sagar pareek wrote:
>>
>>> ok if we have the scenario like u stated then it will be done in gcc as
>>> :-
>>> x=3;
>>> c=5*5*(++x)*(++x);
>>> c=25*6*(++x);
>>> c=150*7;
>>> c=1050;
>>>
>>> On Fri, Aug 12, 2011 at 1:10 AM, aditi garg 
>>> wrote:
>>>
>>>> @sagar: bt i dint understand how is it done
>>>> what if we had something like (++x)*(++x)*(++x)*(++x) thn how wud it be
>>>> evaluated in gcc?
>>>> and since it is giving diff ans on diff compilers that is wat i mean by
>>>> being undefined...
>>>>
>>>>
>>>> On Fri, Aug 12, 2011 at 1:05 AM, Puneet Chawla <
>>>> puneetchawla...@gmail.com> wrote:
>>>>
>>>>> @Aditi i thnk sagar parteek is right ...in turbo compiler it's
>>>>> incrementing and finally max of all values and multiply the value means 
>>>>> pre
>>>>> increment->evaluate->postincrement
>>>>>
>>>>>
>>>>> On Fri, Aug 12, 2011 at 1:02 AM, sagar pareek 
>>>>> wrote:
>>>>>
>>>>>> well its always depends on compiler to compiler
>>>>>> in turbo c it will first increment all x
>>>>>> results in
>>>>>> c=6*6*6
>>>>>> c=216
>>>>>>
>>>>>> but in gcc it will be as explained by me above
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 12, 2011 at 12:56 AM, aditi garg <
>>>>>> aditi.garg.6...@gmail.com> wrote:
>>>>>>
>>>>>>> i think it wud be undefined...the value is getting modified more than
>>>>>>> once and hence violating the sequence points rule...plz corect me if im
>>>>>>> wrong...
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Aug 12, 2011 at 12:48 AM, Puneet Chawla <
>>>>>>> puneetchawla...@gmail.com> wrote:
>>>>>>>
>>>>>>>> In turbo compiler it's o/p is 216 and in dev it's 150..
>>>>>>>> Help me out..
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Aug 12, 2011 at 12:45 AM, sagar pareek <
>>>>>>>> sagarpar...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> after expansion of macro
>>>>>>>>> it will be c=(++x)*(++x)*(++x);
>>>>>>>>>
>>>>>>>>> now it be solved as
>>>>>>>>>  c= 5*5*(++x);
>>>>>>>>> c=25*6;
>>>>>>>>> c=150
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Aug 12, 2011 at 12:38 AM, Puneet Chawla <
>>>>>>>>> puneetchawla...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> #define cube(x) (x)*(x)*(x)
>>>>>>>>>> main()
>>>>>>>>>> {
>>>>>>>>>> int x=3,c;
>>>>>>>>>> c=cube(++x);
>>>>>>>>>> printf("%d",c);
>>>>>>>>>>
>>>>>>>>>> return 0;
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> will anyone please tell me why o/p is 150.?
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> With regards
>>>>>>>>>>   
>>>>>>>>>> Puneet Chawla
>>>>>>>>>>
>>>>>>>>>>  --
>>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>>>>> To post 

Re: [algogeeks]

2011-08-11 Thread aditi garg
@sagar: bt i dint understand how is it done
what if we had something like (++x)*(++x)*(++x)*(++x) thn how wud it be
evaluated in gcc?
and since it is giving diff ans on diff compilers that is wat i mean by
being undefined...

On Fri, Aug 12, 2011 at 1:05 AM, Puneet Chawla wrote:

> @Aditi i thnk sagar parteek is right ...in turbo compiler it's incrementing
> and finally max of all values and multiply the value means pre
> increment->evaluate->postincrement
>
>
> On Fri, Aug 12, 2011 at 1:02 AM, sagar pareek wrote:
>
>> well its always depends on compiler to compiler
>> in turbo c it will first increment all x
>> results in
>> c=6*6*6
>> c=216
>>
>> but in gcc it will be as explained by me above
>>
>>
>> On Fri, Aug 12, 2011 at 12:56 AM, aditi garg 
>> wrote:
>>
>>> i think it wud be undefined...the value is getting modified more than
>>> once and hence violating the sequence points rule...plz corect me if im
>>> wrong...
>>>
>>>
>>> On Fri, Aug 12, 2011 at 12:48 AM, Puneet Chawla <
>>> puneetchawla...@gmail.com> wrote:
>>>
>>>> In turbo compiler it's o/p is 216 and in dev it's 150..
>>>> Help me out..
>>>>
>>>>
>>>> On Fri, Aug 12, 2011 at 12:45 AM, sagar pareek 
>>>> wrote:
>>>>
>>>>> after expansion of macro
>>>>> it will be c=(++x)*(++x)*(++x);
>>>>>
>>>>> now it be solved as
>>>>>  c= 5*5*(++x);
>>>>> c=25*6;
>>>>> c=150
>>>>>
>>>>>
>>>>> On Fri, Aug 12, 2011 at 12:38 AM, Puneet Chawla <
>>>>> puneetchawla...@gmail.com> wrote:
>>>>>
>>>>>> #define cube(x) (x)*(x)*(x)
>>>>>> main()
>>>>>> {
>>>>>> int x=3,c;
>>>>>> c=cube(++x);
>>>>>> printf("%d",c);
>>>>>>
>>>>>> return 0;
>>>>>> }
>>>>>>
>>>>>> will anyone please tell me why o/p is 150.?
>>>>>>
>>>>>> --
>>>>>> With regards
>>>>>>   
>>>>>> Puneet Chawla
>>>>>>
>>>>>>  --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Algorithm Geeks" group.
>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>> To unsubscribe from this 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
>>>>   
>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> Aditi Garg
>>> Undergraduate Student
>>> Electronics & Communication Divison
>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>> Sector 3, Dwarka
>>> New Delhi
>>>
>>>
>>> 

Re: [algogeeks] Re: Quantz

2011-08-11 Thread aditi garg
well dis is sm maths trick whch we shud knw...
dis is applicable even wid multiples of 2
fr eg if u have 1 2 4 8 u can measure any weight from 1 - 15
if u have like 1 2 4 8 16 thn we can measure any weight from 1 -31...

simi;larly fr 3 as well

On Fri, Aug 12, 2011 at 12:44 AM, Swati Sarraf  wrote:

> @sagar, Could you explain how you find these five weights . I  mean is it a
> guess or any mathematical explaination it there  ??
>
>
>
>
>
> On Thu, Aug 11, 2011 at 3:12 PM, sagar pareek wrote:
>
>> 81-27+3 =57
>>
>>
>> On Fri, Aug 12, 2011 at 12:39 AM, Tarun Arya  wrote:
>>
>>> sagar...cud u pls explain d weight distribution for 57...
>>> Tarun
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this 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,
> Swati Sarraf
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] reverse

2011-08-11 Thread aditi garg
@tarun no it wont gv u the 2 digits dat way...the numbers are stored in
binary format not BCD...ur jst extracting the two nibbles like dat not the
tens and unit's digit of the number...

On Fri, Aug 12, 2011 at 12:17 AM, Tarun Arya  wrote:

> RAHUL@
> d question was to reverse d 2 numbers...it can b done by wat i hav said...
> if u want 2 extract numbers then
> a&0x0f   //this wil giv number in units place...
> a&0xf0   a>>4//this wil give number in tens place
>
> correct me if i m wrong
> Tarun
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks]

2011-08-11 Thread aditi garg
i think it wud be undefined...the value is getting modified more than once
and hence violating the sequence points rule...plz corect me if im wrong...

On Fri, Aug 12, 2011 at 12:48 AM, Puneet Chawla
wrote:

> In turbo compiler it's o/p is 216 and in dev it's 150..
> Help me out..
>
>
> On Fri, Aug 12, 2011 at 12:45 AM, sagar pareek wrote:
>
>> after expansion of macro
>> it will be c=(++x)*(++x)*(++x);
>>
>> now it be solved as
>>  c= 5*5*(++x);
>> c=25*6;
>> c=150
>>
>>
>> On Fri, Aug 12, 2011 at 12:38 AM, Puneet Chawla <
>> puneetchawla...@gmail.com> wrote:
>>
>>> #define cube(x) (x)*(x)*(x)
>>> main()
>>> {
>>> int x=3,c;
>>> c=cube(++x);
>>> printf("%d",c);
>>>
>>> return 0;
>>> }
>>>
>>> will anyone please tell me why o/p is 150.?
>>>
>>> --
>>> With regards
>>>   
>>> Puneet Chawla
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this 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
>   
> 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.
>



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



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.



Re: [algogeeks] Re: texas instruments

2011-08-09 Thread aditi garg
and how much time do dey gv fr each section...any suggestion whch section to
be attempted frst???

On Tue, Aug 9, 2011 at 10:29 PM, Decipher  wrote:

> Both Tech and Apti papers were MCQs . And the questions are not that tough
> . Therefore they expect very good marks in written test . Some questions
> might ask you some intricate things about C or C++ like questions related to
> heaps , dynamic/static memory and other general computer concepts .
>
> --
> 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/-/bI68THLLToMJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] output?

2011-08-09 Thread aditi garg
it doesnt matter

On Tue, Aug 9, 2011 at 10:20 PM, tech rascal wrote:

> #include
> int main()
> {
> char ch;
> if((ch=printf("")))
> printf("it matters");
> else
> printf("it doesn't matter");
> return 0;
> }
>
>
> 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.
>



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



Re: [algogeeks] Re: texas instruments

2011-08-09 Thread aditi garg
for software the technical ppr(frst round) is mcq or subjective?

On Tue, Aug 9, 2011 at 7:23 PM, Decipher  wrote:

> I applied to Texas Instruments last year for software profile and these are
> some of the questions that were asked in interview round :
>
> 1) How to find least common ancestor of two nodes in a tree ?
> 2) Some questions on virtual table and vptr ? Is Vtable created per class
> or per object ?
> 3) Some questions about code section , data section , linking and OS
> related concepts ?
>
> The written test was repeated according to some people who had applied
> earlier and consisted of Aptitude and Technical questions (separate tests
> for both) . I was able to answer many questions so was shortlisted for
> interview and later on for HR also . Although since I had applied off -
> campus they told me that results will be declared after the procedure is
> completed in other cities . And after 2 months they told me that there would
> be 1 telephonic interview if I am still interested in TI . But since I had
> already joined somewhere else I rejected the offer .
>
> Reply here if you still have any doubt !!
>
> --
> 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/-/7DNiCyE4TsoJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: directi prepration

2011-08-09 Thread aditi garg
@Kunal: in the written test wer the ques technical or aptitude??

On Tue, Aug 9, 2011 at 4:42 PM, NIKHIL JAIN
wrote:

> thnx
>
> can you please tell some of the written questions so that i will have an
> idea what kind of questions are being asked by them
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Re: Doubts

2011-08-09 Thread aditi garg
@Rohit and Rohit  : Thnk u so much:)

On Tue, Aug 9, 2011 at 5:50 PM, Rohit Srivastava wrote:

> @aditi since in the hierarchy m1 comes first so if it is a hit then we dont
> need to check m2 but in case of a miss 0.03*2 seconds are wasted while
> searching in m1 then that value is looked for in m2
> so i suppose the best answer is given by rohit jain. unless there is some
> missing data
>
> On Tue, Aug 9, 2011 at 5:41 PM, aditi garg wrote:
>
>> @Rohit: we wont include the miss time fr M2 then?
>>
>>
>> On Tue, Aug 9, 2011 at 5:36 PM, rohit jain wrote:
>>
>>> @aditi
>>>
>>> For the first question.
>>> The answer will be ((0.97 *2) + (0.03*2) +(0.03*100)) i.e 5 ns.
>>> The reason is that cache is accessed in the case of miss as well, so
>>> we need to include that time as well.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Re: Doubts

2011-08-09 Thread aditi garg
@Rohit: we wont include the miss time fr M2 then?

On Tue, Aug 9, 2011 at 5:36 PM, rohit jain  wrote:

> @aditi
>
> For the first question.
> The answer will be ((0.97 *2) + (0.03*2) +(0.03*100)) i.e 5 ns.
> The reason is that cache is accessed in the case of miss as well, so
> we need to include that time as well.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] Doubts

2011-08-09 Thread aditi garg
@Rohit:No...i directly copy pasted the ques...nothing else mentioned...and
what if thr ws sm miss penalty?what wud be the change in soution?

On Tue, Aug 9, 2011 at 1:37 PM, Rohit Srivastava wrote:

> @aditi did they mention any thing about miss penalty also in the question
> ??
>
>
> On Tue, Aug 9, 2011 at 11:48 AM, aditi garg wrote:
>
>> @aditya and dipankar: the ans given ws 500ns that is why i posted dis
>> ques...i ws getting the same ans...
>>
>>
>> On Tue, Aug 9, 2011 at 9:45 AM, ankit sambyal wrote:
>>
>>> @aditya : can u explain how u got c part as the answer for question 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.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] DBMS

2011-08-09 Thread aditi garg
2^m-1...??
Im not sure tho

On Tue, Aug 9, 2011 at 1:09 PM, krishna meena wrote:

> In an RDBMS with m attributes, how many superkeys are 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.
>
>


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



Re: [algogeeks] output help

2011-08-09 Thread aditi garg
I think it is because bit1 is only 1 bit fwide and whn u initialize it to
1,since MSB is 1 it treats it as a negative integer...Plz correct me if i am
wrong...

On Tue, Aug 9, 2011 at 12:24 PM, Rohit Srivastava wrote:

> #include
> #include
>
> int main()
> {
> struct value
> {
> int bit1:1;
> int bit3:4;
> int bit4:4;
> }bit={1,2,2};
> printf("%d %d %d\n",bit.bit1,bit.bit3,bit.bit4);
> getche();
> return 0;
> }
>  the above code gives output : -1 2 2
> any idea why???
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] Doubts

2011-08-08 Thread aditi garg
@aditya and dipankar: the ans given ws 500ns that is why i posted dis
ques...i ws getting the same ans...

On Tue, Aug 9, 2011 at 9:45 AM, ankit sambyal wrote:

> @aditya : can u explain how u got c part as the answer for question 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.
>



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



Re: [algogeeks] Doubts

2011-08-08 Thread aditi garg
can u explain ques 3 and 4?
Fr ques 3 why not interrupt servicing? and in 4 why not both?

On Tue, Aug 9, 2011 at 1:42 AM, Aditya Virmani wrote:

> 4.94 ns
> c
> c
> b
>
>
> On Tue, Aug 9, 2011 at 1:32 AM, aditi garg wrote:
>
>> Q1.in a memory hierarchy, M1,M2
>> M1 access time is 2 ns ,M2 accesstime is 100 ns . the hit ratio for
>> M1 is .97, then what's the avg access time?
>> Q2.two heaps of sizes m,n are given,
>> then the time needed to merge them
>> a)m
>> b)n
>> c)m+n
>> d) none
>> Q3.context switching is useful in
>> a) spooling
>> b) polling
>> c)interrupt handling
>> d) interrupt servicing
>>
>> Q4Reentrant os required
>> a)multitasking
>> b)multiuser
>> c)both
>> d)none
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



[algogeeks] Doubts

2011-08-08 Thread aditi garg
Q1.in a memory hierarchy, M1,M2
M1 access time is 2 ns ,M2 accesstime is 100 ns . the hit ratio for
M1 is .97, then what's the avg access time?
Q2.two heaps of sizes m,n are given,
then the time needed to merge them
a)m
b)n
c)m+n
d) none
Q3.context switching is useful in
a) spooling
b) polling
c)interrupt handling
d) interrupt servicing

Q4Reentrant os required
a)multitasking
b)multiuser
c)both
d)none

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

2011-08-08 Thread aditi garg
Q1.in a memory hierarchy, M1,M2
M1 access time is 2 ns ,M2 accesstime is 100 ns . the hit ratio for
M1 is .97, then what's the avg access time?
Q2.two heaps of sizes m,n are given,
then the time needed to merge them
a)m
b)n
c)m+n
d) none
Q3.context switching is useful in
a) spooling
b) polling
c)interrupt handling
d) interrupt servicing

Q4Reentrant os required
a)multitasking
b)multiuser
c)both
d)none

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



Re: [algogeeks] amazon question

2011-08-08 Thread aditi garg
@sagar: Thanx a lot

On Tue, Aug 9, 2011 at 12:15 AM, sagar pareek  wrote:

> *
> void main() {
>
> int p1= fork();
>
> if (p1 == 0) {
>
>  int p2 = fork();
>
>  if (p2 != 0) {
>
>   fork();
>
>  }
>
> }
>
> }
>
> for confirmation just make a diagram
>
>
> M
>   /  \
>  /\
> M  C1 > fork() 1st
> M>0   and  C1==0
>   /  \
> / \
>   /\
>  C1C2   --> fork()
> 2nd   C1>0   and  C2==0
> /  \
>    C1   C3   ---> fork()
> 3rd
> *
>
>
> On Tue, Aug 9, 2011 at 12:04 AM, aditi garg wrote:
>
>> well since i have told u i dont knw OS too well so i ws nt sure...bt if
>> suppose the condition (p1==0) is false thn only  1 child will be created??
>>
>>
>> On Mon, Aug 8, 2011 at 11:56 PM, ankit sambyal wrote:
>>
>>> @aditi : the ans is 3. Why do u think there is no definite ans ?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> **
> Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] amazon test question!!!

2011-08-08 Thread aditi garg
when f and g have been deleted wudnt the last condition left==null&&
right==null be satisfied fr c as well?

On Tue, Aug 9, 2011 at 12:01 AM, sagar pareek  wrote:

> Option 3 is correct :-
>
> suppose we have tree
>
>a
>/ \
> /   \
>  b  c
>/   \   /\
> d  e   fg
>
> now it will first delete g
> then it will delete f
>  now why would it delete c ?
> we are deleting f and g because both left and right are NULL of f and g
>
> but still c->left and c->right has address of f and g respectively
> (dangling pointer ) but if we check the condition
> (c->left==NULL&&c->right==NULL) , it will not satisfy hence c will not be
> deleted...
>
> so we  we have to do c->left=NULL and c->right=NULL before deleting
>
> pls correct me if i m wrong
>
>
>
> On Mon, Aug 8, 2011 at 11:23 PM, *$*  wrote:
>
>> I guess option 1 is correct
>>
>> Thx,
>> --Gopi
>>
>>
>> On Mon, Aug 8, 2011 at 11:07 PM, siddharam suresh <
>> siddharam@gmail.com> wrote:
>>
>>> func( Node *node){
>>>
>>> if( node->left == NULL && node->right == NULL )
>>>
>>> delete(node);
>>>
>>> if(node->right != NULL)
>>>
>>>   func( node->right);
>>>
>>>  if(node->left != NULL)
>>>
>>>func( node->left);
>>>
>>>
>>> }
>>>
>>> for this code option 3 is correct
>>>
>>> Thank you,
>>>  Siddharam
>>>
>>>
>>>
>>> On Mon, Aug 8, 2011 at 11:03 PM, rajul jain wrote:
>>>
>>>> This is what i am trying to say to debabrata
>>>>
>>>>
>>>> On Mon, Aug 8, 2011 at 10:56 PM, aditi garg 
>>>> wrote:
>>>>
>>>>> @debrata : bt remember its a recursive function...once the leaf node
>>>>> gets deleted thn it will move bak to the node and thn to the left of it
>>>>> fr eg
>>>>>   a
>>>>>/\
>>>>>   b c
>>>>> /  \/  \
>>>>>d   e  f   g
>>>>> frst g will be deleted...then f thn it wil delete c and so on...i think
>>>>> the ans shud be 1...correct me if i am wrong...
>>>>> On Mon, Aug 8, 2011 at 10:49 PM, Debabrata Das <
>>>>> debabrata.barunhal...@gmail.com> wrote:
>>>>>
>>>>>> check this condition
>>>>>> if( node->left == NULL && node->right == NULL )
>>>>>> it is true only for leaves node
>>>>>>
>>>>>> On Mon, Aug 8, 2011 at 10:46 PM, rajul jain 
>>>>>> wrote:
>>>>>> > I have also made same answer on first look but read 3rd  option
>>>>>> correctly it
>>>>>> > say deletion of leaves from right to left not internal nodes.
>>>>>> >
>>>>>> > On Mon, Aug 8, 2011 at 10:36 PM, Debabrata Das
>>>>>> >  wrote:
>>>>>> >>
>>>>>> >> i think 3
>>>>>> >>
>>>>>> >> On Mon, Aug 8, 2011 at 10:32 PM, rajul jain <
>>>>>> rajuljain...@gmail.com>
>>>>>> >> wrote:
>>>>>> >> > got it thanks
>>>>>> >> >
>>>>>> >> > On Mon, Aug 8, 2011 at 10:30 PM, Akash Mukherjee <
>>>>>> akash...@gmail.com>
>>>>>> >> > wrote:
>>>>>> >> >>
>>>>>> >> >> i think its 1 though ...
>>>>>> >> >>
>>>>>> >> >> On Mon, Aug 8, 2011 at 10:21 PM, rohit 
>>>>>> wrote:
>>>>>> >> >>>
>>>>>> >> >>> What will the following code snippet do, when is it passed the
>>>>>> root of
>>>>>> >> >>> a binary tree ?
>>>>>> >> >>> func( Node *node){
>>>>>> >> >>>
>>>>>> >> >>>  if(node->right != NULL)
>>>>>> >> >>>
>>>>>> >> >>>   func( node->right);

Re: [algogeeks] amazon question

2011-08-08 Thread aditi garg
well since i have told u i dont knw OS too well so i ws nt sure...bt if
suppose the condition (p1==0) is false thn only  1 child will be created??


On Mon, Aug 8, 2011 at 11:56 PM, ankit sambyal wrote:

> @aditi : the ans is 3. Why do u think there is no definite ans ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] amazon question

2011-08-08 Thread aditi garg
I dnt think thr wud be a definite ans

On Mon, Aug 8, 2011 at 11:26 PM, siddharam suresh
wrote:

> is it 3 ?
> Thank you,
> Siddharam
>
>
>
> On Mon, Aug 8, 2011 at 11:24 PM, rajul jain wrote:
>
>> How many Children process following program produce
>> *
>> void main() {
>>
>> int p1= fork();
>>
>> if (p1 == 0) {
>>
>>  int p2 = fork();
>>
>>  if (p2 != 0) {
>>
>>   fork();
>>
>>  }
>>
>> }
>>
>> }
>>
>>
>> *
>> On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal <
>> kamakshi...@gmail.com> wrote:
>>
>>> what will be the o/p of the following program:
>>>
>>> main()
>>> {
>>> int ret;
>>> ret=fork();
>>> ret=fork();
>>> ret=fork();
>>> ret=fork();
>>>
>>> if(!ret)
>>> printf("one");
>>> else
>>> printf("two");
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Kamakshi
>>> kamakshi...@gmail.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks]

2011-08-08 Thread aditi garg
try dis
http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi

On Mon, Aug 8, 2011 at 11:08 PM, sukran dhawan wrote:

> it has too many easy questions.any other site can u plz suggest?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] mcq

2011-08-08 Thread aditi garg
well u know wat a diagonal matrix is...so i guess fr suppose n=5 and k=2
principal diagonal will hv 5 elements,the diagonal abv it will have 4 and
anothr one abv it will hv 3 and similarly below... so total elemnts dat we
hv to store is 5+2x(4+3)=19
bt none of the gvn options satisfy :(

On Mon, Aug 8, 2011 at 11:05 PM, Kamakshii Aggarwal
wrote:

> i dint understand this question.i just cant understand what is the
> meaning of k-diaganol..
>
>
> On Mon, Aug 8, 2011 at 11:01 PM, aditi garg wrote:
>
>> well i ws trying to take some example and  thn verify...if i take 5x5
>> matrix and k=2...thn 6 elements will be empty right?or does dis ques mean
>> smthing else?
>>
>>
>> On Mon, Aug 8, 2011 at 10:58 PM, Kamakshii Aggarwal <
>> kamakshi...@gmail.com> wrote:
>>
>>> i copied it from net..i dint understand the question. ignore the
>>> options..are u able to solve it?
>>>
>>>
>>> On Mon, Aug 8, 2011 at 10:16 PM, aditi garg 
>>> wrote:
>>>
>>>> b) and c) options are same??
>>>>
>>>> On Mon, Aug 8, 2011 at 8:53 PM, Kamakshii Aggarwal <
>>>> kamakshi...@gmail.com> wrote:
>>>>
>>>>> A k-diagonal matrix is a n *n square matrix in which the elements on
>>>>> the principal diagonal and k diagonals above the
>>>>> principal diagonal and k diagonals below the principal diagonal only
>>>>> have none\ zero elements. Other elements are zero’s.
>>>>>  In order to save the space, the non zero elements are stored in a one
>>>>> dimensional array.
>>>>> The no of locations in this array are:
>>>>> (a) n*(n-k-1)/2
>>>>> (b) n*(n-1) – (n-k)(n-k-2)
>>>>> (c) n*(n-1) – (n-k)(n-k-2)
>>>>> (d) n*n – (n-k-1)
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Kamakshi
>>>>> kamakshi...@gmail.com
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Aditi Garg
>>>> Undergraduate Student
>>>> Electronics & Communication Divison
>>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>>> Sector 3, Dwarka
>>>> New Delhi
>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Kamakshi
>>> kamakshi...@gmail.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] mcq

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

On Mon, Aug 8, 2011 at 10:58 PM, Kamakshii Aggarwal
wrote:

> i copied it from net..i dint understand the question. ignore the
> options..are u able to solve it?
>
>
> On Mon, Aug 8, 2011 at 10:16 PM, aditi garg wrote:
>
>> b) and c) options are same??
>>
>> On Mon, Aug 8, 2011 at 8:53 PM, Kamakshii Aggarwal > > wrote:
>>
>>> A k-diagonal matrix is a n *n square matrix in which the elements on the
>>> principal diagonal and k diagonals above the
>>> principal diagonal and k diagonals below the principal diagonal only have
>>> none\ zero elements. Other elements are zero’s.
>>>  In order to save the space, the non zero elements are stored in a one
>>> dimensional array.
>>> The no of locations in this array are:
>>> (a) n*(n-k-1)/2
>>> (b) n*(n-1) – (n-k)(n-k-2)
>>> (c) n*(n-1) – (n-k)(n-k-2)
>>> (d) n*n – (n-k-1)
>>>
>>> --
>>> Regards,
>>> Kamakshi
>>> kamakshi...@gmail.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] amazon test question!!!

2011-08-08 Thread aditi garg
@debrata : bt remember its a recursive function...once the leaf node gets
deleted thn it will move bak to the node and thn to the left of it
fr eg
  a
   /\
  b c
/  \/  \
   d   e  f   g
frst g will be deleted...then f thn it wil delete c and so on...i think the
ans shud be 1...correct me if i am wrong...
On Mon, Aug 8, 2011 at 10:49 PM, Debabrata Das <
debabrata.barunhal...@gmail.com> wrote:

> check this condition
> if( node->left == NULL && node->right == NULL )
> it is true only for leaves node
>
> On Mon, Aug 8, 2011 at 10:46 PM, rajul jain 
> wrote:
> > I have also made same answer on first look but read 3rd  option correctly
> it
> > say deletion of leaves from right to left not internal nodes.
> >
> > On Mon, Aug 8, 2011 at 10:36 PM, Debabrata Das
> >  wrote:
> >>
> >> i think 3
> >>
> >> On Mon, Aug 8, 2011 at 10:32 PM, rajul jain 
> >> wrote:
> >> > got it thanks
> >> >
> >> > On Mon, Aug 8, 2011 at 10:30 PM, Akash Mukherjee 
> >> > wrote:
> >> >>
> >> >> i think its 1 though ...
> >> >>
> >> >> On Mon, Aug 8, 2011 at 10:21 PM, rohit 
> wrote:
> >> >>>
> >> >>> What will the following code snippet do, when is it passed the root
> of
> >> >>> a binary tree ?
> >> >>> func( Node *node){
> >> >>>
> >> >>>  if(node->right != NULL)
> >> >>>
> >> >>>   func( node->right);
> >> >>>
> >> >>>  if(node->left != NULL)
> >> >>>
> >> >>>func( node->left);
> >> >>>
> >> >>>  if( node->left == NULL && node->right == NULL )
> >> >>>
> >> >>> delete(node);
> >> >>>
> >> >>> }
> >> >>>
> >> >>> Pick choice
> >> >>> Delete the tree from bottom to top
> >> >>>
> >> >>> Delete the tree from top to bottom
> >> >>>
> >> >>> Delete the leaf nodes from right to left
> >> >>>
> >> >>> Delete the leaf nodes from left to right
> >> >>>
> >> >>> I think it is 3
> >> >>>
> >> >>> --
> >> >>> You received this message because you are subscribed to the Google
> >> >>> Groups
> >> >>> "Algorithm Geeks" group.
> >> >>> To post to this group, send email to algogeeks@googlegroups.com.
> >> >>> To unsubscribe from this group, send email to
> >> >>> algogeeks+unsubscr...@googlegroups.com.
> >> >>> For more options, visit this group at
> >> >>> http://groups.google.com/group/algogeeks?hl=en.
> >> >>>
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups
> >> >> "Algorithm Geeks" group.
> >> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> >> To unsubscribe from this group, send email to
> >> >> algogeeks+unsubscr...@googlegroups.com.
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/algogeeks?hl=en.
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Algorithm Geeks" group.
> >> > To post to this group, send email to algogeeks@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > algogeeks+unsubscr...@googlegroups.com.
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/algogeeks?hl=en.
> >> >
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Algorithm Geeks" group.
> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> algogeeks+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/algogeeks?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] mcq

2011-08-08 Thread aditi garg
b) and c) options are same??

On Mon, Aug 8, 2011 at 8:53 PM, Kamakshii Aggarwal wrote:

> A k-diagonal matrix is a n *n square matrix in which the elements on the
> principal diagonal and k diagonals above the
> principal diagonal and k diagonals below the principal diagonal only have
> none\ zero elements. Other elements are zero’s.
>  In order to save the space, the non zero elements are stored in a one
> dimensional array.
> The no of locations in this array are:
> (a) n*(n-k-1)/2
> (b) n*(n-1) – (n-k)(n-k-2)
> (c) n*(n-1) – (n-k)(n-k-2)
> (d) n*n – (n-k-1)
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Re: amazon question

2011-08-08 Thread aditi garg
@sagar thanx :)

On Mon, Aug 8, 2011 at 9:01 PM, sagar pareek  wrote:

> @aditi
> nope... it will run in parallel...so order is not fix
>
>
> On Mon, Aug 8, 2011 at 8:48 PM, Pradeep Mishra 
> wrote:
>
>> no it'll vary as the PID will vary from parent to child.
>>
>>
>>
>> On Mon, Aug 8, 2011 at 8:05 AM, aditi garg wrote:
>>
>>> i was asking about the order in printfso it wud be like 8times  one
>>> and then 8 times two?
>>>
>>>
>>> On Mon, Aug 8, 2011 at 8:23 PM, sagar pareek wrote:
>>>
>>>>
>>>>
>>>>  M
>>>>
>>>> / \
>>>>
>>>> /\
>>>>
>>>> /\
>>>>
>>>> / \
>>>>
>>>> / \
>>>>
>>>> /  \
>>>>
>>>> /  \
>>>>M
>>>> C1
>>>> /   \
>>>> /\
>>>>/
>>>> \   /  \
>>>>  /
>>>> \  /\
>>>> /
>>>> \  / \
>>>>   M
>>>> C2   C1 C3
>>>>  /  \
>>>> /  \   / \   / 
>>>> \
>>>> /\
>>>> / \/  \
>>>> /\
>>>>   M   C4
>>>> C2 C5   C1C6  C3 C7
>>>> /\ /\/
>>>> \/ \/  \ /   \   /
>>>> \ /   \
>>>>  M C8  C4  C9   C2  C10  C5 C11 C1
>>>> C12  C6  C13  C4  C14  C7  C15
>>>>
>>>>
>>>> M C4 C2 C5 C1 C6 C3 C7  (one level upper will have ret>0  and rest will
>>>> have ret =0
>>>>
>>>>  Just think ur self how any process and its child have pid==0 ???
>>>>
>>>>
>>>> I hope its clear now...
>>>>
>>>>
>>>> On Mon, Aug 8, 2011 at 8:05 PM, aditi garg 
>>>> wrote:
>>>>
>>>>> @ sagar: wat wud be the order? as in all 8 frst wud return non zero and
>>>>> rest 0 or wat?
>>>>>
>>>>>
>>>>> On Mon, Aug 8, 2011 at 6:50 PM, Kamakshii Aggarwal <
>>>>> kamakshi...@gmail.com> wrote:
>>>>>
>>>>>> ok ..thanks sagar..:)
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 8, 2011 at 6:42 PM, sagar pareek 
>>>>>> wrote:
>>>>>>
>>>>>>> lets label your forks :-
>>>>>>> main()
>>>>>>> {
>>>>>>> int ret;
>>>>>>> ret=fork();  -- 1
>>>>>>> ret=fork();  -- 2
>>>>>>> ret=fork(); --- 3
>>>>>>> ret=fork(); --- 4
>>>>>>>
>>>>>>> if(!ret)
>>>>>>> printf("one");
>>>>>>> else
>>>>>>> printf("two");
>>>>>>> }
>>>>>>>
>>>>>>> Now
>>>>>>> original main() is suppose named  M
>>>>>>> then after encountering fork() 1st then
>>>>>>>
>>>>>>>
>>>>>>>  M
>>>>>>>
>>>>>>> / \
>>>>>>>
>>>>>>> /   

Re: [algogeeks] Re: amazon question

2011-08-08 Thread aditi garg
i was asking about the order in printfso it wud be like 8times  one and
then 8 times two?

On Mon, Aug 8, 2011 at 8:23 PM, sagar pareek  wrote:

>
>
>  M
>
> / \
>
> /\
>
> /\
>
> / \
>
> / \
>
> /  \
>
> /  \
>M
>   C1
> /   \
>   /\
>/
> \   /  \
>  /
> \  /\
> /
> \  / \
>   M  C2
>   C1 C3
> /  \
> /  \   / \   / \
> /\
> / \/  \
> /\
>   M   C4C2
> C5   C1C6  C3 C7
> /\ /\/
> \/ \/  \ /   \   /
> \ /   \
>  M C8  C4  C9   C2  C10  C5 C11 C1 C12
> C6  C13  C4  C14  C7  C15
>
>
> M C4 C2 C5 C1 C6 C3 C7  (one level upper will have ret>0  and rest will
> have ret =0
>
>  Just think ur self how any process and its child have pid==0 ???
>
>
> I hope its clear now...
>
>
> On Mon, Aug 8, 2011 at 8:05 PM, aditi garg wrote:
>
>> @ sagar: wat wud be the order? as in all 8 frst wud return non zero and
>> rest 0 or wat?
>>
>>
>> On Mon, Aug 8, 2011 at 6:50 PM, Kamakshii Aggarwal > > wrote:
>>
>>> ok ..thanks sagar..:)
>>>
>>>
>>> On Mon, Aug 8, 2011 at 6:42 PM, sagar pareek wrote:
>>>
>>>> lets label your forks :-
>>>> main()
>>>> {
>>>> int ret;
>>>> ret=fork();  -- 1
>>>> ret=fork();  -- 2
>>>> ret=fork(); --- 3
>>>> ret=fork(); --- 4
>>>>
>>>> if(!ret)
>>>> printf("one");
>>>> else
>>>> printf("two");
>>>> }
>>>>
>>>> Now
>>>> original main() is suppose named  M
>>>> then after encountering fork() 1st then
>>>>
>>>>
>>>>  M
>>>>
>>>> / \
>>>>
>>>> /\
>>>>
>>>> /\
>>>>
>>>> M C1
>>>>
>>>>
>>>> now after fork() -2
>>>>
>>>>
>>>> M
>>>>
>>>> / \
>>>>
>>>> /\
>>>>
>>>> /\
>>>>
>>>> M C1
>>>>
>>>> /   \ /\
>>>>
>>>> M  C2C1 C3
>>>>
>>>>
>>>> after fork()- 4
>>>>
>>>> it will  be
>>>>  M
>>>> C1C2 C3.. C15
>>>>now   we have half of them include main() have ret!=0
>>>> and rest of them ret=0
>>>>
>>>> i hope its clear now...
>>>>
>>>>
>>>> On Mon, Aug 8, 2011 at 12:53 PM, Shachindra A C 
>>>> wrote:
>>>>
>>>>> At the point of execution of the 4th fork(), there are 8 processes i.e,
>>>>> the 4th fork will get executed 8 times. The final value of ret will depend
>>>>> on this fork. the fork will return 0 in the 8 child processes created and
>>>>> returns pid of the child in the parent processes.
>>>>>
>>>>>
>>>>> On Mon, Aug 8, 2011 at 12:49 PM, Kamakshii Aggarwal <
>>>>> kamaksh

Re: [algogeeks] Amazon Question

2011-08-08 Thread aditi garg
2.b
3.c
4.c

On Mon, Aug 8, 2011 at 8:12 PM, sagar pareek  wrote:

> 1. O(n)
> 2. b
> 4  c
>
> On Mon, Aug 8, 2011 at 8:08 PM, programming love <
> love.for.programm...@gmail.com> wrote:
>
>> 1. O(n)
>> 2.b
>> 4.c
>>
>>
>> On Mon, Aug 8, 2011 at 7:24 PM, ankit sambyal wrote:
>>
>>> Plz give the answers ...
>>>
>>> 1. In a binary max heap containing n numbers, the smallest element can
>>> be found in time ??
>>>
>>>
>>> 2. The number of total nodes in a complete balanced binary tree with n
>>> levels is,
>>>   a)3^n + 1
>>>   b)2^(n+1) - 1
>>>   c) 2^n + 1
>>>   d) none of above
>>>
>>> 3. In a country where everyone wants a boy, each family continues having
>>> babies till they have a boy. After some time, what is the proportion of boys
>>> to girls in the country? (Assuming probability of having a boy or a girl is
>>> the same)
>>>   a) 1:2
>>>   b) 2:1
>>>   c)1:1
>>>   d)1:4
>>>
>>>
>>> 4. A parallel program consists of 8 tasks – T1 through T8. Each task
>>> requires one time step to be executed on a single processor. Let X -> Y
>>> denote the fact that task X must be executed before task Y is executed.
>>> Suppose only the tasks X, Y are to be executed. On any multiprocessor
>>> machine it would require at least 2 time steps since in the first step X
>>> could be executed, and Y could be executed in the next time step (since it
>>> requires X to complete first). Now, suppose the following dependencies exist
>>> between the tasks T1 – T8:
>>>
>>> T1 -> T2
>>>
>>> T2 -> T3
>>>
>>> T3 -> T6
>>>
>>> T2 -> T4
>>>
>>> T4 -> T7
>>>
>>> T2 -> T5
>>>
>>> T5 -> T8
>>>
>>> What is the minimum number of time steps required to execute these 8
>>> tasks on a 2 processor machine and a 4 processor machine?
>>>
>>>
>>> a)4 & 2
>>>
>>> b)5 & 2
>>>
>>> c)5 & 4
>>>
>>> d)6 & 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.
>>
>
>
>
> --
> **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.
>



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



Re: [algogeeks] find nth node frm the last

2011-08-08 Thread aditi garg
lets say u have 10 nodes 1->2->3->4->5->6->7->8->9->10
and u have to find 6th node from the end
 what this code is doing is its taking two pointers,current and behind...its
frst moving current to 6 places...now current reaches to the 6th node after
the frst loop...now u strt the second pointer ie behind from head and move
both current and head until current reaches nullso if u c in this
example current is pointing to 6th node right now it will move 4 places and
reach the end and in the mean time behind will reach the 4th node...hence
finally behind points to 4th node whch is 6th node from the end...i hope u
get it...

On Mon, Aug 8, 2011 at 8:08 PM, sukran dhawan wrote:

> struct node * fun(struct node * list,int n)
>
>
>
> On Mon, Aug 8, 2011 at 8:06 PM, jagrati verma  > wrote:
>
>> hw is it possible frm this code ???/
>>
>>
>>
>>
>> Node * findNToLastNode( Node *head, int N )
>> {
>>int i = 0;
>>Node *current, *behind;
>>current = head;
>>for( i = 0; i < N; i++ ) {
>>if( current->next ) {
>>current = current->next;
>>} else {
>>return NULL;  // Length of the list is less
>> than N
>>}
>>}
>>
>>behind = head;
>>while( current->next ) {
>>current = current->next;
>>behind = behind->next;
>>}
>>
>>return behind;
>> }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] Re: amazon question

2011-08-08 Thread aditi garg
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Kamakshi
>>>> kamakshi...@gmail.com
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Shachindra A C
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
oh @ akshay y ru doing 10x4??? 10 is the no of rows not the columns so it
shud be 15x3+4...and by multiplying by 4(in 10x4) ur taking it to the 5th
row ie A[4][4] its only A[3][4]...
i hope its clear now


On Sun, Aug 7, 2011 at 12:14 AM, akshay khatri wrote:

>
>
> On 6 August 2011 23:56, aditi garg  wrote:
>
>> @akshay: what i meant ws suppose the array strted from  in
>> decimal...so A[3][4] wud be at 0049 and B[3][4] will be at 0196
>> convert dese 2 values to hex it gives 31 and C4 respectively...now base
>> address is 1000 and 2000 instead if  so add the base address and u get
>> the ans 1031 and 20C4...i hope its clear now...
>>
>
> I still don't get how you got the figures of 49 and 196
>
> I calculated as follows
> A[3][4] = 10x4 + 4 = 44 bytes
> B[3][4] = (10x4 + 4 )x4 = 176
>
>>
>>
>> On Sat, Aug 6, 2011 at 11:49 PM, akshay khatri > > wrote:
>>
>>>
>>>
>>> On 6 August 2011 23:40, aditi garg  wrote:
>>>
>>>> A[3][4] wud be in the 4th row...so strtung address of 4th row wud be
>>>> 46..and thn 4th element wud be at 49...similarly fr B 180 fr the frst 3 
>>>> rows
>>>> + 16 fr the 4th elemnet so 196
>>>>
>>>
>>> How does it start from 46 and 180 ?
>>> as per my knowledge, 0x1000 = 4096 and 0x2000 is 8192
>>>
>>>
>>>>
>>>>  On Sat, Aug 6, 2011 at 11:37 PM, akshay khatri <
>>>> akshaykhatri...@gmail.com> wrote:
>>>>
>>>>> how is that 49 bytes and 196 bytes
>>>>> shouldn't it be 44 and 176 bytes respectively
>>>>>
>>>>>
>>>>> On 6 August 2011 23:26, Ram Chauhan  wrote:
>>>>>
>>>>>> 1049 and 1098
>>>>>>
>>>>>> On Sat, Aug 6, 2011 at 11:09 PM, aditi garg <
>>>>>> aditi.garg.6...@gmail.com> wrote:
>>>>>>
>>>>>>> CHAR A[10][15] AND INT B[10][15] IS DEFINED
>>>>>>> WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
>>>>>>> IF ADDRESS OF A IS OX1000 AND B IS 0X2000
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>>
>>>>>>>
>>>>>>  --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Algorithm Geeks" group.
>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to
>>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>
>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Aditi Garg
>>>> Undergraduate Student
>>>> Electronics & Communication Divison
>>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>>> Sector 3, Dwarka
>>>> New Delhi
>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
&g

Re: [algogeeks] Header Files

2011-08-06 Thread aditi garg
Thanks a lot :)

On Sat, Aug 6, 2011 at 11:53 PM, ankit sambyal wrote:

> yeah Siddarath's point is correct that they do hv preprocessors to prevent
> multiple includes. And they would be using #ifndef instead of #pragma as it
> is not a documented standard
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
@akshay: what i meant ws suppose the array strted from  in decimal...so
A[3][4] wud be at 0049 and B[3][4] will be at 0196
convert dese 2 values to hex it gives 31 and C4 respectively...now base
address is 1000 and 2000 instead if  so add the base address and u get
the ans 1031 and 20C4...i hope its clear now...

On Sat, Aug 6, 2011 at 11:49 PM, akshay khatri wrote:

>
>
> On 6 August 2011 23:40, aditi garg  wrote:
>
>> A[3][4] wud be in the 4th row...so strtung address of 4th row wud be
>> 46..and thn 4th element wud be at 49...similarly fr B 180 fr the frst 3 rows
>> + 16 fr the 4th elemnet so 196
>>
>
> How does it start from 46 and 180 ?
> as per my knowledge, 0x1000 = 4096 and 0x2000 is 8192
>
>
>>
>> On Sat, Aug 6, 2011 at 11:37 PM, akshay khatri > > wrote:
>>
>>> how is that 49 bytes and 196 bytes
>>> shouldn't it be 44 and 176 bytes respectively
>>>
>>>
>>> On 6 August 2011 23:26, Ram Chauhan  wrote:
>>>
>>>> 1049 and 1098
>>>>
>>>> On Sat, Aug 6, 2011 at 11:09 PM, aditi garg 
>>>> wrote:
>>>>
>>>>> CHAR A[10][15] AND INT B[10][15] IS DEFINED
>>>>> WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
>>>>> IF ADDRESS OF A IS OX1000 AND B IS 0X2000
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> algogeeks+unsubscr...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



Re: [algogeeks] xplanation plz

2011-08-06 Thread aditi garg
@saurabh
http://ideone.com/J0gNi
its jst pointing to same address bt it has not modified the value...chk the
abv link...

On Sat, Aug 6, 2011 at 8:13 PM, saurabh singh  wrote:

>
> http://ideone.com/Wszkg
>
> On Sat, Aug 6, 2011 at 8:03 PM, jagrati verma  > wrote:
>
>> how can modify constant variable with the help of pointers.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
A[3][4] wud be in the 4th row...so strtung address of 4th row wud be 46..and
thn 4th element wud be at 49...similarly fr B 180 fr the frst 3 rows + 16 fr
the 4th elemnet so 196

On Sat, Aug 6, 2011 at 11:37 PM, akshay khatri wrote:

> how is that 49 bytes and 196 bytes
> shouldn't it be 44 and 176 bytes respectively
>
>
> On 6 August 2011 23:26, Ram Chauhan  wrote:
>
>> 1049 and 1098
>>
>> On Sat, Aug 6, 2011 at 11:09 PM, aditi garg wrote:
>>
>>> CHAR A[10][15] AND INT B[10][15] IS DEFINED
>>> WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
>>> IF ADDRESS OF A IS OX1000 AND B IS 0X2000
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



[algogeeks] Header Files

2011-08-06 Thread aditi garg
I have read that to avoid multiple declaration error we write #pragma
once in header files or use #ifndef and #def to make sure that the
header file is included only once...
i tried running a prog in whch i included stdio.h thrice bt it dint gv
any error...does dat mean we have #pragma once in every header file??

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

2011-08-06 Thread aditi garg
@ankit ur ans is fine bt u missed a point that dey are calculating in hex so
convert ur ans to hex and it will be the same as the one i posted...
@siddharth...A[3][4] will be 49 bytes ahead of the base address...and 49 in
hex is 31 so ans will be 1031
and int (assuming 4 bytes) the value B[3][4] will be 196 bytes ahead of base
address whch in hex is C 4 hence the ans 20C4...
I hope its clear

On Sat, Aug 6, 2011 at 11:18 PM, siddharth srivastava
wrote:

>
>
> On 6 August 2011 23:15, aditi garg  wrote:
>
>> No the ans is 1031 and 20C4...
>> i got it btw...thanx :)
>>
>
> explain ?
>
>>
>>
>> On Sat, Aug 6, 2011 at 11:13 PM, Aditya Virmani > > wrote:
>>
>>> 1033,2066?
>>>
>>>
>>> On Sat, Aug 6, 2011 at 11:09 PM, aditi garg 
>>> wrote:
>>>
>>>> CHAR A[10][15] AND INT B[10][15] IS DEFINED
>>>> WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
>>>> IF ADDRESS OF A IS OX1000 AND B IS 0X2000
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> 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.
>



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



Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
No the ans is 1031 and 20C4...
i got it btw...thanx :)

On Sat, Aug 6, 2011 at 11:13 PM, Aditya Virmani wrote:

> 1033,2066?
>
>
> On Sat, Aug 6, 2011 at 11:09 PM, aditi garg wrote:
>
>> CHAR A[10][15] AND INT B[10][15] IS DEFINED
>> WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
>> IF ADDRESS OF A IS OX1000 AND B IS 0X2000
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

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



[algogeeks] address calculation

2011-08-06 Thread aditi garg
CHAR A[10][15] AND INT B[10][15] IS DEFINED
WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
IF ADDRESS OF A IS OX1000 AND B IS 0X2000

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