Re: [algogeeks] Re: adobe

2011-08-05 Thread sagar pareek
please anyone of you post more question asked by adobe this yr...
please

On Sat, Aug 6, 2011 at 12:24 PM, Nikhil Gupta wrote:

> @sumit, these numbers containing all ones are not in binary representation.
> They are in decimal system.
>
>
> On Sat, Aug 6, 2011 at 9:51 AM, sahil gujral wrote:
>
>> yes u r wrong..
>> 1 is nt divisible by 23
>>
>>
>> On Sat, Aug 6, 2011 at 9:15 AM, sumit  wrote:
>>
>>> This looks quite simple.
>>> Every number ending in 3 follows a pattern.eg-
>>> 3 - 111
>>> 13 - 11
>>> 23 - 1 etc
>>> we can find the reauired no. by :
>>> suppose input no. is 33
>>> In every case leave the no at 1's place(least significant) i.e. 3, In
>>> 33 you will be left with 3(after removal of 3 at first place).
>>> Now ,3 *(rest of nos +1 ) is your answer (in case of 33 it is 3*(3+1)
>>> = 12 i.e  ).
>>> for 103 it is 3*(10+1) = 33 1's.
>>>
>>> Correct if I am wrong.
>>>
>>>
>>> On Aug 5, 4:33 pm, Manee  wrote:
>>> > ADOBE asks the very basic C/C++ questions
>>> >
>>> > one of their toughest however was :
>>> >
>>> > every number ending in 3 has a multiple of the form "111...111"
>>> >
>>> > e.g 3 has 111
>>> >  13 has 11
>>> > so on..
>>> >
>>> > find the algo for finding the number for an input number ending in 3.
>>> >
>>> > On Aug 5, 2:33 pm, Agyat  wrote:
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > > hey, guys adobe is visiting our campus. So those who know questions
>>> > > that adobe asked in written or interview, please post here as it will
>>> > > be of great help (as adobe has visited some colleges already).
>>> > > Thank you 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.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Nikhil Gupta
> Senior Co-ordinator, Publicity
> CSI, NSIT Students' Branch
> NSIT, New Delhi, India
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Microsoft :)

2011-08-05 Thread sagar pareek
congrates

On Sat, Aug 6, 2011 at 12:18 PM, dilip makwana wrote:

> Congrats dude  and goodluck !!
>
>
> On 6 August 2011 12:16, veera reddy  wrote:
>
>> congrats man ...
>>
>>
>> On Sat, Aug 6, 2011 at 12:15 PM, Harshal  wrote:
>>
>>> Algogeeks is really awesome and very informative. I got a job in
>>> microsoft, and this group has played vital role in building concepts. So I
>>> just want to thank this group and the people here..
>>> keep it up guys! All the best :)
>>>
>>>
>>> --
>>> Best Regards,
>>> Harshal Choudhary
>>> 7th Semester, CSE Dept.
>>> NIT Surathkal, India.
>>> "The road to knowledge runs through the land of confusion."
>>>
>>> Mobile: +91 9844667142
>>> Email : hc4...@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 ,
>> P  Veera Reddy Devagiri
>> Senior Under Graduate
>> Computer Science and Engineering
>> IIIT Hyderabad
>> Mobile no-+91-9492024783
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> *Dilip Makwana*
> VJTI
> BTech Computers Engineering
> 2009-2013
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Re: adobe

2011-08-05 Thread Nikhil Gupta
@sumit, these numbers containing all ones are not in binary representation.
They are in decimal system.

On Sat, Aug 6, 2011 at 9:51 AM, sahil gujral  wrote:

> yes u r wrong..
> 1 is nt divisible by 23
>
>
> On Sat, Aug 6, 2011 at 9:15 AM, sumit  wrote:
>
>> This looks quite simple.
>> Every number ending in 3 follows a pattern.eg-
>> 3 - 111
>> 13 - 11
>> 23 - 1 etc
>> we can find the reauired no. by :
>> suppose input no. is 33
>> In every case leave the no at 1's place(least significant) i.e. 3, In
>> 33 you will be left with 3(after removal of 3 at first place).
>> Now ,3 *(rest of nos +1 ) is your answer (in case of 33 it is 3*(3+1)
>> = 12 i.e  ).
>> for 103 it is 3*(10+1) = 33 1's.
>>
>> Correct if I am wrong.
>>
>>
>> On Aug 5, 4:33 pm, Manee  wrote:
>> > ADOBE asks the very basic C/C++ questions
>> >
>> > one of their toughest however was :
>> >
>> > every number ending in 3 has a multiple of the form "111...111"
>> >
>> > e.g 3 has 111
>> >  13 has 11
>> > so on..
>> >
>> > find the algo for finding the number for an input number ending in 3.
>> >
>> > On Aug 5, 2:33 pm, Agyat  wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > hey, guys adobe is visiting our campus. So those who know questions
>> > > that adobe asked in written or interview, please post here as it will
>> > > be of great help (as adobe has visited some colleges already).
>> > > Thank you 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.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India

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



Re: [algogeeks] Re: directi prepration

2011-08-05 Thread sagar pareek
https://groups.google.com/forum/#!msg/algogeeks/KOKntrkVANs/acgqxPRHBAMJ

On Sat, Aug 6, 2011 at 12:03 PM, Nitish Garg wrote:

> Don't know about this time, but last year the students applying for interns
> were asked to solve some puzzles on their site and apply online only. They
> didn't conduct any kind of test on campus.
>
> Nitish Garg
> 4th Year, IT
> Delhi College of Engineering
>
> --
> 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/-/c3mNFdT__O8J.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Microsoft :)

2011-08-05 Thread dilip makwana
Congrats dude  and goodluck !!

On 6 August 2011 12:16, veera reddy  wrote:

> congrats man ...
>
>
> On Sat, Aug 6, 2011 at 12:15 PM, Harshal  wrote:
>
>> Algogeeks is really awesome and very informative. I got a job in
>> microsoft, and this group has played vital role in building concepts. So I
>> just want to thank this group and the people here..
>> keep it up guys! All the best :)
>>
>>
>> --
>> Best Regards,
>> Harshal Choudhary
>> 7th Semester, CSE Dept.
>> NIT Surathkal, India.
>> "The road to knowledge runs through the land of confusion."
>>
>> Mobile: +91 9844667142
>> Email : hc4...@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 ,
> P  Veera Reddy Devagiri
> Senior Under Graduate
> Computer Science and Engineering
> IIIT Hyderabad
> Mobile no-+91-9492024783
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Microsoft :)

2011-08-05 Thread veera reddy
congrats man ...

On Sat, Aug 6, 2011 at 12:15 PM, Harshal  wrote:

> Algogeeks is really awesome and very informative. I got a job in microsoft,
> and this group has played vital role in building concepts. So I just want to
> thank this group and the people here..
> keep it up guys! All the best :)
>
>
> --
> Best Regards,
> Harshal Choudhary
> 7th Semester, CSE Dept.
> NIT Surathkal, India.
> "The road to knowledge runs through the land of confusion."
>
> Mobile: +91 9844667142
> Email : hc4...@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 ,
P  Veera Reddy Devagiri
Senior Under Graduate
Computer Science and Engineering
IIIT Hyderabad
Mobile no-+91-9492024783

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

2011-08-05 Thread Puneet Gautam
Its quite long... but its simple...
pls tell me its worst case time complexity..!!!

#include
#include
#include
#include
int check(char *p,int n)// this function checks for pallindromicity of
the string passed.
{
   char a[100],b[100];
   int k;
   for(k=0;k<=n;k++)
   b[k]=(p[k]);
   b[k]=NULL;
   for(k=0;k<=n;k++)
   a[k]=(b[n-k]);
   a[k]=NULL;
   k=strcmp(a,b);
   printf("\n%s %s,%d",b,a,k);
   return k;
   }

main()
{
 char str[100];
 scanf("%s",&str);
 int N,cuts=0,i=0,j,r,index,pall[10],k=0;
 N=strlen(str);
 while(ii;)
 {
   if(str[i]==str[j])
   {
   if((r=check((&str[i]),(j-i)))==0)
{if(j==N-1)
   { cuts=-1;j=N;
printf("Cuts=0");.//string itself is pallindrome
 getch();   exit(0);
}
   else{
 cuts++;
pall[k]=i;
 pall[k+1]=j;
 i=j+1;
 j=N-1;
   k+=2;   continue;}
  }
}
 j--;
 }
 i++;
 }
 if(cuts==0)
printf("\nMinimum cuts=%d",N-1);
 else
 {
 for(i=0;ihttp://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Microsoft :)

2011-08-05 Thread Harshal
Algogeeks is really awesome and very informative. I got a job in microsoft,
and this group has played vital role in building concepts. So I just want to
thank this group and the people here..
keep it up guys! All the best :)


-- 
Best Regards,
Harshal Choudhary
7th Semester, CSE Dept.
NIT Surathkal, India.
"The road to knowledge runs through the land of confusion."

Mobile: +91 9844667142
Email : hc4...@gmail.com


  


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



[algogeeks] Paypal interview Questions

2011-08-05 Thread swetha rahul
Hi,

Q.No:1
 what is wrong here
void foo(int x=10,int y)
how compiler will treat it??
and what happen here
void foo(int x=10,int y=20)

Q.No:2
How to remove duplicate elements from an array in just one pass.. Take care
of time and space complexity..

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 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-05 Thread Nitish Garg
Don't know about this time, but last year the students applying for interns 
were asked to solve some puzzles on their site and apply online only. They 
didn't conduct any kind of test on campus.

Nitish Garg
4th Year, IT
Delhi College of Engineering 

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

2011-08-05 Thread sagar pareek
Ok thats a diff thing
but what i posted is somewhat different

actually what happen is that .5 can be represented completely in binary form
and the same case with 1.0 and .25 , .125 also
but when we talk about .7 then it cant be represented in binary precisely
even we upgrade it to double.
thats why a==.5? works but not c==.7?


On Sat, Aug 6, 2011 at 10:40 AM, saurabh singh  wrote:

> a double has a higher precision than float i.e. it has larger number of
> bits for the mantisa part.
> when float is compared to double it is promoted to double by filling
> remaining bits in mantissa with 0.
> consider this code
>
> http://ideone.com/y1Ahu
> Its equal bcoz the higher bits will be 0 for both
> double and float.
> similar result occurs for 0.25 0.75 0.10 etc,.
>
> On Sat, Aug 6, 2011 at 10:26 AM, sagar pareek wrote:
>
>> @saurabh
>>
>> what? i didnt get you
>>
>>
>> On Sat, Aug 6, 2011 at 10:22 AM, saurabh singh wrote:
>>
>>> IEEE notation..
>>> they appear to be the same but they are not same..0.5d has higher
>>> precision that does not necessarily means its larger..
>>>
>>>
>>> On Sat, Aug 6, 2011 at 10:20 AM, sagar pareek wrote:
>>>
 see what piyush posted


 On Sat, Aug 6, 2011 at 4:35 AM, Shashank Jain wrote:

> sagar - i dint get u, d code thing!
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
>
>
> On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek wrote:
>
>> yup exactly
>>
>> On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor wrote:
>>
>>> I think it is because the numbers like 0.7 do not have a exact binary
>>> representation,so they are not exactly represented in float,while the
>>> constant is internally implemented as double.,Read this::
>>> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals
>>>
>>>
>>> --
>>> *Regards,*
>>> *Piyush Kapoor,*
>>> *2nd year,CSE
>>> IT-BHU*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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

>>>
>>>
>>>
>>> --
>>> Saurabh Singh
>>> B.Tech (Computer Science)
>>> MNNIT ALLAHABAD
>>>
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>  --
> You received this message because you are subscribed to the Google Gr

Re: [algogeeks] pls help

2011-08-05 Thread mohit verma
ohh  my bad... it is working fine for all cases :)

On Sat, Aug 6, 2011 at 11:56 AM, mohit verma  wrote:

> what if the alphabet is {a,b,c,d} and we have to print substrings of length
> 2 or 3 ?
>
>
> On Sat, Aug 6, 2011 at 11:01 AM, Tushar Bindal wrote:
>
>> @gaurav
>> didn't get this:
>>
>> Just to increase the size of the string by one.
>>
>> Then you can put any character at the the new last position, which is 'l'.
>>
>> can u pls explain that?
>>
>>
>> On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan 
>> wrote:
>>
>>> Ok, Thanks
>>>
>>>
>>> On Fri, Aug 5, 2011 at 2:53 PM, Gaurav Menghani <
>>> gaurav.mengh...@gmail.com> wrote:
>>>
 Even if the number of elements is more than two, it is possible with
 bitwise operations, but it gets clumsy.

 Suppose your alphabet has 4 characters. You can either:
 - Count from 0 to (1<<4*n)-1 and use four bits to denote the selection
 of the alphabet. Also, only one bit amongst those four should be set.
 It is highly inefficient.
 - Keep n nested loops and inside each loop you iterate from 0 to
 (1<<4)-1 and use the standard bitwise operations. The con here is that
 you have to hardcode the number of nested loops.

 On Fri, Aug 5, 2011 at 2:44 PM, Nitin Nizhawan <
 nitin.nizha...@gmail.com> wrote:
 > @Varun  I think it can be done using bits, if input character set has
 only
 > two elements. Or could u plz explain?
 >
 > On Fri, Aug 5, 2011 at 2:29 PM, Varun Jakhoria <
 varunjakho...@gmail.com>
 > wrote:
 >>
 >> I think it can be done using bitwise ANDing with a mask
 >>
 >> On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
 >>  wrote:
 >> > An Implementation:
 >> >
 >> > #include
 >> > #include
 >> > using namespace std;
 >> >
 >> > string alphabet;
 >> > int maxlen;
 >> > void backtrack(string s,int l)
 >> > {
 >> >  if(l==maxlen) { cout<>>> >> >  s.push_back('-');
 >> >  for(int i=0;i>>> >> >{ s[l]=alphabet[i]; backtrack(s,l+1); }
 >> > }
 >> >
 >> > int main()
 >> > {
 >> >  maxlen=3;
 >> >  alphabet="op";
 >> >  backtrack("",0);
 >> >  return 0;
 >> > }
 >> >
 >> >
 >> > On Fri, Aug 5, 2011 at 12:42 PM, Kamakshii Aggarwal
 >> >  wrote:
 >> >> @gaurav:i could not understand ur sol.can u explain it again..
 >> >>
 >> >> On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani
 >> >> 
 >> >> wrote:
 >> >>>
 >> >>> On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
 >> >>>  wrote:
 >> >>> > given a set of letters and a length N, produce all possible
 >> >>> > output.(Not
 >> >>> > permutation). For example, give the letter (p,o) and length of
 3,
 >> >>> > produce
 >> >>> > the following output(in any order you want, not just my example
 >> >>> > order)
 >> >>> >
 >> >>> > ppp ppo poo pop opp opo oop ooo
 >> >>> >
 >> >>> > another example would be given (a,b) and length 2
 >> >>> >
 >> >>> > answer: ab aa bb ba
 >> >>> >
 >> >>> > --
 >> >>> > Regards,
 >> >>> > Kamakshi
 >> >>> > kamakshi...@gmail.com
 >> >>>
 >> >>> This can be done easily by backtracking
 >> >>>
 >> >>> void backtrack(string s, int l)
 >> >>> {
 >> >>>   if(l == maxlen) { cout<>>> >> >>>
 >> >>>   s.push_back('-');
 >> >>>   for(int i=0;i>>> >> >>>   {
 >> >>> s[l]=alphabet[i];
 >> >>> backtrack(s,l+1);
 >> >>>   }
 >> >>> }
 >> >>>
 >> >>> --
 >> >>> Gaurav Menghani
 >> >>>
 >> >>> --
 >> >>> You received this message because you are subscribed to the
 Google
 >> >>> Groups
 >> >>> "Algorithm Geeks" group.
 >> >>> To post to this group, send email to algogeeks@googlegroups.com.
 >> >>> To unsubscribe from this group, send email to
 >> >>> algogeeks+unsubscr...@googlegroups.com.
 >> >>> For more options, visit this group at
 >> >>> http://groups.google.com/group/algogeeks?hl=en.
 >> >>>
 >> >>
 >> >>
 >> >>
 >> >> --
 >> >> Regards,
 >> >> Kamakshi
 >> >> kamakshi...@gmail.com
 >> >>
 >> >> --
 >> >> You received this message because you are subscribed to the Google
 >> >> Groups
 >> >> "Algorithm Geeks" group.
 >> >> To post to this group, send email to algogeeks@googlegroups.com.
 >> >> To unsubscribe from this group, send email to
 >> >> algogeeks+unsubscr...@googlegroups.com.
 >> >> For more options, visit this group at
 >> >> http://groups.google.com/group/algogeeks?hl=en.
 >> >>
 >> >
 >> >
 >> >
 >> > --
 >> > Gaurav Menghani
 >> >
 >> > --
 >> > You received this message because you are subscribed to the Google
 >> > Groups "Algorithm Geeks" group.
 >> > To post to this group, send email to algogeeks@googlegroups.com.
 >> > To unsubscribe from this group, send emai

Re: [algogeeks] Re: directi prepration

2011-08-05 Thread Tushar Bindal
what about interns?
what are the testing criteria for them?

On Sat, Aug 6, 2011 at 11:55 AM, Nitish Garg wrote:

> Yes, can anyone tell how much do they expect knowledge of Linux?
>
> --
> 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/-/IWON5SSekLAJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tushicom...@gmail.com
Website: www.jugadengg.com

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



Re: [algogeeks] pls help

2011-08-05 Thread mohit verma
what if the alphabet is {a,b,c,d} and we have to print substrings of length
2 or 3 ?

On Sat, Aug 6, 2011 at 11:01 AM, Tushar Bindal wrote:

> @gaurav
> didn't get this:
>
> Just to increase the size of the string by one.
>
> Then you can put any character at the the new last position, which is 'l'.
>
> can u pls explain that?
>
>
> On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan 
> wrote:
>
>> Ok, Thanks
>>
>>
>> On Fri, Aug 5, 2011 at 2:53 PM, Gaurav Menghani <
>> gaurav.mengh...@gmail.com> wrote:
>>
>>> Even if the number of elements is more than two, it is possible with
>>> bitwise operations, but it gets clumsy.
>>>
>>> Suppose your alphabet has 4 characters. You can either:
>>> - Count from 0 to (1<<4*n)-1 and use four bits to denote the selection
>>> of the alphabet. Also, only one bit amongst those four should be set.
>>> It is highly inefficient.
>>> - Keep n nested loops and inside each loop you iterate from 0 to
>>> (1<<4)-1 and use the standard bitwise operations. The con here is that
>>> you have to hardcode the number of nested loops.
>>>
>>> On Fri, Aug 5, 2011 at 2:44 PM, Nitin Nizhawan 
>>> wrote:
>>> > @Varun  I think it can be done using bits, if input character set has
>>> only
>>> > two elements. Or could u plz explain?
>>> >
>>> > On Fri, Aug 5, 2011 at 2:29 PM, Varun Jakhoria <
>>> varunjakho...@gmail.com>
>>> > wrote:
>>> >>
>>> >> I think it can be done using bitwise ANDing with a mask
>>> >>
>>> >> On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
>>> >>  wrote:
>>> >> > An Implementation:
>>> >> >
>>> >> > #include
>>> >> > #include
>>> >> > using namespace std;
>>> >> >
>>> >> > string alphabet;
>>> >> > int maxlen;
>>> >> > void backtrack(string s,int l)
>>> >> > {
>>> >> >  if(l==maxlen) { cout<>> >> >  s.push_back('-');
>>> >> >  for(int i=0;i>> >> >{ s[l]=alphabet[i]; backtrack(s,l+1); }
>>> >> > }
>>> >> >
>>> >> > int main()
>>> >> > {
>>> >> >  maxlen=3;
>>> >> >  alphabet="op";
>>> >> >  backtrack("",0);
>>> >> >  return 0;
>>> >> > }
>>> >> >
>>> >> >
>>> >> > On Fri, Aug 5, 2011 at 12:42 PM, Kamakshii Aggarwal
>>> >> >  wrote:
>>> >> >> @gaurav:i could not understand ur sol.can u explain it again..
>>> >> >>
>>> >> >> On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani
>>> >> >> 
>>> >> >> wrote:
>>> >> >>>
>>> >> >>> On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
>>> >> >>>  wrote:
>>> >> >>> > given a set of letters and a length N, produce all possible
>>> >> >>> > output.(Not
>>> >> >>> > permutation). For example, give the letter (p,o) and length of
>>> 3,
>>> >> >>> > produce
>>> >> >>> > the following output(in any order you want, not just my example
>>> >> >>> > order)
>>> >> >>> >
>>> >> >>> > ppp ppo poo pop opp opo oop ooo
>>> >> >>> >
>>> >> >>> > another example would be given (a,b) and length 2
>>> >> >>> >
>>> >> >>> > answer: ab aa bb ba
>>> >> >>> >
>>> >> >>> > --
>>> >> >>> > Regards,
>>> >> >>> > Kamakshi
>>> >> >>> > kamakshi...@gmail.com
>>> >> >>>
>>> >> >>> This can be done easily by backtracking
>>> >> >>>
>>> >> >>> void backtrack(string s, int l)
>>> >> >>> {
>>> >> >>>   if(l == maxlen) { cout<>> >> >>>
>>> >> >>>   s.push_back('-');
>>> >> >>>   for(int i=0;i>> >> >>>   {
>>> >> >>> s[l]=alphabet[i];
>>> >> >>> backtrack(s,l+1);
>>> >> >>>   }
>>> >> >>> }
>>> >> >>>
>>> >> >>> --
>>> >> >>> Gaurav Menghani
>>> >> >>>
>>> >> >>> --
>>> >> >>> You received this message because you are subscribed to the Google
>>> >> >>> Groups
>>> >> >>> "Algorithm Geeks" group.
>>> >> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>> >> >>> To unsubscribe from this group, send email to
>>> >> >>> algogeeks+unsubscr...@googlegroups.com.
>>> >> >>> For more options, visit this group at
>>> >> >>> http://groups.google.com/group/algogeeks?hl=en.
>>> >> >>>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> Regards,
>>> >> >> Kamakshi
>>> >> >> kamakshi...@gmail.com
>>> >> >>
>>> >> >> --
>>> >> >> You received this message because you are subscribed to the Google
>>> >> >> Groups
>>> >> >> "Algorithm Geeks" group.
>>> >> >> To post to this group, send email to algogeeks@googlegroups.com.
>>> >> >> To unsubscribe from this group, send email to
>>> >> >> algogeeks+unsubscr...@googlegroups.com.
>>> >> >> For more options, visit this group at
>>> >> >> http://groups.google.com/group/algogeeks?hl=en.
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Gaurav Menghani
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google
>>> >> > Groups "Algorithm Geeks" group.
>>> >> > To post to this group, send email to algogeeks@googlegroups.com.
>>> >> > To unsubscribe from this group, send email to
>>> >> > algogeeks+unsubscr...@googlegroups.com.
>>> >> > For more options, visit this group at
>>> >> > http://groups.google.com/group/algogeeks?hl=en.
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Varun Jakhoria
>>> >> ...it's only about 0's & 1's
>>> >>
>>> >> --
>>> >> You received 

[algogeeks] Re: directi prepration

2011-08-05 Thread Nitish Garg
Yes, can anyone tell how much do they expect knowledge of Linux?

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

2011-08-05 Thread abhishek
directi is visting in my campus on 8th august
if it has already visited anybody campus
plz share ur experience here

thanx

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



Re: [algogeeks] pls help

2011-08-05 Thread Tushar Bindal
@gaurav
didn't get this:
Just to increase the size of the string by one.

Then you can put any character at the the new last position, which is 'l'.

can u pls explain that?

On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan wrote:

> Ok, Thanks
>
>
> On Fri, Aug 5, 2011 at 2:53 PM, Gaurav Menghani  > wrote:
>
>> Even if the number of elements is more than two, it is possible with
>> bitwise operations, but it gets clumsy.
>>
>> Suppose your alphabet has 4 characters. You can either:
>> - Count from 0 to (1<<4*n)-1 and use four bits to denote the selection
>> of the alphabet. Also, only one bit amongst those four should be set.
>> It is highly inefficient.
>> - Keep n nested loops and inside each loop you iterate from 0 to
>> (1<<4)-1 and use the standard bitwise operations. The con here is that
>> you have to hardcode the number of nested loops.
>>
>> On Fri, Aug 5, 2011 at 2:44 PM, Nitin Nizhawan 
>> wrote:
>> > @Varun  I think it can be done using bits, if input character set has
>> only
>> > two elements. Or could u plz explain?
>> >
>> > On Fri, Aug 5, 2011 at 2:29 PM, Varun Jakhoria > >
>> > wrote:
>> >>
>> >> I think it can be done using bitwise ANDing with a mask
>> >>
>> >> On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
>> >>  wrote:
>> >> > An Implementation:
>> >> >
>> >> > #include
>> >> > #include
>> >> > using namespace std;
>> >> >
>> >> > string alphabet;
>> >> > int maxlen;
>> >> > void backtrack(string s,int l)
>> >> > {
>> >> >  if(l==maxlen) { cout<> >> >  s.push_back('-');
>> >> >  for(int i=0;i> >> >{ s[l]=alphabet[i]; backtrack(s,l+1); }
>> >> > }
>> >> >
>> >> > int main()
>> >> > {
>> >> >  maxlen=3;
>> >> >  alphabet="op";
>> >> >  backtrack("",0);
>> >> >  return 0;
>> >> > }
>> >> >
>> >> >
>> >> > On Fri, Aug 5, 2011 at 12:42 PM, Kamakshii Aggarwal
>> >> >  wrote:
>> >> >> @gaurav:i could not understand ur sol.can u explain it again..
>> >> >>
>> >> >> On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani
>> >> >> 
>> >> >> wrote:
>> >> >>>
>> >> >>> On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
>> >> >>>  wrote:
>> >> >>> > given a set of letters and a length N, produce all possible
>> >> >>> > output.(Not
>> >> >>> > permutation). For example, give the letter (p,o) and length of 3,
>> >> >>> > produce
>> >> >>> > the following output(in any order you want, not just my example
>> >> >>> > order)
>> >> >>> >
>> >> >>> > ppp ppo poo pop opp opo oop ooo
>> >> >>> >
>> >> >>> > another example would be given (a,b) and length 2
>> >> >>> >
>> >> >>> > answer: ab aa bb ba
>> >> >>> >
>> >> >>> > --
>> >> >>> > Regards,
>> >> >>> > Kamakshi
>> >> >>> > kamakshi...@gmail.com
>> >> >>>
>> >> >>> This can be done easily by backtracking
>> >> >>>
>> >> >>> void backtrack(string s, int l)
>> >> >>> {
>> >> >>>   if(l == maxlen) { cout<> >> >>>
>> >> >>>   s.push_back('-');
>> >> >>>   for(int i=0;i> >> >>>   {
>> >> >>> s[l]=alphabet[i];
>> >> >>> backtrack(s,l+1);
>> >> >>>   }
>> >> >>> }
>> >> >>>
>> >> >>> --
>> >> >>> Gaurav Menghani
>> >> >>>
>> >> >>> --
>> >> >>> You received this message because you are subscribed to the Google
>> >> >>> Groups
>> >> >>> "Algorithm Geeks" group.
>> >> >>> To post to this group, send email to algogeeks@googlegroups.com.
>> >> >>> To unsubscribe from this group, send email to
>> >> >>> algogeeks+unsubscr...@googlegroups.com.
>> >> >>> For more options, visit this group at
>> >> >>> http://groups.google.com/group/algogeeks?hl=en.
>> >> >>>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Regards,
>> >> >> Kamakshi
>> >> >> kamakshi...@gmail.com
>> >> >>
>> >> >> --
>> >> >> You received this message because you are subscribed to the Google
>> >> >> Groups
>> >> >> "Algorithm Geeks" group.
>> >> >> To post to this group, send email to algogeeks@googlegroups.com.
>> >> >> To unsubscribe from this group, send email to
>> >> >> algogeeks+unsubscr...@googlegroups.com.
>> >> >> For more options, visit this group at
>> >> >> http://groups.google.com/group/algogeeks?hl=en.
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Gaurav Menghani
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "Algorithm Geeks" group.
>> >> > To post to this group, send email to algogeeks@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > algogeeks+unsubscr...@googlegroups.com.
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/algogeeks?hl=en.
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Varun Jakhoria
>> >> ...it's only about 0's & 1's
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Algorithm Geeks" group.
>> >> To post to this group, send email to algogeeks@googlegroups.com.
>> >> To unsubscribe from 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] Radix sort in linear time???

2011-08-05 Thread kumar raja
suppose i have 6 numbers  379,635,274,743,980,835

i read that radix sort runs in O(d(n+k)) time. where d-number of digits
,n=6,k=each digit range.

But after the elements are sorted on LSB ,to find next digit we need to
perform / and % operation

  379 /10 = 37  and 37 %10= 7
so  it is taking O(d) time to calculate radix/digit in each pass

Can anybody tell me how do get the kth digit in number using some bitwise
operations in constant time.

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



Re: [algogeeks] Re: Duplicates in a string

2011-08-05 Thread kumar raja
@hary :
Ur solution is  good... But if the problem is modified so that the string
can contain alphanumeric characters is there any better way to do it..

On 5 August 2011 23:11, hary rathor  wrote:

> i have used 26 bit of checker variable
> then i have checked in "if statemet " that if bit is set  there then put
> then character in jth posion,
> then set the the bit for character
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this 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.



Re: [algogeeks] output

2011-08-05 Thread Pramod Jayswal
when swap is called ,as it is a macro ,before compilation its code is
replaced and the code before compilation bcomes:

> # define swap(a,b) temp=a; a=b; b=temp;
> main( )
> {
> int i, j, temp;
> i=5;
> j=10;
> temp=0;
> if( i > j)
>
   //code replaced here

> temp=a;   //not executed (false)
>
   a=b; //a=10(from b=10)
   b=temp;   //b=0 (from temp=0)

> printf( “%d %d %d”, i, j, temp);
> }
>
> and that is why u get output  10,0,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.



Re: [algogeeks] Re: output???

2011-08-05 Thread saurabh singh
a double has a higher precision than float i.e. it has larger number of bits
for the mantisa part.
when float is compared to double it is promoted to double by filling
remaining bits in mantissa with 0.
consider this code

http://ideone.com/y1Ahu
Its equal bcoz the higher bits will be 0 for both
double and float.
similar result occurs for 0.25 0.75 0.10 etc,.
On Sat, Aug 6, 2011 at 10:26 AM, sagar pareek  wrote:

> @saurabh
>
> what? i didnt get you
>
>
> On Sat, Aug 6, 2011 at 10:22 AM, saurabh singh wrote:
>
>> IEEE notation..
>> they appear to be the same but they are not same..0.5d has higher
>> precision that does not necessarily means its larger..
>>
>>
>> On Sat, Aug 6, 2011 at 10:20 AM, sagar pareek wrote:
>>
>>> see what piyush posted
>>>
>>>
>>> On Sat, Aug 6, 2011 at 4:35 AM, Shashank Jain wrote:
>>>
 sagar - i dint get u, d code thing!

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering



 On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek wrote:

> yup exactly
>
> On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor wrote:
>
>> I think it is because the numbers like 0.7 do not have a exact binary
>> representation,so they are not exactly represented in float,while the
>> constant is internally implemented as double.,Read this::
>> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals
>>
>>
>> --
>> *Regards,*
>> *Piyush Kapoor,*
>> *2nd year,CSE
>> IT-BHU*
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> **Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

>>>
>>>
>>>
>>> --
>>> **Regards
>>> SAGAR PAREEK
>>> COMPUTER SCIENCE AND ENGINEERING
>>> NIT ALLAHABAD
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Saurabh Singh
>> B.Tech (Computer Science)
>> MNNIT ALLAHABAD
>>
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> **Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

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



Re: [algogeeks] sizeof structure

2011-08-05 Thread vikas singh
On Sat, Aug 6, 2011 at 10:07 AM, Sabya Sachi  wrote:

> At many places, it has been mentioned that in C, a structure (when not
> packed) pads its content so as to facilitate memory alignment so that
> its members are accessed faster.
> like for e.g the snippet
>
> struct node
> {
> char d;
> int a;
> };
> int main(){
>struct node a;
>printf("size = %d",sizeof(a));
> }
> gives the output 8 as it pads the char to 4 bytes.
>
>


But the following snippet outputs 4
>
> struct node
> {
> char d:1;
> int a:1;
> };
> int main(){
>struct node a;
>printf("size = %d",sizeof(a));
> }
>
> I thought that maybe it was padding upto the nearest multiple of
> sizeof(int), but then the following snippet gave the output 1.
>



in both of the code above you see the similarity that the INT data type  is
present. padding is done only when there is IMBALANCE in the structure of
the bytes arranged coz of different datatype).

your FIRST and SECOND e.g.
 has CHAR and INT both.. in first case, the character field add 3 more
bytes, where in your second e.g. the work is done only in the 4 byte.(as you
have noticed already)






struct node
> {
> char d;
> };
> int main(){
>struct node a;
>printf("size = %d",sizeof(a));
> }
>
>  Can someone please explain, how is the whole padding thing happening??
>
>
in 3rd e.g. you don't have any INT, so it DOESN'T need anything to pad for.
coz no BIGGER data type is present in the structure... it(padding) only
happens when we have different data types in the structure.. hope u'll get
the point.. :)


> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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
VIKAS SINGH
MCA- final year
NIT DURGAPUR
email:
 vikas.singh1...@gmail.com
 shyguy1...@gmail.com
http://smrit.wordpress.com

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



Re: [algogeeks] output

2011-08-05 Thread loka ranjane
@saurabh:ya got it..thanks

On Sat, Aug 6, 2011 at 10:26 AM, saurabh singh  wrote:
> Try compiling with gcc -E .That will clear everything
>
> On Sat, Aug 6, 2011 at 10:25 AM, saurabh singh  wrote:
>>
>> hint:MACRo is just substituted as it is
>>
>> On Sat, Aug 6, 2011 at 10:23 AM, ranjane  wrote:
>>>
>>> # define swap(a,b) temp=a; a=b; b=temp;
>>> main( )
>>> {
>>> int i, j, temp;
>>> i=5;
>>> j=10;
>>> temp=0;
>>> if( i > j)
>>> swap( i, j );
>>> printf( “%d %d %d”, i, j, temp);
>>> }
>>>
>>>
>>> On compiling i got ans 10, 0, 0.explain..
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Saurabh Singh
>> B.Tech (Computer Science)
>> MNNIT ALLAHABAD
>>
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 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-05 Thread sagar pareek
Lets see what happen with ur code...

original
# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( “%d %d %d”, i, j, temp);
}


after expansion of macro

# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
*temp=a;  //only this line comes under if condition*
a=b;
 b=temp;
printf( “%d %d %d”, i, j, temp);
}

On Sat, Aug 6, 2011 at 10:26 AM, saurabh singh  wrote:

> Try compiling with gcc -E .That will clear everything
>
>
> On Sat, Aug 6, 2011 at 10:25 AM, saurabh singh wrote:
>
>> hint:MACRo is just substituted as it is
>>
>>
>> On Sat, Aug 6, 2011 at 10:23 AM, ranjane  wrote:
>>
>>> # define swap(a,b) temp=a; a=b; b=temp;
>>> main( )
>>> {
>>> int i, j, temp;
>>> i=5;
>>> j=10;
>>> temp=0;
>>> if( i > j)
>>> swap( i, j );
>>> printf( “%d %d %d”, i, j, temp);
>>> }
>>>
>>>
>>> On compiling i got ans 10, 0, 0.explain..
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>>
>> --
>> Saurabh Singh
>> B.Tech (Computer Science)
>> MNNIT ALLAHABAD
>>
>>
>>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Re: output???

2011-08-05 Thread sagar pareek
@saurabh

what? i didnt get you

On Sat, Aug 6, 2011 at 10:22 AM, saurabh singh  wrote:

> IEEE notation..
> they appear to be the same but they are not same..0.5d has higher
> precision that does not necessarily means its larger..
>
>
> On Sat, Aug 6, 2011 at 10:20 AM, sagar pareek wrote:
>
>> see what piyush posted
>>
>>
>> On Sat, Aug 6, 2011 at 4:35 AM, Shashank Jain wrote:
>>
>>> sagar - i dint get u, d code thing!
>>>
>>> Shashank Jain
>>> IIIrd year
>>> Computer Engineering
>>> Delhi College of Engineering
>>>
>>>
>>>
>>> On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek wrote:
>>>
 yup exactly

 On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor wrote:

> I think it is because the numbers like 0.7 do not have a exact binary
> representation,so they are not exactly represented in float,while the
> constant is internally implemented as double.,Read this::
> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals
>
>
> --
> *Regards,*
> *Piyush Kapoor,*
> *2nd year,CSE
> IT-BHU*
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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

>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] output

2011-08-05 Thread saurabh singh
Try compiling with gcc -E .That will clear everything

On Sat, Aug 6, 2011 at 10:25 AM, saurabh singh  wrote:

> hint:MACRo is just substituted as it is
>
>
> On Sat, Aug 6, 2011 at 10:23 AM, ranjane  wrote:
>
>> # define swap(a,b) temp=a; a=b; b=temp;
>> main( )
>> {
>> int i, j, temp;
>> i=5;
>> j=10;
>> temp=0;
>> if( i > j)
>> swap( i, j );
>> printf( “%d %d %d”, i, j, temp);
>> }
>>
>>
>> On compiling i got ans 10, 0, 0.explain..
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>


-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

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



Re: [algogeeks] output

2011-08-05 Thread saurabh singh
hint:MACRo is just substituted as it is

On Sat, Aug 6, 2011 at 10:23 AM, ranjane  wrote:

> # define swap(a,b) temp=a; a=b; b=temp;
> main( )
> {
> int i, j, temp;
> i=5;
> j=10;
> temp=0;
> if( i > j)
> swap( i, j );
> printf( “%d %d %d”, i, j, temp);
> }
>
>
> On compiling i got ans 10, 0, 0.explain..
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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.



[algogeeks] output

2011-08-05 Thread ranjane
# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( “%d %d %d”, i, j, temp);
}


On compiling i got ans 10, 0, 0.explain..

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

2011-08-05 Thread saurabh singh
IEEE notation..
they appear to be the same but they are not same..0.5d has higher
precision that does not necessarily means its larger..

On Sat, Aug 6, 2011 at 10:20 AM, sagar pareek  wrote:

> see what piyush posted
>
>
> On Sat, Aug 6, 2011 at 4:35 AM, Shashank Jain wrote:
>
>> sagar - i dint get u, d code thing!
>>
>> Shashank Jain
>> IIIrd year
>> Computer Engineering
>> Delhi College of Engineering
>>
>>
>>
>> On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek wrote:
>>
>>> yup exactly
>>>
>>> On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor wrote:
>>>
 I think it is because the numbers like 0.7 do not have a exact binary
 representation,so they are not exactly represented in float,while the
 constant is internally implemented as double.,Read this::
 http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals


 --
 *Regards,*
 *Piyush Kapoor,*
 *2nd year,CSE
 IT-BHU*

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

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



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



Re: [algogeeks] Re: output???

2011-08-05 Thread sagar pareek
see what piyush posted

On Sat, Aug 6, 2011 at 4:35 AM, Shashank Jain  wrote:

> sagar - i dint get u, d code thing!
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
>
>
> On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek wrote:
>
>> yup exactly
>>
>> On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor wrote:
>>
>>> I think it is because the numbers like 0.7 do not have a exact binary
>>> representation,so they are not exactly represented in float,while the
>>> constant is internally implemented as double.,Read this::
>>> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals
>>>
>>>
>>> --
>>> *Regards,*
>>> *Piyush Kapoor,*
>>> *2nd year,CSE
>>> IT-BHU*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



[algogeeks] sizeof structure

2011-08-05 Thread Sabya Sachi
At many places, it has been mentioned that in C, a structure (when not
packed) pads its content so as to facilitate memory alignment so that
its members are accessed faster.
like for e.g the snippet

struct node
{
char d;
int a;
};
int main(){
struct node a;
printf("size = %d",sizeof(a));
}
gives the output 8 as it pads the char to 4 bytes.

But the following snippet outputs 4

struct node
{
char d:1;
int a:1;
};
int main(){
struct node a;
printf("size = %d",sizeof(a));
}

I thought that maybe it was padding upto the nearest multiple of
sizeof(int), but then the following snippet gave the output 1.
struct node
{
char d;
};
int main(){
struct node a;
printf("size = %d",sizeof(a));
}

 Can someone please explain, how is the whole padding thing happening??

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



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-05 Thread Niteesh Mehra
Right. But why does my compiler behave weirdly

-- 
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/-/iWbW5rOYO1EJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] difference between the two

2011-08-05 Thread Tushar Bindal
http://www.serc.iisc.ernet.in/ComputingFacilities/systems/cluster/xlf/html/xlfug/ug35.htm
this says int is always 4 bytes and pointer is 8 bytes on 64 bit compiler.

so how does padding affect these structures because of the difference in
size of int and pointer?


I tried this program
https://ideone.com/CRU6x#view_edit_box
char always gets 4 bytes whenever it has int or double in the same struct
irrrespctive of the order of the declaration of variables.
I thought char should get size 8 when there is a double in the ame struct
whereas it gets size 4 only.
what is the problem here?

On Sat, Aug 6, 2011 at 4:40 AM, Shashank Jain  wrote:

> i dont understand the diff btw dem, could u plz elaborate?
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
>
>
> On Sat, Aug 6, 2011 at 12:32 AM, Kamakshii Aggarwal  > wrote:
>
>> in case of 64 bit,
>> size of second structure will also be 16 not 8
>>
>>
>> On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV <
>> usrivastav...@gmail.com> wrote:
>>
>>> I think voth are just same..
>>>
>>>
>>> On Fri, Aug 5, 2011 at 10:57 AM, priya v  wrote:
>>>
 in case of 64 bit machine y doesn't padding happen in the 2nd structure?


 On Fri, Aug 5, 2011 at 11:21 PM, hary rathor wrote:

> no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
> but   in 64 machine that enforce to be size of 8 . where padding will
> take int your given first structure
>
> so for 32 bit- size will 8 8 for both structure
> for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in
> one structure
>
> hence 2nd structure is good for use
>
> --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

>>>
>>>
>>>
>>> --
>>> *UTKARSH SRIVASTAV
>>> CSE-3
>>> B-Tech 2nd Year
>>> @MNNIT ALLAHABAD*
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Regards,
>> Kamakshi
>> kamakshi...@gmail.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tushicom...@gmail.com
Website: www.jugadengg.com

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



Re: [algogeeks] Re: adobe

2011-08-05 Thread sahil gujral
yes u r wrong..
1 is nt divisible by 23

On Sat, Aug 6, 2011 at 9:15 AM, sumit  wrote:

> This looks quite simple.
> Every number ending in 3 follows a pattern.eg-
> 3 - 111
> 13 - 11
> 23 - 1 etc
> we can find the reauired no. by :
> suppose input no. is 33
> In every case leave the no at 1's place(least significant) i.e. 3, In
> 33 you will be left with 3(after removal of 3 at first place).
> Now ,3 *(rest of nos +1 ) is your answer (in case of 33 it is 3*(3+1)
> = 12 i.e  ).
> for 103 it is 3*(10+1) = 33 1's.
>
> Correct if I am wrong.
>
>
> On Aug 5, 4:33 pm, Manee  wrote:
> > ADOBE asks the very basic C/C++ questions
> >
> > one of their toughest however was :
> >
> > every number ending in 3 has a multiple of the form "111...111"
> >
> > e.g 3 has 111
> >  13 has 11
> > so on..
> >
> > find the algo for finding the number for an input number ending in 3.
> >
> > On Aug 5, 2:33 pm, Agyat  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > hey, guys adobe is visiting our campus. So those who know questions
> > > that adobe asked in written or interview, please post here as it will
> > > be of great help (as adobe has visited some colleges already).
> > > Thank you 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.
>
>

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

2011-08-05 Thread shiv narayan
according  to me 2nd structure must also have 16 bit size for 64 bit
architecture as padding must also take place there also.

On Aug 6, 4:10 am, Shashank Jain  wrote:
> i dont understand the diff btw dem, could u plz elaborate?
>
> Shashank Jain
> IIIrd year
> Computer Engineering
> Delhi College of Engineering
>
> On Sat, Aug 6, 2011 at 12:32 AM, Kamakshii Aggarwal
> wrote:
>
>
>
>
>
>
>
> > in case of 64 bit,
> > size of second structure will also be 16 not 8
>
> > On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV <
> > usrivastav...@gmail.com> wrote:
>
> >> I think voth are just same..
>
> >> On Fri, Aug 5, 2011 at 10:57 AM, priya v  wrote:
>
> >>> in case of 64 bit machine y doesn't padding happen in the 2nd structure?
>
> >>> On Fri, Aug 5, 2011 at 11:21 PM, hary rathor 
> >>> wrote:
>
>  no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
>  but   in 64 machine that enforce to be size of 8 . where padding will
>  take int your given first structure
>
>  so for 32 bit- size will 8 8 for both structure
>  for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in
>  one structure
>
>  hence 2nd structure is good for use
>
>  --
>  You received this message because you are subscribed to the Google
>  Groups "Algorithm Geeks" group.
>  To post to this group, send email to algogeeks@googlegroups.com.
>  To unsubscribe from this group, send email to
>  algogeeks+unsubscr...@googlegroups.com.
>  For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
> >>>  --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Algorithm Geeks" group.
> >>> To post to this group, send email to algogeeks@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> algogeeks+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/algogeeks?hl=en.
>
> >> --
> >> *UTKARSH SRIVASTAV
> >> CSE-3
> >> B-Tech 2nd Year
> >> @MNNIT ALLAHABAD*
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "Algorithm Geeks" group.
> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> algogeeks+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/algogeeks?hl=en.
>
> > --
> > Regards,
> > Kamakshi
> > kamakshi...@gmail.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.

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

2011-08-05 Thread sumit
This looks quite simple.
Every number ending in 3 follows a pattern.eg-
3 - 111
13 - 11
23 - 1 etc
we can find the reauired no. by :
suppose input no. is 33
In every case leave the no at 1's place(least significant) i.e. 3, In
33 you will be left with 3(after removal of 3 at first place).
Now ,3 *(rest of nos +1 ) is your answer (in case of 33 it is 3*(3+1)
= 12 i.e  ).
for 103 it is 3*(10+1) = 33 1's.

Correct if I am wrong.


On Aug 5, 4:33 pm, Manee  wrote:
> ADOBE asks the very basic C/C++ questions
>
> one of their toughest however was :
>
> every number ending in 3 has a multiple of the form "111...111"
>
> e.g 3 has 111
>  13 has 11
> so on..
>
> find the algo for finding the number for an input number ending in 3.
>
> On Aug 5, 2:33 pm, Agyat  wrote:
>
>
>
>
>
>
>
> > hey, guys adobe is visiting our campus. So those who know questions
> > that adobe asked in written or interview, please post here as it will
> > be of great help (as adobe has visited some colleges already).
> > Thank you 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.



Re: [algogeeks]

2011-08-05 Thread Dipankar Patro
Try a dry run on the following linked list

1->2->3->4->5->6->Null

head is a global variable;

The recursion will take place till 6 and assign head address of 6;

then it will first change 5->6->(back to 5) [root->next->next = root]
when it will be back to 4, change 4->5->(back to 4) . at this stage the
linked list is something like this: 1->2->3->4<=>5<-6;
[4<=>5 == 4->5 and 5->4]
.
.
this will continue till 1, 1->2->(back to 1)
But there is this glinch, 1 should point to NULL now, which I think is not
happening.

There is a return(root) in the final encounter.
use that like
p=reverse_recursive(head);
p->next= NULL;

I hope you get my point.

On 5 August 2011 23:33, Rajeshwar Patra  wrote:

> mynode* reverse_recurse(mynode *root)
>
> {
>
> if(root->next!=(mynode *)0)
>
> {
>
> reverse_recurse(root->next);
>
> root->next->next=root;
>
> return(root);
>
> }
>
> else
>
> {
>
> head=root;
>
> }
>
> }
> how does it reverses the singly linked list
>
> --
> *Rajeshwar Patra,*
> *MCA final year,*
> *Nit Durgapur*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
___

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.



Re: [algogeeks] hash table

2011-08-05 Thread saurabh singh
How can the element be regained from hash table?

On Sat, Aug 6, 2011 at 2:41 AM, mohit verma  wrote:

> yes you can... for randomness , the key value will be key=rand() and now
> implement your hash function with this key.
>
>
> On Fri, Aug 5, 2011 at 4:53 PM, Kamakshii Aggarwal 
> wrote:
>
>> can we implement random() function on a hash table in O(1) .
>>
>> --
>> Regards,
>> Kamakshi
>> kamakshi...@gmail.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> 
> *MOHIT VERMA*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-05 Thread Poised~
@ Wastrel and Niteesh Mehra:

I tried running the code:
 char *str;
 strcpy(str, "junk");
this gave a segmentation fault on Ubuntu 11.04 gcc-4.5.2 (32 bit OS)


I think we should consider the general concept that a pointer cannot be used 
until it is assigned some memory.

-- 
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/-/aS_uYbtNWegJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] MS question

2011-08-05 Thread priyanshu
Give an efficient algorithm  to determine which part of the video
should be displayed as a thumbnail??

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



Re: [algogeeks] difference between the two

2011-08-05 Thread Shashank Jain
i dont understand the diff btw dem, could u plz elaborate?

Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering



On Sat, Aug 6, 2011 at 12:32 AM, Kamakshii Aggarwal
wrote:

> in case of 64 bit,
> size of second structure will also be 16 not 8
>
>
> On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV <
> usrivastav...@gmail.com> wrote:
>
>> I think voth are just same..
>>
>>
>> On Fri, Aug 5, 2011 at 10:57 AM, priya v  wrote:
>>
>>> in case of 64 bit machine y doesn't padding happen in the 2nd structure?
>>>
>>>
>>> On Fri, Aug 5, 2011 at 11:21 PM, hary rathor wrote:
>>>
 no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
 but   in 64 machine that enforce to be size of 8 . where padding will
 take int your given first structure

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

 hence 2nd structure is good for use

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

>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> *UTKARSH SRIVASTAV
>> CSE-3
>> B-Tech 2nd Year
>> @MNNIT ALLAHABAD*
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-08-05 Thread Shashank Jain
sagar - i dint get u, d code thing!

Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering



On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek  wrote:

> yup exactly
>
> On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor  wrote:
>
>> I think it is because the numbers like 0.7 do not have a exact binary
>> representation,so they are not exactly represented in float,while the
>> constant is internally implemented as double.,Read this::
>> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals
>>
>>
>> --
>> *Regards,*
>> *Piyush Kapoor,*
>> *2nd year,CSE
>> IT-BHU*
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> **Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] hash table

2011-08-05 Thread mohit verma
yes you can... for randomness , the key value will be key=rand() and now
implement your hash function with this key.

On Fri, Aug 5, 2011 at 4:53 PM, Kamakshii Aggarwal wrote:

> can we implement random() function on a hash table in O(1) .
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 

*MOHIT VERMA*

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



Re: [algogeeks] Re: output???

2011-08-05 Thread sagar pareek
yup exactly

On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor  wrote:

> I think it is because the numbers like 0.7 do not have a exact binary
> representation,so they are not exactly represented in float,while the
> constant is internally implemented as double.,Read this::
> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals
>
>
> --
> *Regards,*
> *Piyush Kapoor,*
> *2nd year,CSE
> IT-BHU*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] help on string manipulation & bit manipulation

2011-08-05 Thread Shashank Jain
could u give some examples shiv fr string manipulation?

Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering



On Sat, Aug 6, 2011 at 1:57 AM, shiv narayan wrote:

> i have seen plenty of questions on string manipulation and bits
> operations asked in various comcanies exams.
>  any one give me some good links where i can find some really good
> tutorials on string manipulation.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Samsung SISO Question

2011-08-05 Thread Ankur Pandey
U can use merge sort for this.. try and picture the problem, u'll get my
point..

On Fri, Aug 5, 2011 at 1:27 PM, amit kumar  wrote:

> can u plz xplain d qstn a litl more
> thanx
>
> On Fri, Aug 5, 2011 at 8:33 PM, bagaria.ka...@gmail.com <
> bagaria.ka...@gmail.com> wrote:
>
>> Given a rope of 10m , numbered at 1m i.e like
>> 0  1  2  3  4  5  6  7  8  9  10
>> ||---|---|---|---|---|---|---|---|---|
>> |---10m|
>>
>> One dry out it clothes of various length like 4m from 0-4 then of 2m from
>> 6-8 then 6m from 2-8 and so on ,one on top of another , then u need to
>> construct a data structure such that
>> when seeing from the top u have to give the number of clothes drying , at
>> one particular instance.
>> --
>> Thanks and Regards
>>
>> *Karan Bagaria*
>> *MCA Final Year*
>> Training and Placement Representative
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Samsung SISO Question

2011-08-05 Thread amit kumar
can u plz xplain d qstn a litl more
thanx

On Fri, Aug 5, 2011 at 8:33 PM, bagaria.ka...@gmail.com <
bagaria.ka...@gmail.com> wrote:

> Given a rope of 10m , numbered at 1m i.e like
> 0  1  2  3  4  5  6  7  8  9  10
> ||---|---|---|---|---|---|---|---|---|
> |---10m|
>
> One dry out it clothes of various length like 4m from 0-4 then of 2m from
> 6-8 then 6m from 2-8 and so on ,one on top of another , then u need to
> construct a data structure such that
> when seeing from the top u have to give the number of clothes drying , at
> one particular instance.
> --
> Thanks and Regards
>
> *Karan Bagaria*
> *MCA Final Year*
> Training and Placement Representative
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



[algogeeks] help on string manipulation & bit manipulation

2011-08-05 Thread shiv narayan
i have seen plenty of questions on string manipulation and bits
operations asked in various comcanies exams.
 any one give me some good links where i can find some really good
tutorials on string manipulation.

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

2011-08-05 Thread Piyush Kapoor
I think it is because the numbers like 0.7 do not have a exact binary
representation,so they are not exactly represented in float,while the
constant is internally implemented as double.,Read this::
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals


-- 
*Regards,*
*Piyush Kapoor,*
*2nd year,CSE
IT-BHU*

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



[algogeeks] Re: Samsung Written

2011-08-05 Thread vikash
aptitude test 1 hour quantitative and general reasoning
technical round 30 min.
then interview

On Aug 5, 5:20 pm, parag khanna  wrote:
> Apti 1 hour

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

2011-08-05 Thread Gene
It's easy if you think in terms of pop and push operations.   Pop the
first k elements off the head of the list and push them onto a new
list.  They're now in reverse order. All that's left is to connect the
two lists.  You can do this efficiently if you keep a pointer to the
tail element.

NODE *reverse_k(NODE *lst, int k)
{
  NODE *reversed = NULL, *tail = null;
  int i;

  for (i = 0; i < k; i++) {

// pop the list head
NODE *popped = lst;
lst = lst->next;

// push onto the reversed prefix
popped->next = reversed;
reversed = popped;

// remember the tail of the reversed list
if (tail == NULL) tail = reversed;
  }

  // glue the rest of the list onto the tail
  tail->next = lst;

  // the reversed prefix is the new list
  return reversed;
}

This is an awkward problem to do with recursion.  You will essentially
end up implementing the loop above with tail recursion.  In my
opinion, the loop is clearer in this case.



On Aug 5, 3:21 pm, Nikhil Gupta  wrote:
> Sorry. this program reverses the 1st k nodes of the linked list. Not the
> entire list.
>
> On Sat, Aug 6, 2011 at 12:48 AM, Nikhil Gupta 
> wrote:
>
>
>
>
>
> > What is the error in the program? I tried to run it on ideone, but its
> > giving runtime error.
> > This is a program to reverse a linked list.
>
> > #include
> > #include
> > int count=0;
> > struct try{
>
> >        int data;
> >        struct try *next;
> > };
> > typedef struct try node;
> > node *head,*head2;
> > void reverse(node *list, int k)
> > {
> >         if(!k)
> > {
> > head=list->next;
> >  return;
> > }
> > if(list->next==NULL)
> >                       return;
> >         reverse(list->next,k-1);
> >         if(k==1)
> > head2=list->next;
> >  list->next->next=list;
>
> > list->next=NULL;
> >  }
>
> > void add(node *list,int a)
> > {
> >      node *temp;
> >      temp=malloc(sizeof(node));
> >      temp->data=a;
> >      temp->next=NULL;
> >      if(list==NULL)
> >                    list=temp;
> >      else
> >      {
> >          temp->next=list;
> >          list=temp;
> >      }
> > }
> > void print(node *list)
> > {
> >      while(list->next!=NULL)
> > printf("%d",list->data);
> > }
>
> > void del(node *list)
> > {
> >      node *temp;
> >      while(list!=NULL)
> >      {
> >                     temp=list;
> >                     free(list);
> >                     list=temp->next;
> >      }
> > }
>
> > int main()
> > {
> > int k;
> > node *list;
> >  scanf("%d",&k);
> > list=NULL;
> > add(list,10);
> >  add(list,20);
> > add(list,30);
> > add(list,40);
> >  add(list,50);
> > add(list,60);
>
> > print(list);
>
> > reverse(list,k-1);
> > list->next=head;
> > print(head2);
> >  del(head2);
> > return 0;
> > }
>
> > --
> > Nikhil Gupta
> > Senior Co-ordinator, Publicity
> > CSI, NSIT Students' Branch
> > NSIT, New Delhi, India
>
> --
> Nikhil Gupta
> Senior Co-ordinator, Publicity
> CSI, NSIT Students' Branch
> NSIT, New Delhi, India- Hide quoted text -
>
> - Show quoted text -

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



Re: [algogeeks] Makemytrip.com

2011-08-05 Thread parag khanna
both

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



Re: [algogeeks] Makemytrip.com

2011-08-05 Thread snehi jain
thanks for the information ..
the technical round had MCQs or coding questions ??

On Fri, Aug 5, 2011 at 11:09 PM, parag khanna wrote:

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

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



Re: [algogeeks] Re: output???

2011-08-05 Thread sagar pareek
@vikas
first read what i wrote

On Sat, Aug 6, 2011 at 12:59 AM, vikash  wrote:

> its due to precision limit of double is larger than float, and by
> default real values are stored  as double so constant 0.7 is stored
> more accurately(8 bytes) that float a=0.7 (4 bytes). and when
> comparing the two float is typecasted into double and so the ramaining
> bits are padded with 0 so 0.7 > a;
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


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

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



[algogeeks] Re: output???

2011-08-05 Thread vikash
its due to precision limit of double is larger than float, and by
default real values are stored  as double so constant 0.7 is stored
more accurately(8 bytes) that float a=0.7 (4 bytes). and when
comparing the two float is typecasted into double and so the ramaining
bits are padded with 0 so 0.7 > a;

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 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-05 Thread sagar pareek
ha ha
its not like it stores slightly less than actual  :P :P

try this

float a=0.5,b=1.0,c=0.7;

if(0.5==a)
printf("yes a=0.5\n");

if(1.0==b)
printf("yes b=1.0\n");

if(0.7!=c)
printf("Yes c!=0.7\n");

o/p will be
yes a=0.5
yes b=1.0
yes c!=0.7

check it out i will explain it later...
On Fri, Aug 5, 2011 at 9:26 PM, Rajesh Kumar wrote:

> Thanks to all
>
>
> On Fri, Aug 5, 2011 at 8:53 PM, sukran dhawan wrote:
>
>> coz by default all real values are converted to double and it is larger
>> than float.ie real nos are not stored accurately inside computer
>> memory.so
>> since double occupies more memory it prints hi
>>
>>
>> On Fri, Aug 5, 2011 at 8:24 PM, Kamakshii Aggarwal > > wrote:
>>
>>> the reason is dat 0.7 is treated as double..therefore double(0.7)
>>> >float(0.7)
>>>
>>> On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan 
>>> wrote:
>>>
 the output will be hi

 even if u have putted equal to sign there this is becoz 0.7 do not
 exactly stored like 0.7 in a but some thing lesser as describe in ASCII
 format
 that's why it is awlays lesser than 0.7

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

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



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

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



[algogeeks] Re: To reverse a linked list

2011-08-05 Thread Nikhil Gupta
Sorry. this program reverses the 1st k nodes of the linked list. Not the
entire list.

On Sat, Aug 6, 2011 at 12:48 AM, Nikhil Gupta wrote:

> What is the error in the program? I tried to run it on ideone, but its
> giving runtime error.
> This is a program to reverse a linked list.
>
>
> #include
> #include
> int count=0;
> struct try{
>
>int data;
>struct try *next;
> };
> typedef struct try node;
> node *head,*head2;
> void reverse(node *list, int k)
> {
> if(!k)
> {
> head=list->next;
>  return;
> }
> if(list->next==NULL)
>   return;
> reverse(list->next,k-1);
> if(k==1)
> head2=list->next;
>  list->next->next=list;
>
> list->next=NULL;
>  }
>
> void add(node *list,int a)
> {
>  node *temp;
>  temp=malloc(sizeof(node));
>  temp->data=a;
>  temp->next=NULL;
>  if(list==NULL)
>list=temp;
>  else
>  {
>  temp->next=list;
>  list=temp;
>  }
> }
> void print(node *list)
> {
>  while(list->next!=NULL)
> printf("%d",list->data);
> }
>
> void del(node *list)
> {
>  node *temp;
>  while(list!=NULL)
>  {
> temp=list;
> free(list);
> list=temp->next;
>  }
> }
>
> int main()
> {
> int k;
> node *list;
>  scanf("%d",&k);
> list=NULL;
> add(list,10);
>  add(list,20);
> add(list,30);
> add(list,40);
>  add(list,50);
> add(list,60);
>
> print(list);
>
> reverse(list,k-1);
> list->next=head;
> print(head2);
>  del(head2);
> return 0;
> }
>
>
> --
> Nikhil Gupta
> Senior Co-ordinator, Publicity
> CSI, NSIT Students' Branch
> NSIT, New Delhi, India
>
>


-- 
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India

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



[algogeeks] Re: a C question

2011-08-05 Thread vikash
well I don't have explanations but this happens because the
floats,ints and longs , they are stored differently in memory.

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

2011-08-05 Thread Nikhil Gupta
What is the error in the program? I tried to run it on ideone, but its
giving runtime error.
This is a program to reverse a linked list.


#include
#include
int count=0;
struct try{

   int data;
   struct try *next;
};
typedef struct try node;
node *head,*head2;
void reverse(node *list, int k)
{
if(!k)
{
head=list->next;
 return;
}
if(list->next==NULL)
  return;
reverse(list->next,k-1);
if(k==1)
head2=list->next;
 list->next->next=list;

list->next=NULL;
 }

void add(node *list,int a)
{
 node *temp;
 temp=malloc(sizeof(node));
 temp->data=a;
 temp->next=NULL;
 if(list==NULL)
   list=temp;
 else
 {
 temp->next=list;
 list=temp;
 }
}
void print(node *list)
{
 while(list->next!=NULL)
printf("%d",list->data);
}

void del(node *list)
{
 node *temp;
 while(list!=NULL)
 {
temp=list;
free(list);
list=temp->next;
 }
}

int main()
{
int k;
node *list;
 scanf("%d",&k);
list=NULL;
add(list,10);
 add(list,20);
add(list,30);
add(list,40);
 add(list,50);
add(list,60);

print(list);

reverse(list,k-1);
list->next=head;
print(head2);
 del(head2);
return 0;
}


-- 
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India

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



Re: [algogeeks] difference between the two

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

On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV
wrote:

> I think voth are just same..
>
>
> On Fri, Aug 5, 2011 at 10:57 AM, priya v  wrote:
>
>> in case of 64 bit machine y doesn't padding happen in the 2nd structure?
>>
>>
>> On Fri, Aug 5, 2011 at 11:21 PM, hary rathor wrote:
>>
>>> no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
>>> but   in 64 machine that enforce to be size of 8 . where padding will
>>> take int your given first structure
>>>
>>> so for 32 bit- size will 8 8 for both structure
>>> for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in
>>> one structure
>>>
>>> hence 2nd structure is good for use
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> *UTKARSH SRIVASTAV
> CSE-3
> B-Tech 2nd Year
> @MNNIT ALLAHABAD*
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



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

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



Re: [algogeeks] Re: probablity

2011-08-05 Thread Puneet Goyal
@shiv : you are considering the case when you need to know the probability
of both pens being blue, but in the question you already know that 1st one
is blue so you dont need to care about it, and also the 3rd packet getting
eliminated coz of it increases the probability to 1/2

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



[algogeeks] Re: Circle

2011-08-05 Thread Dave
@Don: The sequence of points (x+a, y+b) generated by your algorithm
moves along the arc of the circle from theta = 90 degrees to theta =
45 degrees. Along this arc, the slope of the curve is -1 <= dy/dx <=
0. Thus, rather than moving from (x+a, y+b) to either (x+a+1, y+b) or
(x+a, y+b-1), you should be moving to either (x+a+1, y+b) or (x+a+1, y
+b-1). In words, you always increase a, and decrease b when that gets
you closer to the circle. Furthermore, you can algebraically simplify
the comparison so that no multiplications are required. See, e.g.,
http://homepage.smc.edu/kennedy_john/bcircle.pdf.

Dave

On Aug 5, 1:06 pm, Don  wrote:
> // Draw a circle with center (x,y) and radius r
> circle(int x, int y, int r)
> {
>   int a = 0;
>   int b = r;
>   while(a <= b)
>   {
>     // Draw the current location in all 4 quadrants
>     plot(x+a, y+b);
>     plot(x-a,  y+b);
>     plot(x+a, y-b);
>     plot(x-a, y-b);
>     plot(x+b, y+a);
>     plot(x-b,  y+a);
>     plot(x+b, y-a);
>     plot(x-b, y-a);
>
>     // Look at two possible next points and pick the better
>     int delta1 = r*r - (a+1)*(a+1) - b*b;
>     int delta2 = r*r - a*a - (b-1)*(b-1);
>     if (delta1*delta1 < delta2*delta2) ++a;
>     else --b;
>   }
>
> }
>
> On Aug 5, 8:38 am, rShetty  wrote:
>
>
>
> > Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without
> > making use of any floating point
> > computations at all.- Hide quoted text -
>
> - Show quoted text -

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



Re: [algogeeks] simple doubt

2011-08-05 Thread Jiten
(*pa)[3] ;// pa is array of pointers to int type;
so pa = arr;  doesn't make any sense ,bcoz arr represents the base address
of it(address of arr[0]).
and pa represent the
address of pa[0](which hold a pointer).

I hope it's clear now

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



Re: [algogeeks] simple doubt

2011-08-05 Thread UTKARSH SRIVASTAV
int (*pa)[3];
pa is a pointer to an array of 3 elements for example in x[3] to
xin z[4][3] to z[0],z[1],z[2],z[3].so pa=arr is
correct and ..dp is  a pointer that sore address of a pointer so
dp=&a will give only warning but you can't do **dp in this case

*UTKARSH SRIVASTAV
CSE-3
B-Tech 3rd Year
@MNNIT ALLAHABAD*

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



Re: [algogeeks] simple doubt

2011-08-05 Thread Arun Vishwanathan
@amol: hmm but I would like to know the reason for it if it is so

On Fri, Aug 5, 2011 at 7:50 PM, Amol Sharma  wrote:

> both are wrong.run and see that warning will be displayed !!
> --
>
>
> Amol Sharma
> Third Year Student
> Computer Science and Engineering
> MNNIT Allahabad
>
>
>
>
> On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar wrote:
>
>> first one is right and second is wrong.because dp will store address of
>> pointer and here you are storing address of int array.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
 "People often say that motivation doesn't last. Well, neither does bathing
- that's why we recommend it daily."

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



Re: [algogeeks] simple doubt

2011-08-05 Thread Arun Vishwanathan
@nishant : where is the array address getting changed in first one? it just
says pa=arr

isnt &arr address of the pointer to the first element of the array?

On Fri, Aug 5, 2011 at 6:21 PM, nishaanth  wrote:

> i think both are erroneous.
>
> first statement  i think you are trying to change the array address
> which is not possible.
>
> second statement&arr doesn't make any sense i guess arr gives the
> address but &arr is not allowed
>
>
> On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar wrote:
>
>> but u initialized **dp means .
>> ex-dp=&p  and p=&arr then its correct so dp contains addr of p which
>> inturns contains addrof arr  now **dp is correct initialization.
>>
>>
>>  On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan <
>> aaron.nar...@gmail.com> wrote:
>>
>>> i see but is not arr a pointer to first array element and so &arr contain
>>> address of that pointer ?
>>>
>>>
>>> On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar 
>>> wrote:
>>>
 I dont think so dp=&arr;   since **dp; dp contains the addr of another
 ptr variable...

   On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan <
 aaron.nar...@gmail.com> wrote:

>
> I guess someone had posted a link earlier from which I have a basic
> doubt
>
> when u have
>
> int arr[3]={1,0,2};
> int **dp;
> int (*pa)[3];
>
> is this the right assingment for instance?
>
> pa=arr;
> dp=&arr;
>
> or have I flipped the ampersand in assigning?
>
> Also when I do pa++ will it jump by size of int or the whole array
> size it points to?
> --
>  "People often say that motivation doesn't last. Well, neither does
> bathing - that's why we recommend it daily."
>
> --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

>>>
>>>
>>>
>>> --
>>>  "People often say that motivation doesn't last. Well, neither does
>>> bathing - that's why we recommend it daily."
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> S.Nishaanth,
> Computer Science and engineering,
> IIT Madras.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
 "People often say that motivation doesn't last. Well, neither does bathing
- that's why we recommend it daily."

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



Re: [algogeeks] Structure Q

2011-08-05 Thread UTKARSH SRIVASTAV
only by declaring head and then doing head.x=100 is wrongbecause
head is only apointer that can store address of only a list type of
variable...whwn we allocate memmory by malloc or new then you
can do head->x=100..and head.x  is wrong ...use either
head->x=100 or (*head).x=100

*UTKARSH SRIVASTAV
CSE-3
B-Tech 3rd Year
@MNNIT ALLAHABAD*

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



Re: [algogeeks] simple doubt

2011-08-05 Thread Aman
1st is right, n when you do pa++, it will jump by size of 1st one-D array(in
case array is of more than one dimension), even in this case, it'll jump by
the whole array size(6).

On 5 August 2011 23:20, Amol Sharma  wrote:

> both are wrong.run and see that warning will be displayed !!
> --
>
>
> Amol Sharma
> Third Year Student
> Computer Science and Engineering
> MNNIT Allahabad
>
>
>
>
> On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar wrote:
>
>> first one is right and second is wrong.because dp will store address of
>> pointer and here you are storing address of int array.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



[algogeeks] Re: probablity

2011-08-05 Thread shiv narayan
according to me it is 1/3
read the line carefully  "What is the probability that the next pen
from the same packet will also be a blue one? "
since it is said the first pen was blue and second pen must also be
blue. for it to happen 1st packet  contaning all blue pen should be
selected whose probablity of selection is 1/3


On Aug 5, 9:06 pm, nishaanth  wrote:
> Bayes theorem...
>
> Approach :
>
> P(pen from packet 1 | Blue) =2/3 (from Bayes rule)
>
> P(pen from packet 2 | Blue) =1/3
>
> Req prob = 2/3 + 1/3 . 1/2
>                =5/6
>
> On Fri, Aug 5, 2011 at 6:02 PM, abhishek iyer 
> wrote:
>
>
>
>
>
>
>
>
>
> > @Nishant.. Can u please explain ur approach.. I think its as per mentioned
> > above 1/2...
> > On 5 Aug 2011 21:30, "nishaanth"  wrote:
> > > 5/6
>
> > > On Fri, Aug 5, 2011 at 5:55 PM, Rahul Jain 
> > wrote:
>
> > >> i agree with puneet. 1/2
>
> > >> On Fri, Aug 5, 2011 at 9:18 PM, Puneet Goyal  > >wrote:
>
> > >>> 1/2
>
> > >>> you got the blue pen so it is for sure that is one of the first two
> > >>> packets, so you are left with a black pen and a blue pen and you have
> > to
> > >>> find the probability of finding a blue pen among them
>
> > >>> On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal <
> > >>> kamakshi...@gmail.com> wrote:
>
> >  I was given 3 packets, with 2 pens each.
>
> >  1st Packet has 2 blue pens.
>
> >  2nd Packet has 1 blue pen,1 black pen.
>
> >  3rd Packet has 2 black pens.
>
> >  I took any one packet and pulled out one pen. It turned out to be a
> > blue
> >  one.
>
> >  What is the probability that the next pen from the same packet will
>
> >  also be a blue one?
>
> >  --
> >  Regards,
> >  Kamakshi
> >  kamakshi...@gmail.com
>
> >  --
> >  You received this message because you are subscribed to the Google
> > Groups
> >  "Algorithm Geeks" group.
> >  To post to this group, send email to algogeeks@googlegroups.com.
> >  To unsubscribe from this group, send email to
> >  algogeeks+unsubscr...@googlegroups.com.
> >  For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
>
> > >>> --
> > >>> ---
> > >>> Puneet Goyal
> > >>> Student of B. Tech. III Year (Software Engineering)
> > >>> Delhi Technological University, Delhi
> > >>> ---
>
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > Groups
> > >>> "Algorithm Geeks" group.
> > >>> To post to this group, send email to algogeeks@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > >>> algogeeks+unsubscr...@googlegroups.com.
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/algogeeks?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "Algorithm Geeks" group.
> > >> To post to this group, send email to algogeeks@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> algogeeks+unsubscr...@googlegroups.com.
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/algogeeks?hl=en.
>
> > > --
> > > S.Nishaanth,
> > > Computer Science and engineering,
> > > IIT Madras.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > > To post to this group, send email to algogeeks@googlegroups.com.
> > > To unsubscribe from 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.
>
> --
> S.Nishaanth,
> Computer Science and engineering,
> IIT Madras.

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



Re: [algogeeks] a C question

2011-08-05 Thread mithun bs
The culprit in this program is printing a float variable with %d specifier.

printf("%d\n", t);
Removing this line, the program behaves normally.

This line may crash your program. Also it may remove some bytes from your
stack.
I feel this is what happening.

Even I am not very convinced. Still trying to find out !!!



On Fri, Aug 5, 2011 at 9:57 PM, snehi jain  wrote:

> #include
> main()
> {
> long x;
> float t;
>  scanf("%f",&t);
> printf("%d\n",t);
> x=90;
>  printf("%f\n",x);
> {
> x=1;
>  printf("%f\n",x);
> {
> x=30;
>  printf("%f\n",x);
> }
> printf("%f\n",x);
>  }
> x==9;
> printf("%f\n",x);
> getch();
> }
>
>
> o/p
> (when i had given input as 67 this is the output)
>
> 0
> 67.0
> 67.0
> 67.0
> 67.0
> 67.0
>
> can anyone explain me he output..
>
> Thanks
> Snehi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Mithun.B.S
M:9916775380

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



Re: [algogeeks] difference between the two

2011-08-05 Thread UTKARSH SRIVASTAV
I think voth are just same..

On Fri, Aug 5, 2011 at 10:57 AM, priya v  wrote:

> in case of 64 bit machine y doesn't padding happen in the 2nd structure?
>
>
> On Fri, Aug 5, 2011 at 11:21 PM, hary rathor wrote:
>
>> no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
>> but   in 64 machine that enforce to be size of 8 . where padding will take
>> int your given first structure
>>
>> so for 32 bit- size will 8 8 for both structure
>> for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in
>> one structure
>>
>> hence 2nd structure is good for use
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
*UTKARSH SRIVASTAV
CSE-3
B-Tech 2nd Year
@MNNIT ALLAHABAD*

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



[algogeeks] Re: Circle

2011-08-05 Thread Don
// Draw a circle with center (x,y) and radius r
circle(int x, int y, int r)
{
  int a = 0;
  int b = r;
  while(a <= b)
  {
// Draw the current location in all 4 quadrants
plot(x+a, y+b);
plot(x-a,  y+b);
plot(x+a, y-b);
plot(x-a, y-b);
plot(x+b, y+a);
plot(x-b,  y+a);
plot(x+b, y-a);
plot(x-b, y-a);

// Look at two possible next points and pick the better
int delta1 = r*r - (a+1)*(a+1) - b*b;
int delta2 = r*r - a*a - (b-1)*(b-1);
if (delta1*delta1 < delta2*delta2) ++a;
else --b;
  }
}

On Aug 5, 8:38 am, rShetty  wrote:
> Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without
> making use of any floating point
> computations at all.

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

2011-08-05 Thread UTKARSH SRIVASTAV
I THINK THIS WILL CLEAR YOUR DOUBT
x = address of first element of array=&x[0][0]
*x=addrss of x[0][0];
**x=x[0][0]
&x=address of x[0][0];
&x[0]=address of x[0][0];
&x[1]=address of x[1][0]
*x[2]=address of x[2][0];

so 2 is wrong



-- 
*UTKARSH SRIVASTAV
CSE-3
B-Tech 3Rd Year
@MNNIT ALLAHABAD*

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



[algogeeks]

2011-08-05 Thread Rajeshwar Patra
mynode* reverse_recurse(mynode *root)

{

if(root->next!=(mynode *)0)

{

reverse_recurse(root->next);

root->next->next=root;

return(root);

}

else

{

head=root;

}

}
how does it reverses the singly linked list

-- 
*Rajeshwar Patra,*
*MCA final year,*
*Nit Durgapur*

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



Re: [algogeeks] difference between the two

2011-08-05 Thread priya v
in case of 64 bit machine y doesn't padding happen in the 2nd structure?

On Fri, Aug 5, 2011 at 11:21 PM, hary rathor  wrote:

> no ,if u r using 32 bit machine . that will use 4 byte pointer size ,
> but   in 64 machine that enforce to be size of 8 . where padding will take
> int your given first structure
>
> so for 32 bit- size will 8 8 for both structure
> for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in one
> structure
>
> hence 2nd structure is good for use
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



[algogeeks] Re: Goldman sachs intern

2011-08-05 Thread Agyat
guys please post the questions

On Aug 5, 3:13 pm, arvind kumar  wrote:
> NIT ALLAHABAD guys!!
> Please share your experiences abt Goldman sachs recruitment..

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

2011-08-05 Thread Amol Sharma
1
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Fri, Aug 5, 2011 at 10:37 PM, Manish Sharma <
manish.manishkumar.shar...@gmail.com> wrote:

> 1
>
>
> On Fri, Aug 5, 2011 at 10:35 PM, Arshad Alam  wrote:
>
>>
>> we can equate base address of double dimension array to a pointer
>> variable, tell me which one is correct. if "n" is a pointer variable and
>> x[5][5] is double dimension array
>>
>>1. n=x;
>>2. n=x[0][0];
>>3. both
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Manish Kumar Sharma,
> Undergraduate,
> Computer Engg. Department.,
> Netaji Subhas Institute of Technology,
> 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.



Re: [algogeeks] difference between the two

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

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

hence 2nd structure is good for use

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



Re: [algogeeks] simple doubt

2011-08-05 Thread Amol Sharma
both are wrong.run and see that warning will be displayed !!
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar  wrote:

> first one is right and second is wrong.because dp will store address of
> pointer and here you are storing address of int array.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: Duplicates in a string

2011-08-05 Thread hary rathor
i have used 26 bit of checker variable
then i have checked in "if statemet " that if bit is set  there then put
then character in jth posion,
then set the the bit for character

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



Re: [algogeeks] Makemytrip.com

2011-08-05 Thread parag khanna
CS,IT,ECE

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

2011-08-05 Thread priya v
Whats the difference between the two ?

1) struct list
{
   int data;
   list *next;
   }
and
2) struct list
{
   list *next;
   int data;
   }

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



Re: [algogeeks] Makemytrip.com

2011-08-05 Thread pankaj kumar
coming for which branch??

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

2011-08-05 Thread pankaj kumar
when you encounter the letter for first time then simply increment array
having index=(ASCII value-65)
and put that in vector  next time when you will encounter the same variable
again then condition will fail hence no change in content of vector
 hence in the end simply print the vector

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

2011-08-05 Thread rajul jain
Can You please explain this bit manipualtion

On Fri, Aug 5, 2011 at 10:31 PM, hary rathor  wrote:

> #include
> int main ()
> {
> char str[]="hello world";
> int i,j=0,checker=0;
>
> for(i=0;i {
> int  val=str[i]-'a';
>if ((checker&(1checker|=(1< }
>
> str[j]='\0';
>
> printf("%s",str);
> return 0;
>
> }
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Makemytrip.com

2011-08-05 Thread parag khanna
half an hour Aptitude test , after that half an hour written test , then
Technical rounds (2-3) and then HR

profile Software dev - 6 lacs
QA - 5 lacs

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

2011-08-05 Thread pankaj kumar
int b[26]={0};
vectorc;
for(i=0;a[i];i++)
{
if(!b[(a[i]-65)])
{
b[(a[i]-65)]++;
c.push_back(a[i]);
}
}
for(i=0;ihttp://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] array pointer

2011-08-05 Thread Manish Sharma
1

On Fri, Aug 5, 2011 at 10:35 PM, Arshad Alam  wrote:

>
> we can equate base address of double dimension array to a pointer variable,
> tell me which one is correct. if "n" is a pointer variable and x[5][5] is
> double dimension array
>
>1. n=x;
>2. n=x[0][0];
>3. both
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Manish Kumar Sharma,
Undergraduate,
Computer Engg. Department.,
Netaji Subhas Institute of Technology,
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: Duplicates in a string

2011-08-05 Thread priya v
@all : Thanks a lot for the solutions!
On Fri, Aug 5, 2011 at 10:31 PM, hary rathor  wrote:

> #include
> int main ()
> {
> char str[]="hello world";
> int i,j=0,checker=0;
>
> for(i=0;i {
> int  val=str[i]-'a';
>if ((checker&(1checker|=(1< }
>
> str[j]='\0';
>
> printf("%s",str);
> return 0;
>
> }
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-08-05 Thread Arshad Alam
we can equate base address of double dimension array to a pointer variable,
tell me which one is correct. if "n" is a pointer variable and x[5][5] is
double dimension array

   1. n=x;
   2. n=x[0][0];
   3. both

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



Re: [algogeeks] Structure Q

2011-08-05 Thread Amol Sharma
yes... it would be error ...to be specific it is segmentation faultyou
are trying to access a memory which do not exist
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Fri, Aug 5, 2011 at 10:21 PM, pankaj kumar  wrote:

> head->x=100 is not right
> if you will first declare
> head=new list;
> head->x=100;
> will be right.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-08-05 Thread hary rathor
#include
int main ()
{
char str[]="hello world";
int i,j=0,checker=0;

for(i=0;ihttp://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Structure Q

2011-08-05 Thread pankaj kumar
head->x=100 is not right
if you will first declare
head=new list;
head->x=100;
will be right.

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



Re: [algogeeks] simple doubt

2011-08-05 Thread pankaj kumar
first one is right and second is wrong.because dp will store address of
pointer and here you are storing address of int array.

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



Re: [algogeeks] Structure Q

2011-08-05 Thread Jyoti Gupta
it should be head->x=100 ryt???

On 5 August 2011 17:32, Vijay Khandar  wrote:

> Thanks
>
>
> On Fri, Aug 5, 2011 at 5:25 PM, SANDEEP CHUGH wrote:
>
>> ERROR
>>
>> On Fri, Aug 5, 2011 at 5:19 PM, Vijay Khandar wrote:
>>
>>> struct list
>>> {
>>> int x;
>>> struct list *next;
>>> }*head;
>>>
>>> The statement head.x=100
>>> A)assigns 100 to one element of the structure list
>>> B)creates a node of type list and assigns a value to x
>>> C)creates a head of the list
>>> D)error
>>>
>>> Plz anyone provide correct option with explanation..
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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.
>



-- 
Jyoti Gupta
COE , 4th year
Delhi College of Engineering

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



[algogeeks] a C question

2011-08-05 Thread snehi jain
#include
main()
{
long x;
float t;
scanf("%f",&t);
printf("%d\n",t);
x=90;
printf("%f\n",x);
{
x=1;
printf("%f\n",x);
{
x=30;
printf("%f\n",x);
}
printf("%f\n",x);
}
x==9;
printf("%f\n",x);
getch();
}


o/p
(when i had given input as 67 this is the output)

0
67.0
67.0
67.0
67.0
67.0

can anyone explain me he output..

Thanks
Snehi

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



Re: [algogeeks] simple doubt

2011-08-05 Thread himanshu kansal
i think 1st is wrong bt 2nd is correct..

On Fri, Aug 5, 2011 at 9:51 PM, nishaanth  wrote:

> i think both are erroneous.
>
> first statement  i think you are trying to change the array address
> which is not possible.
>
> second statement&arr doesn't make any sense i guess arr gives the
> address but &arr is not allowed
>
>
> On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar wrote:
>
>> but u initialized **dp means .
>> ex-dp=&p  and p=&arr then its correct so dp contains addr of p which
>> inturns contains addrof arr  now **dp is correct initialization.
>>
>>
>>  On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan <
>> aaron.nar...@gmail.com> wrote:
>>
>>> i see but is not arr a pointer to first array element and so &arr contain
>>> address of that pointer ?
>>>
>>>
>>> On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar 
>>> wrote:
>>>
 I dont think so dp=&arr;   since **dp; dp contains the addr of another
 ptr variable...

   On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan <
 aaron.nar...@gmail.com> wrote:

>
> I guess someone had posted a link earlier from which I have a basic
> doubt
>
> when u have
>
> int arr[3]={1,0,2};
> int **dp;
> int (*pa)[3];
>
> is this the right assingment for instance?
>
> pa=arr;
> dp=&arr;
>
> or have I flipped the ampersand in assigning?
>
> Also when I do pa++ will it jump by size of int or the whole array
> size it points to?
> --
>  "People often say that motivation doesn't last. Well, neither does
> bathing - that's why we recommend it daily."
>
> --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

>>>
>>>
>>>
>>> --
>>>  "People often say that motivation doesn't last. Well, neither does
>>> bathing - that's why we recommend it daily."
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> S.Nishaanth,
> Computer Science and engineering,
> IIT Madras.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 

  Regards
Himanshu Kansal
  Msc Comp. sc.
(University of 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] simple doubt

2011-08-05 Thread nishaanth
i think both are erroneous.

first statement  i think you are trying to change the array address
which is not possible.

second statement&arr doesn't make any sense i guess arr gives the
address but &arr is not allowed

On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar wrote:

> but u initialized **dp means .
> ex-dp=&p  and p=&arr then its correct so dp contains addr of p which
> inturns contains addrof arr  now **dp is correct initialization.
>
>
> On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan 
> wrote:
>
>> i see but is not arr a pointer to first array element and so &arr contain
>> address of that pointer ?
>>
>>
>> On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar wrote:
>>
>>> I dont think so dp=&arr;   since **dp; dp contains the addr of another
>>> ptr variable...
>>>
>>>   On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan <
>>> aaron.nar...@gmail.com> wrote:
>>>

 I guess someone had posted a link earlier from which I have a basic
 doubt

 when u have

 int arr[3]={1,0,2};
 int **dp;
 int (*pa)[3];

 is this the right assingment for instance?

 pa=arr;
 dp=&arr;

 or have I flipped the ampersand in assigning?

 Also when I do pa++ will it jump by size of int or the whole array
 size it points to?
 --
  "People often say that motivation doesn't last. Well, neither does
 bathing - that's why we recommend it daily."

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

>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>>  "People often say that motivation doesn't last. Well, neither does
>> bathing - that's why we recommend it daily."
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
S.Nishaanth,
Computer Science and engineering,
IIT Madras.

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

2011-08-05 Thread siva viknesh
ques ll be simple but they expect "solid,secure,scalable, and
efficent" code

.. for instance.. they asked merging 2 sorted LL..

.. ppl who forgot to check d simple condition...say ..

if(head==NULL)return; were eliminated 

On Aug 5, 8:28 pm, raj kumar  wrote:
> Ms written test
> besides objective test you will get three or four subjective questions which
> happened in our case:
> so be prepared for UML diagrams:
> There's high probability that the questions can repeat
> So do these:(don,t remember exactly b'coz i wasn't eligible to sit so
> writing the questions which i heard from others)
> .algorithm for implementing find and replace utility of notepad.
> .how to handel race condition in database.

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

2011-08-05 Thread nishaanth
1

On Fri, Aug 5, 2011 at 5:47 PM, mohit goyal  wrote:

> n=x, is correct
> or n = &x[0][0] is correct
>
> On 8/5/11, Arshad Alam  wrote:
> > we can equate base address of double dimension array to a pointer
> variable,
> > tell me which one is correct. if "n" is a pointer variable and x[5][5] is
> > double dimension array
> >
> >1. n=x;
> >2. n=x[0][0];
> >3. both
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
> >
>
>
> --
> Laugh as much as you breathe and love as long as you live.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
S.Nishaanth,
Computer Science and engineering,
IIT Madras.

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



  1   2   3   >