[algogeeks] suggestion

2011-10-03 Thread sukran dhawan
Hello guys,
Here is a suggestion.With so much talented people in this group,why cant we
a website that is similar to geeksforgeeks.
It will be really helpful to others if all the topics are well organised in
the form of website
This is just a suggestion.just ignore the message if im wrong or u guys don
like the idea

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



Re: [algogeeks] Doubly linked list with one pointer

2011-10-02 Thread sukran dhawan
xor linked list
http://www.geeksforgeeks.org/archives/12367

On Sun, Oct 2, 2011 at 11:33 PM, rahul sharma wrote:

> xor linked list.
>
>
> On Sun, Oct 2, 2011 at 11:32 PM, ~*~VICKY~*~ wrote:
>
>>
>> Design a logic to implement doubly linked list with only one pointer
>> --
>> Cheers,
>>
>>   Vicky
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



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

2011-10-01 Thread sukran dhawan
congrats :) wats d package ?

On Sat, Oct 1, 2011 at 7:35 PM, sagar pareek  wrote:

> cONGRATES
>
>
> On Sat, Oct 1, 2011 at 7:34 PM, rahul sharma wrote:
>
>>
>> congrats buddy
>>
>> On Sat, Oct 1, 2011 at 6:51 PM, siva viknesh wrote:
>>
>>>   I should definitely thank this group and all its members. This
>>> group played a vital role in my placement preparations and surely it
>>> was an excellent "doubt clearing" group.
>>>
>>>   To mention some instance I read about "mutex and semaphore" in many
>>> sites which is not so good, but in this group, some of the members
>>> gave mind-blowing awesome explanations..which on the very next day a
>>> company asked a question applying a similar concept.
>>>
>>>   Thanks a lot ppl :) U helped me a lot directly or indirectly in
>>> getting me placed :)
>>>
>>>  Will soon come up with my detailed interview experiences.
>>>
>>> Proud to be one of the moderators of this group :)
>>>
>>> Wish all final years get dream offers :)
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> **Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] deep vas shallow

2011-10-01 Thread sukran dhawan
yup sorry vice versa :)

On Sat, Oct 1, 2011 at 6:17 PM, rahul vatsa  wrote:

> @sukran,  it seems u ve by mistake written deep copy in place of shallow
> copy & vice versa.
>
>
> On Sat, Oct 1, 2011 at 8:31 AM, sukran dhawan wrote:
>
>> deep copy-value copy
>> so for pointers oly address is copied nt the value
>> so its like two variables pointing to same value
>>
>> shallow copy means pointed to value is copied.so two distinct copies
>> exists
>>
>>
>> On Sat, Oct 1, 2011 at 5:20 PM, rahul sharma wrote:
>>
>>> plz xpalin waht is deep and shallow copy in c++
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] deep vas shallow

2011-10-01 Thread sukran dhawan
deep copy-value copy
so for pointers oly address is copied nt the value
so its like two variables pointing to same value

shallow copy means pointed to value is copied.so two distinct copies exists

On Sat, Oct 1, 2011 at 5:20 PM, rahul sharma wrote:

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

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



Re: [algogeeks] stack help

2011-09-30 Thread sukran dhawan
already discussed.search in archives

On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma wrote:

> hw will u design a stack which will have push pop and min fxn...all should
> operate in o(1) tymreplyn asap
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Linked List Problem

2011-09-29 Thread sukran dhawan
find length of linked list 1 say m
find length of linked list2 say n
take mod(m-n) say k

traverse k nodes in bigger lis
after that both listts one position at a time until the pointers are equal

On Fri, Sep 30, 2011 at 9:34 AM, partik madan  wrote:

> @annarao : as the common data is at the end of the linked lists so the
> length of common data can not be greater than the length of shorter linked
> list . so i think prasanth is right  !!
>
>>
>>
>
>
> --
> *Partik Madan*
> Computer Engm-n g.
> NIT Kurukshetra
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] First non-repeated character complexity?

2011-09-28 Thread sukran dhawan
its not d same .check properly :)

On Wed, Sep 28, 2011 at 9:56 PM, Avenged  wrote:

> It's the same code which was posted earlier. Could you explain how to
> implement using bitset?
>
> --
> 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/-/_X21NZy9kZkJ.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] First non-repeated character complexity?

2011-09-28 Thread sukran dhawan
sorry :D
int RepChar(char *str)
{
int i,j;
int ret = -1;
int count[25];
for (i=0;i<25;++i) {
count[i]=0;
}
for (i=0;str[i];++i) {
j=str[i] - 'a';
count[j]++;
}
for (i=0;str[i];i++) {
if (count[i]==1) {
return ('a'+i);
}
}
return ret;

On Wed, Sep 28, 2011 at 8:10 PM, Shravan Kumar  wrote:

> @Sukran
>
> I guess it will return repeating character in alphabetical order but not in
> order of appearance in the i/p ??
>
>
> On Wed, Sep 28, 2011 at 8:04 PM, sukran dhawan wrote:
>
>> int RepChar(char *str)
>> {
>> int i,j;
>> int ret = -1;
>> int count[25];
>>
>> for (i=0;i<25;++i) {
>> count[i]=0;
>> }
>> for (i=0;str[i];++i) {
>> j=str[i] - 'a';
>> count[j]++;
>> }
>> for (i=0;i<25;i++) {
>> if (count[i]==1) {
>> return ('a'+i);
>> }
>> }
>> return ret;
>>
>> }
>>
>> On Wed, Sep 28, 2011 at 7:57 PM, shady  wrote:
>>
>>> i will mail the code by tomorrow.
>>>
>>>
>>> On Wed, Sep 28, 2011 at 6:54 PM, Avenged  wrote:
>>>
>>>> Bump. Anybody?
>>>>
>>>> --
>>>> 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/-/on-DbSKUdzsJ.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] First non-repeated character complexity?

2011-09-28 Thread sukran dhawan
int RepChar(char *str)
{
int i,j;
int ret = -1;
int count[25];

for (i=0;i<25;++i) {
count[i]=0;
}
for (i=0;str[i];++i) {
j=str[i] - 'a';
count[j]++;
}
for (i=0;i<25;i++) {
if (count[i]==1) {
return ('a'+i);
}
}
return ret;
}

On Wed, Sep 28, 2011 at 7:57 PM, shady  wrote:

> i will mail the code by tomorrow.
>
>
> On Wed, Sep 28, 2011 at 6:54 PM, Avenged  wrote:
>
>> Bump. Anybody?
>>
>> --
>> 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/-/on-DbSKUdzsJ.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] ADOBE

2011-09-28 Thread sukran dhawan
which coll ?

On Wed, Sep 28, 2011 at 2:49 PM, DIVIJ WADHAWAN  wrote:

> Adobe is coming to my college in mid October.
> Can someone tell me what kind of questions do they ask, number and types of
> rounds etc ??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-09-28 Thread sukran dhawan
wats the package ?

On Tue, Sep 27, 2011 at 9:08 PM, Nitin  wrote:

> C questions there are 12 -13 questions given on internet it will be same as
> it is given in the paper ,i dnt find a link right now otherwise do test ur c
> skills thoruoghly all c questions will be from that book
>
>
> On Tue, Sep 27, 2011 at 7:47 PM, vartika aggarwal <
> vartika.aggarwa...@gmail.com> wrote:
>
>> Thanks! :-)
>>
>>
>> On Tue, Sep 27, 2011 at 7:45 PM, rahul sharma wrote:
>>
>>>
>>> test ur c skill for c..ds simple and os simpleno need to prepare
>>> if know basics...
>>> 25 dieasy.25 problem solving...
>>> interviews will b easy to crack...once u done with test u have done 90%
>>> all d best
>>>
>>> On Tue, Sep 27, 2011 at 7:24 PM, sourabh jain 
>>> wrote:
>>>



 1, writin 50 que.. (20 frm DI, 5 frm Quanta, 25 frm puzzel)
 2. technical written (20 frm c/c++, 5 frm DS, 5 frm OS)
 3. technical interview ( c/c++, DS, OS)
 4. HR interview (normal)


 --
 Regards
 SOURABH KUMAR JAIN
 MCA,  NIT RAIPUR
 MOB.-+919993878717


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

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

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



Re: [algogeeks] Find lowest common ancestor of Binary Tree

2011-09-27 Thread sukran dhawan
it has already been discussed .. search in the archives

On Wed, Sep 28, 2011 at 10:57 AM, Ankuj Gupta  wrote:

> Find lowest common ancestor of Binary Tree
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> adFor more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Amazon Ques

2011-09-27 Thread sukran dhawan
call function recursively when it is the last node, return the function
calls and print it

On Wed, Sep 28, 2011 at 8:20 AM, rahul sharma wrote:

> make sure that u ryt the syntax correct
>
>
> On Wed, Sep 28, 2011 at 8:18 AM, rahul sharma wrote:
>
>> reverse(head)
>> {
>> if(head==NUll)
>> {
>> printf("head->info");
>> return;
>> }
>> reverse(head->link)
>> printf("head->info);
>> }
>>
>> On Wed, Sep 28, 2011 at 4:39 AM, anand karthik <
>> anandkarthik@gmail.com> wrote:
>>
>>> Reverse it , print it and reverse it again. :-)
>>>
>>> On Wed, Sep 28, 2011 at 3:28 AM, Ankur Garg 
>>> wrote:
>>> > Print Reverse of linked list (dont reverse it) with only constant
>>> space.
>>> >
>>> > Recursion uses stack spaceO(n) ..so post some other solution ..
>>> >
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Algorithm Geeks" group.
>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>>
>>>
>>>
>>> --
>>> Best,
>>> T Anand Karthik,
>>>
>>> Contact number: +91-9571552652
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Amazon Ques

2011-09-27 Thread sukran dhawan
@rahul
if(head == null) return;

u cant print head->info when head is null

On Wed, Sep 28, 2011 at 8:20 AM, rahul sharma wrote:

> make sure that u ryt the syntax correct
>
>
> On Wed, Sep 28, 2011 at 8:18 AM, rahul sharma wrote:
>
>> reverse(head)
>> {
>> if(head==NUll)
>> {
>> printf("head->info");
>> return;
>> }
>> reverse(head->link)
>> printf("head->info);
>> }
>>
>> On Wed, Sep 28, 2011 at 4:39 AM, anand karthik <
>> anandkarthik@gmail.com> wrote:
>>
>>> Reverse it , print it and reverse it again. :-)
>>>
>>> On Wed, Sep 28, 2011 at 3:28 AM, Ankur Garg 
>>> wrote:
>>> > Print Reverse of linked list (dont reverse it) with only constant
>>> space.
>>> >
>>> > Recursion uses stack spaceO(n) ..so post some other solution ..
>>> >
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Algorithm Geeks" group.
>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>>
>>>
>>>
>>> --
>>> Best,
>>> T Anand Karthik,
>>>
>>> Contact number: +91-9571552652
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] How to height balance a binary search tree ?

2011-09-27 Thread sukran dhawan
avl tree

On Tue, Sep 27, 2011 at 10:15 PM, Ankuj Gupta  wrote:

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

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



Re: [algogeeks] Try on linux terminal

2011-09-27 Thread sukran dhawan
yup +1 to shady

On Tue, Sep 27, 2011 at 3:44 PM, shady  wrote:

> at some places there is restriction on the memory that can be utilized...
> there such actions fail.
>
>
> On Tue, Sep 27, 2011 at 3:40 PM, sukran dhawan wrote:
>
>> nothing is gonna happen... just restart the system after it hangs unless u
>> don put it in init :)
>>
>>
>> On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan <
>> suganyapl...@gmail.com> wrote:
>>
>>>
>>>
>>> Don't try this... :( :(
>>>
>>>
>>> --Regards,
>>> Sug@ny@...
>>>
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Try on linux terminal

2011-09-27 Thread sukran dhawan
nothing is gonna happen... just restart the system after it hangs unless u
don put it in init :)

On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan  wrote:

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

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

2011-09-26 Thread sukran dhawan
compile time error... except case labels nothing else will be executed in
case of switch statements... so definition of b will not be executed.so
compilation error

On Tue, Sep 27, 2011 at 6:28 AM, Ratan  wrote:

> #include
> int main()
> {
>int a=1;
>switch(a)
>{
> int b=6;
>case 1:
> printf("b is %d",b);
>break;
>default:
>printf("b is %d:",b);
>break;
>}
> return 0;
> }
>
> can any1 explain the o/p of this program...
>
>
>
>
>
> Thanxs n Regards
> --
> Ratan Modi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 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: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread sukran dhawan
ya pl send

On Mon, Sep 26, 2011 at 8:04 PM, rahul sharma wrote:

> itz same as at scribd.comnot complete..i think
> itz not easilty availabl
>
>
> 2011/9/26 Vιиodh 
>
>> @yogesh : pages are missing in the book u ve mailed man... ly few pages
>> are ther in the book u jus maile..
>>
>>
>> On Mon, Sep 26, 2011 at 7:23 PM, Yogesh Yadav  wrote:
>>
>>>
>>> 
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> With regards,
>> Vιиodh
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Amazon Interview Question

2011-09-26 Thread sukran dhawan
count the number of 0s 1s 2s.then store os first den 1s followed by 2s

On Sat, Sep 24, 2011 at 9:55 AM, Anup Ghatage  wrote:

> Is this like the segregating all the 1's to the right and the 0's to the
> left
> or am i missing something?
>
>
> On Sat, Sep 24, 2011 at 9:39 AM, VIHARRI  wrote:
>
>> You are given a string (consisting of 0's, 1's or 2's) where 0
>> represents a blue ball, 1 a
>> red ball, and 2 a black ball. Using only swap operations (counting
>> sort not allowed)
>> rearrange the string such that all blue balls are together on one
>> side, followed by all red
>> balls, and then all black balls. You can iterate through the string
>> only once.
>> Eg 102112011 should produce 00122?
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Anup Ghatage
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: puzzle

2011-09-24 Thread sukran dhawan
GP

2011/9/24 яαωαт Jee 

> ^^ ans will be n*30 mins
>
> On Sep 24, 8:40 am, яαωαт Jee  wrote:
> > sum of GP..
> > a=1
> > common ratio=4
> >
> > sum is given=5.6 billion.. find n
> > simple enough
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Try on linux terminal

2011-09-23 Thread sukran dhawan
awesome :)

On Fri, Sep 23, 2011 at 11:20 PM, Amol Sharma wrote:

> *http://en.wikipedia.org/wiki/Fork_bomb*
> --
>
>
> Amol Sharma
> Third Year Student
> Computer Science and Engineering
> MNNIT Allahabad
>  <http://gplus.to/amolsharma99> 
> <http://twitter.com/amolsharma99><http://in.linkedin.com/pub/amol-sharma/21/79b/507><http://youtube.com/amolsharma99>
>
>
>
>
>
> On Fri, Sep 23, 2011 at 11:15 PM, sukran dhawan wrote:
>
>> can u explain it ?
>>
>>
>> On Fri, Sep 23, 2011 at 10:54 PM, Anil Arya wrote:
>>
>>>:(){ :|:& };:
>>>
>>>
>>> --
>>> *Anil  Arya,
>>> Computer Science *
>>> *Motilal Nehru National Institute of Technology,Allahabad .
>>> *
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Try on linux terminal

2011-09-23 Thread sukran dhawan
can u explain it ?

On Fri, Sep 23, 2011 at 10:54 PM, Anil Arya  wrote:

>:(){ :|:& };:
>
>
> --
> *Anil  Arya,
> Computer Science *
> *Motilal Nehru National Institute of Technology,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] plz reply quickly

2011-09-23 Thread sukran dhawan
@yogesh:for linked list that will not work coz loop doesnt always mean
rear->next will be front
hare and tortoise rule will serve the purpose

On Fri, Sep 23, 2011 at 10:15 PM, Yogesh Yadav  wrote:

> I am not sure about these...but i guess this will do the job
>
> In Linked List:
>
> (rear->next==front)
>
> In Array:
>
> after reaching the maximum size or the end of queue ...just add one more
> element in queue... and after addition just check
> (queue[front]==new_element_added) ... if yes then circular queue
>
>
> .
>
> On Fri, Sep 23, 2011 at 9:51 PM, Ashima .  wrote:
>
>> in hair and tortoise this they will meet wen 1st pointer(tortoise) is at
>> the end of the linked list(in 1st traverse) and 2nd pointer( hair) reaches
>> the same node 2nd time. That means u traversed the list twice.
>> Its better that since u hv the head of the linked list,  keep on moving
>> till the end .If next of end is head then its circular.
>> Rather for queue, u hv track of both front and rear, so just check if
>> rear->next ==front. One line code.
>> Ashima
>> M.Sc.(Tech)Information Systems
>> 4th year
>> BITS Pilani
>> Rajasthan
>>
>>
>>
>>
>> On Fri, Sep 23, 2011 at 8:13 AM, Aditya Virmani > > wrote:
>>
>>> in arrays i guess it can be simply analysed checking the last element of
>>> array(which can be obtained by sizeof) & checking how the entries are filled
>>> inn the array...
>>> in linked list hair & tortoise rule...initialize two pointers...one's
>>> step size:1, second's step size two... & run through the linked list, if
>>> they meet newhere ...it contains a loop or circular list.
>>>
>>>
>>> On Thu, Sep 22, 2011 at 10:51 PM, sukran dhawan 
>>> wrote:
>>>
>>>> use hair and tortoise rule for lists
>>>> i don think we can do it for arrays
>>>>
>>>>
>>>> On Thu, Sep 22, 2011 at 10:22 PM, Ishan Aggarwal <
>>>> ishan.aggarwal.1...@gmail.com> wrote:
>>>>
>>>>> In both the cases... what would be the condition?
>>>>>
>>>>>
>>>>> On Thu, Sep 22, 2011 at 10:19 PM, sukran dhawan <
>>>>> sukrandha...@gmail.com> wrote:
>>>>>
>>>>>> queue represnted as array or linked list ?
>>>>>>
>>>>>>
>>>>>> On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal <
>>>>>> ishan.aggarwal.1...@gmail.com> wrote:
>>>>>>
>>>>>>> How will u detect if a queue is circular or not??
>>>>>>>
>>>>>>> --
>>>>>>> Kind Regards
>>>>>>> Ishan Aggarwal
>>>>>>> [image: Aricent Group]
>>>>>>> Presidency Tower-A, M.G.Road,Sector-14
>>>>>>> Gurgaon,Haryana.122015 INDIA
>>>>>>> Phone : +91-9654602663
>>>>>>> ishan2.aggar...@aricent.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.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Kind Regards
>>>>> Ishan Aggarwal
>>>>> [image: Aricent Group]
>>>>> Presidency Tower-A, M.G.Road,Sector-14
>>>>> Gurgaon,Haryana.122015 INDIA
>>>>> Phone : +91-9654602663
>>>>> ishan2.aggar...@aricent.com 
>>>>>

Re: [algogeeks] plz reply quickly

2011-09-23 Thread sukran dhawan
@aditya:can u explain ur array approach ?

On Fri, Sep 23, 2011 at 8:43 PM, Aditya Virmani wrote:

> in arrays i guess it can be simply analysed checking the last element of
> array(which can be obtained by sizeof) & checking how the entries are filled
> inn the array...
> in linked list hair & tortoise rule...initialize two pointers...one's step
> size:1, second's step size two... & run through the linked list, if they
> meet newhere ...it contains a loop or circular list.
>
>
> On Thu, Sep 22, 2011 at 10:51 PM, sukran dhawan wrote:
>
>> use hair and tortoise rule for lists
>> i don think we can do it for arrays
>>
>>
>> On Thu, Sep 22, 2011 at 10:22 PM, Ishan Aggarwal <
>> ishan.aggarwal.1...@gmail.com> wrote:
>>
>>> In both the cases... what would be the condition?
>>>
>>>
>>> On Thu, Sep 22, 2011 at 10:19 PM, sukran dhawan 
>>> wrote:
>>>
>>>> queue represnted as array or linked list ?
>>>>
>>>>
>>>> On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal <
>>>> ishan.aggarwal.1...@gmail.com> wrote:
>>>>
>>>>> How will u detect if a queue is circular or not??
>>>>>
>>>>> --
>>>>> Kind Regards
>>>>> Ishan Aggarwal
>>>>> [image: Aricent Group]
>>>>> Presidency Tower-A, M.G.Road,Sector-14
>>>>> Gurgaon,Haryana.122015 INDIA
>>>>> Phone : +91-9654602663
>>>>> ishan2.aggar...@aricent.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.
>>>>
>>>
>>>
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> ishan2.aggar...@aricent.com 
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] What is the maximum no. of arguments that can be given in a command line in C...??

2011-09-23 Thread sukran dhawan
infinite i think not two... u can give many

On Fri, Sep 23, 2011 at 8:01 PM, amrit harry wrote:

> R U SUREI DONT THINK SOO...? HAD U CHKED IT...?
>
>
> On Fri, Sep 23, 2011 at 7:58 PM, rahul sharma wrote:
>
>> two
>>
>> On Fri, Sep 23, 2011 at 7:25 PM, amrit harry wrote:
>>
>>> solve it.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> AMRIT
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Doubts about realloc

2011-09-23 Thread sukran dhawan
yes realloc can be used to shrink the allocated memory. yes the remaining
memory will be freed.
IF we want to allocate more memory and if there is no enough room in that
particular boundary,  i will allocate a new block ,copy the contents and
free the previous contents

On Thu, Sep 22, 2011 at 10:31 PM, Ankuj Gupta  wrote:

> Hi
>
> I have a doubt in functioning of realloc. Can we use realloc to shrink
> the memory already allocated ? If yes, will it also free the left over
> memory or programmer has to do it ? Also, while reallocating if it has
> to move to some other location does the earlier location gets freed or
> is it implementation dependent
>
> Thanks
> Ankuj
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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

2011-09-22 Thread sukran dhawan
congrats

On Thu, Sep 22, 2011 at 10:33 PM, Prakash D  wrote:

> congrats brother!!
>
>
> On Thu, Sep 22, 2011 at 6:42 PM, saurabh  wrote:
>
>> thanx to all
>>
>> I have shared my interview experience at
>> http://msidcinterview.blogspot.com/
>> ta
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] plz reply quickly

2011-09-22 Thread sukran dhawan
use hair and tortoise rule for lists
i don think we can do it for arrays

On Thu, Sep 22, 2011 at 10:22 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> In both the cases... what would be the condition?
>
>
> On Thu, Sep 22, 2011 at 10:19 PM, sukran dhawan wrote:
>
>> queue represnted as array or linked list ?
>>
>>
>> On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal <
>> ishan.aggarwal.1...@gmail.com> wrote:
>>
>>> How will u detect if a queue is circular or not??
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> ishan2.aggar...@aricent.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.
>>
>
>
>
> --
> Kind Regards
> Ishan Aggarwal
> [image: Aricent Group]
> Presidency Tower-A, M.G.Road,Sector-14
> Gurgaon,Haryana.122015 INDIA
> Phone : +91-9654602663
> ishan2.aggar...@aricent.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] plz reply quickly

2011-09-22 Thread sukran dhawan
queue represnted as array or linked list ?


On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> How will u detect if a queue is circular or not??
>
> --
> Kind Regards
> Ishan Aggarwal
> [image: Aricent Group]
> Presidency Tower-A, M.G.Road,Sector-14
> Gurgaon,Haryana.122015 INDIA
> Phone : +91-9654602663
> ishan2.aggar...@aricent.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] easy c output....

2011-09-22 Thread sukran dhawan
awesome :)

On Thu, Sep 22, 2011 at 7:55 PM, amrit harry wrote:

> @balaji +1 :)
>
>
> On Thu, Sep 22, 2011 at 2:01 PM, Anil Arya  wrote:
>
>> thanx Balaji:)
>>
>>
>> On Thu, Sep 22, 2011 at 6:07 AM, Balaji wrote:
>>
>>> Hi Anil,
>>>
>>> #a is a preprocessor operator to convert the argument specified as string
>>> or enclosing in double quotes. so, after macro expansion, the printf
>>> statement would become
>>>
>>> printf("%d\n",*"432"); =>
>>>
>>> printf("%d\n","432"[0]);=>
>>>
>>> printf("%d\n",*"4");
>>>
>>> which prints the ASCII equivalent 52.
>>>
>>>
>>> Similarly, using printf("%d\n", "432"[1]),printf("%d\n", "432"[2]) would 
>>> yield 52 and 51 respectively. Let me know.
>>>
>>>
>>> Thanks,
>>>
>>> Balaji
>>>
>>>
>>>
>>>
>>> On Wed, Sep 21, 2011 at 4:34 PM, Anil Arya wrote:
>>>





 #include

 #define  power(a) #a

 int main(){printf("%d\n",*power(432));return 0;}

 why it is giving 52 as output?





 --
 *Anil  Arya,
 Computer Science *
 *Motilal Nehru National Institute of Technology,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.
>>>
>>
>>
>>
>> --
>> *Anil  Arya,
>> Computer Science *
>> *Motilal Nehru National Institute of Technology,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.
>>
>
>
>
> --
> AMRIT
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
its right to left

On Wed, Sep 21, 2011 at 7:41 PM, kartik sachan wrote:

> thanks sukran...
> i have one more question evaluation of printf is also undefined in C??
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
hmmm it is compiler dependent... try out with different compilers... but
even though dey give same results,standard c left this eature as undefined
for efficiency purposes

On Wed, Sep 21, 2011 at 7:16 PM, kartik sachan wrote:

> @sukran  if it is undefined in ansi c so it can return any value???
> at complilaton.but all time it is giving me same value
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] tree to list

2011-09-21 Thread sukran dhawan
do BFS search,at each level make a linked list

On Wed, Sep 21, 2011 at 6:50 PM, prasanth n  wrote:

> anyone give an algorithm of how to convert a binary search tree into a
> linkedlist
>
> --
> *prasanth*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To ost to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
IT is not the case ... I already said acc to ANSI c result is undefined
!! not 0 by dault

On Wed, Sep 21, 2011 at 6:50 PM, kartik sachan wrote:

> ans in both cases is zero
> i think if return is written and nthg specified value is given it will
> return by default zero
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Segmentation fault with vfork

2011-09-21 Thread sukran dhawan
 @sreeu :lol #includewrote:

>
> hi it gives that
>
>
> in fun1:incompatible implicit declaration of built-in function ‘printf’
>
>  in fun2:incompatible implicit declaration of built-in function ‘printf’
>
>
> On Wed, Sep 21, 2011 at 7:37 AM, saurabh singh wrote:
>
>> #include
>> int fun1()
>> {
>> if(vfork()==0);
>> else printf("Fun1\n");
>> }
>> int fun2()
>> {
>> printf("Fun2\n");
>> }
>> int main()
>> {
>> fun1();
>> fun2();
>> return 0;
>> }
>> Why does this program giving seg fault.?
>>
>> --
>> 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.
>

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

2011-09-20 Thread sukran dhawan
void towersofhanoi(char source,char dest,char auxiliary,int n)
{
   if(n == 0)
  return;
else
towersoffhanoi(source,auxiliary,dest,n-1);
printf("%c to %c \n",source,dest);
towersohanoi(auxiliary,dest,source.n-1);
}

On Tue, Sep 20, 2011 at 11:07 PM, prasanth n  wrote:

> @don:
> yes it think
>
>
> On Tue, Sep 20, 2011 at 11:00 PM, Don  wrote:
>
>> Does the call stack count as a stack?
>>
>> Don
>>
>> On Sep 20, 12:27 pm, prasanth n  wrote:
>> > In the classic problem of the Towers of Hanoi, you have 3 rods and N
>> disks
>> > of different sizes which can slide onto any tower. The puzzle starts
>> with
>> > disks sorted in ascending order of size from top to bottom (e.g., each
>> disk
>> > sits on top of an even larger one). You have the following constraints:
>> > (A) Only one disk can be moved at a time.
>> > (B) A disk is slid off the top of one rod onto the next rod.
>> > (C) A disk can only be placed on top of a larger disk.
>> > Write a program to move the disks from the first rod to the last using
>> > Stacks.
>> >
>> > --
>> > *prasanth*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> *prasanth*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 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: What is the time to get min element from the binary max heap !!

2011-09-20 Thread sukran dhawan
o(n)

On Tue, Sep 20, 2011 at 6:42 PM, CHERUVU JAANU REDDY <
jaanu.cher...@gmail.com> wrote:

>
> We can find minimum element in O(n) time.
>
> Just compare leaf nodes in max heap tree.
>
>
>
> Cheers
> Janardhan Reddy Cheruvu
> +91-9642421117
>
>
>
>
>
>
>
>
>
>
>
> On Tue, Sep 20, 2011 at 6:39 PM, saurabh agrawal wrote:
>
>> I think, we have to delete all the elements from the heap which takes
>> o(n*logn). Please share if you have any better solutions.
>>
>> On Tue, Sep 20, 2011 at 6:38 PM, saurabh agrawal wrote:
>>
>>> What is the time to get min element from the binary max heap !!
>>> You might be given the heap as API. I mean, you dont have implementation
>>> of the heap.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-09-20 Thread sukran dhawan
How do you implement google maps ?

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



Re: [algogeeks] All valid dictionary words must be found and printed.

2011-09-19 Thread sukran dhawan
trie data structure

On Mon, Sep 19, 2011 at 10:37 PM, praveen raj  wrote:

> Use trie.
> On 19-Sep-2011 8:20 PM, "Sangeeta"  wrote:
> > given an array of characters without spaces and a dictionary.All valid
> > dictionary words must be found and printed.
> > i/p : BANKERKCATXYWOMAN.
> > o/p: BANK
> > BANKER
> > CAT
> > WOMAN
> > MAN
> > (the only function you could use for dictionary is
> > dictionary.findword(char *str) which returns a Boolean value).
> > Eg. Dictionary.findword(“bank”) =>true
> > Dictionary.findword(“hj”) =>false
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: c output

2011-09-19 Thread sukran dhawan
According to K and R c book , when the return value is specified and yet we
fail to return a value, it is undefined. It is compiler dependent.

So i feel  there is no meaning in thinking abt it

On Mon, Sep 19, 2011 at 4:38 PM, abhishek  wrote:

> @ sukran
> if it is giving same ans then there  has to be some reason,
>
> On Sep 19, 12:45 pm, sukran dhawan  wrote:
> > common guys its undefined acc to standard c 
> >
> > On Mon, Sep 19, 2011 at 12:36 PM, Siddhartha Banerjee <
> >
> >
> >
> >
> >
> >
> >
> > thefourrup...@gmail.com> wrote:
> > > on running,every time i get  second a=30... any reasons for that???
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Algorithm Geeks" group.
> > > To post to this group, send email to algogeeks@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > algogeeks+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] c output

2011-09-19 Thread sukran dhawan
common guys its undefined acc to standard c 

On Mon, Sep 19, 2011 at 12:36 PM, Siddhartha Banerjee <
thefourrup...@gmail.com> wrote:

> on running,every time i get  second a=30... any reasons for that???
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] complement

2011-09-18 Thread sukran dhawan
2's complement

On Mon, Sep 19, 2011 at 3:56 AM, Arun Vishwanathan
wrote:

> Hi all,
>
> When I take negation of an integer in C, 0 is displayed as -1
> ~5 is displayed as -6.
> Can some one tell me the logic of how this conversion is happening in C?
>
> Arun
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] c output

2011-09-18 Thread sukran dhawan
again undefined in standard c :)

On Sun, Sep 18, 2011 at 1:49 PM, Bhavesh agrawal wrote:

> another que..
>
>
> #include
> main()
> {
> int a;
> int i=10;
> printf("%d %d %d\n",i+++i,i,i---i);
> printf("%d\n",i---i);
> a=i---i;
> printf("%d \n%d",a,i);
> return 0;
> }
>
> output:
>
> 18 10 0
> 0
> 0
> 8
>
> how ??
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] c output

2011-09-18 Thread sukran dhawan
result is not defined by standard c. It doesnt produce compiler error just
because return type is int and no value is returned in if(1>0)
basically garbage

On Sun, Sep 18, 2011 at 12:23 PM, Bhavesh agrawal wrote:

> #include
>
> main()
>
> {
>
> int a ;
>
> a=abc();
>
> printf("\n %d this is fisrt a:",a);
>
> a=abc();
>
> printf("\n %d this is second a:",a);
>
> }
> int abc()
>
> {
>
> int i=23;
>
> if(1>0)
>
> return ;
>
> i++;
>
> return(++ i);
>
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] URGENTTTTTTTTT suggestion REGARDING placement...............

2011-09-17 Thread sukran dhawan
Dont attend deloite

On Sat, Sep 17, 2011 at 8:25 PM, vivek goel wrote:

> HELLO  FRIENDS,,,
> PLEASE give me advice THAT   if there is a student of  *computer
> branch(B.E.  or MCA) and suppose most probably he may be able to get job in
> Deloitte  during campus placements*, as it is a *dream
> company* .then he or she would not be allow to sit for
> further * campus placements ..after  getting selected in
> Deloitte...*
> *then what he or she  should do???*...he or she  should
> go for the  companies which are yet to come...or should try his
> or her* best  for DELOITTE* only.*..*
> *as there are many more good ** **software companies are yet to come in
> the Campus...
> *
> and
>
> if he or she gets select*ed in DELOITTE*...
> then later...can he or she *switch*..to* pure coding companie*s like
> ...*microsoft,  yahoo, google , amazon
> etc...??.*...
> as in DELOITTE there might be less coding
> work...
>
> plss  help.
>
>
>
>
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] find the error

2011-09-17 Thread sukran dhawan
get() function ?

On Thu, Sep 15, 2011 at 12:14 AM, rahul vatsa  wrote:

>  ther is no get() function.
>
>
> On Wed, Sep 14, 2011 at 1:55 PM, Puneet Gautam wrote:
>
>> I think there is no problem with the while statement, even if file is
>> not present , it will create a new file...
>> The problem is with f.get()but dunno what...?
>>
>>
>> On 9/14/11, sandeep kumar  wrote:
>> > if file.txt is not present it gives a seg fault
>> > and if the file is present then the problem is with f.get(), use fgetc
>> or
>> > fgets etc the program runs without any error
>> >
>> >
>> > *..*
>> > *
>> > **Regards
>> >
>> > Sandeep Kumar
>> > MTech Computer Science
>> > **IIT Madras*
>> >
>> >
>> >
>> > Music washes away from the soul the dust of everyday life
>> >
>> -
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Algorithm Geeks" group.
>> > To post to this group, send email to algogeeks@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > algogeeks+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/algogeeks?hl=en.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] C Problem

2011-09-17 Thread sukran dhawan
4 and 5. size of will check its first operand. so no evaluation takes
place...

On Sat, Sep 17, 2011 at 2:32 PM, abhinav gupta wrote:

> Ans will be:4,5
>
>
> On Sat, Sep 17, 2011 at 2:23 PM, Sanjay Rajpal  wrote:
>
>> #include
>>
>> int main()
>> {
>> int a=5;
>> printf("Size : %d\n",sizeof( a =15/2));
>> printf("A is %d.",a);
>> }
>>
>> What will be the value of a now ? Plz explain.
>> Sanju
>> :)
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] matrix

2011-09-17 Thread sukran dhawan
kadane s algo

On Sat, Sep 17, 2011 at 3:25 PM, prasanth n  wrote:

> given a matrix with +ve and -ve numbers, find the submatrix with maximum
> sum??
>
> --
> *prasanth*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Plz explain the output..........

2011-09-16 Thread sukran dhawan
x== 9 is not an error !!! it simply returns a non zero value if its true and
0 if its false

On Sat, Sep 17, 2011 at 11:39 AM, praveen raj  wrote:

> This will show syntax error due to x==9 and otherwise since memory address
> given at the declarAtion there fore  x value will. Change at every
> assignment , but i m not sure printf will give an error or not . Plz reply.
>
> On 17-Sep-2011 1:13 AM, "Anshul AGARWAL" 
> wrote:
> >
> > #include
> > int  main()
> > {float t;
> > long x;
> >
> >
> > t=98;
> > printf("%d\n",t);
> >   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);
> >
> > }
> > 
> > ---
> > Anshul Agarwal
> > Nit Allahabad
> > Computer Science
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Plz explain the output..........

2011-09-16 Thread sukran dhawan
Printing a floating point with  %d conversion specifier will not print the
expected resultss !

On Sat, Sep 17, 2011 at 1:13 AM, Anshul AGARWAL
wrote:

> #include
> int  main()
> {float t;
> long x;
>
>
> t=98;
> printf("%d\n",t);
>   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);
>
> }
> 
> ---
> *Anshul Agarwal
> Nit Allahabad
> Computer Science**
> *
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

2011-09-16 Thread sukran dhawan
not possible

On Fri, Sep 16, 2011 at 12:17 PM, tech coder wrote:

> +1 to don
>
>
> On Thu, Sep 15, 2011 at 9:40 PM, Don  wrote:
>
>> Not really. Usually you would need a second parameter indicating the
>> size of the input. In theory it might be possible to put a marker
>> value at the end of the array.
>>
>> Most implementations of malloc store the size of the memory block in
>> the word immediately before the returned address. This is used when
>> you free the memory. So some programmers use things like:
>>
>> int *data = (int *)malloc(n*sizeof(int));
>>
>> And then later:
>> int size = *(data-4)/sizeof(int);
>>
>> This would not work if data was declared as an array rather than as a
>> malloced pointer. It is also completely implementation dependent, so I
>> would not recommend it for any code which someone may someday have to
>> maintain.
>>
>> Don
>>
>> On Sep 15, 10:59 am, rahul vatsa  wrote:
>> > if i pass an int array to a function, is it possible to find out the no
>> of
>> > elements in the called function ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> *
>
>  Regards*
> *"The Coder"*
>
> *"Life is a Game. The more u play, the more u win, the more u win , the
> more successfully u play"*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Symantec

2011-09-16 Thread sukran dhawan
which college ? and package ?

On Fri, Sep 16, 2011 at 7:39 PM, siva viknesh wrote:

> Hi
>
> Symantec is comin to our collanyone if attended plz share
> written pattern and interview ques...thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Interview Questions

2011-09-15 Thread sukran dhawan
run time error because pointer is not assigned a address and it will be
pointing to some junk location
so *x = 1000 will result in a run time error

On Thu, Sep 15, 2011 at 11:32 PM, SAMMM  wrote:

> #include
> #include
> using namespace std;
>
> int main()
> {
>  int w=10;
>  int *p=&w;
>  int *x;
>  *x=1000;
>  int *y;
>  *y=100;
>  printf("%d %d %d",*x,*p,*y);
>  return 0;
> }
>
>
> Wht is the o/p  ??
>
> 1)1000 10 100
> 2)1000 10 10
> 3)Compilation Error
> 4)Run Time Error
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] plzzzzzzzz heeeppppp!!!!!!!!!!1

2011-09-15 Thread sukran dhawan
Just opt fot testing ... If there is a slot for development in the company
they will look for the guys in testing first b4 actually going for outside
ppl

And u can easily shift from testing to development if u perform well


On Thu, Sep 15, 2011 at 10:57 AM, rahul sharma wrote:

> hey guys plz tell the difference b/w testing n develp.  profile ??? n
> joing i n testing profile has growth as much as in develpoer???plz
> tell soon..?should i go in testing profile in lagre industry or in
> developer in medium scale...plz hepl
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] program

2011-09-14 Thread sukran dhawan
heap construction ...

On Wed, Sep 14, 2011 at 4:44 PM, bharatkumar bagana <
bagana.bharatku...@gmail.com> wrote:

> with space O(n) and time O(n), we can trace the whole array and maintain
> the freq of each number and by one more trace with using 3 variables ,
> we can find top 3 
>
>
> On Wed, Sep 14, 2011 at 11:20 AM, raj  wrote:
>
>> program to find the top 3 repeating number from the given array
>> eg
>> You r given an array and u have to find out the top 3 repeated
>> numbers.
>>  for ex: GAURAV[]={20,8,3,7,8,9,20,6,4,6,20,8,20}
>> so the output will be: 20 is repeated 4 times 8 is repeated 3 times 6
>> is repeated 2 times.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
>
> **Please do not print this e-mail until urgent requirement. Go Green!!
> Save Papers <=> Save Trees
> *BharatKumar Bagana*
> **http://www.google.com/profiles/bagana.bharatkumar
> *
> Mobile +91 8056127652*
> 
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Matrix

2011-09-14 Thread sukran dhawan
wat do u mean by reversing a matrix ?

On Wed, Sep 14, 2011 at 4:51 PM, bharatkumar bagana <
bagana.bharatku...@gmail.com> wrote:

> will u pls provide one example .. so that every one understand ...
>
>
> On Wed, Sep 14, 2011 at 1:29 PM, guna sekaran  wrote:
>
>> Write a program for reversing the matrix
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
>
> **Please do not print this e-mail until urgent requirement. Go Green!!
> Save Papers <=> Save Trees
> *BharatKumar Bagana*
> **http://www.google.com/profiles/bagana.bharatkumar
> *
> Mobile +91 8056127652*
> 
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: unique no. problem

2011-09-13 Thread sukran dhawan
good one

On Tue, Sep 13, 2011 at 2:37 PM, kARTHIK R  wrote:

> Nice one sagar.
> Karthik R,
> R&D Engineer,
> Tejas Networks.
>
>
>
> On Tue, Sep 13, 2011 at 2:36 PM, sagar sindwani 
> wrote:
>
>>
>> http://stackoverflow.com/questions/3963409/interview-question-dealing-with-m-occurrences-among-n
>>
>>
>> On Tue, Sep 13, 2011 at 1:48 PM, Gene  wrote:
>>
>>> Here's a way:
>>>
>>> The base 2 xor operator has an obvious extension to base 3 such that
>>> for all integers N,   N ^ N ^ N = 0, just like the normal xor has N ^
>>> N = 0.
>>>
>>> This base 3 operator a^b just adds corresponding digit pairs of a and
>>> b mod 3 to get the digits of the result.
>>>
>>> So the algorithm is to convert each input number to base 3 and tally
>>> up the total with the base 3 ^ operator.  The result will be the
>>> answer in base 3.
>>>
>>> The example above in base 3 is
>>> 2,1,11,12,1,11,2,2,11,1
>>>
>>> Running total with ^:
>>>
>>> 0 ^ 2 = 2
>>> 2 ^ 1 = 0
>>> 0 ^ 11 = 11
>>> 11 ^ 12 = 20
>>> 20 ^ 1 = 21
>>> 21 ^ 11 = 2
>>> 2 ^ 2 = 1
>>> 1 ^ 2 = 0
>>> 0 ^ 11 = 11
>>> 11 ^ 1 = 12
>>>
>>> And 12 is 5 base 3.
>>>
>>> The total will never have more digits than the biggest number.  This
>>> is O(1) space.  You have to assume base 3 conversion is a constant
>>> time operation, but this is pretty reasonable.
>>>
>>> If the problem changes to "all the numbers are repeated K times except
>>> for one, which appears only once, you can do the same thing with base
>>> K to get the answer.
>>>
>>> On Sep 11, 2:10 pm, Neha Singh  wrote:
>>> > You are given an array that contains integers. The integers content is
>>> such
>>> > that every integer occurs 3 times in that array leaving one integer
>>> that
>>> > appears only once.
>>> > Fastest way to find that single integer
>>> > eg:
>>> > Input: [2,1,4,5,1,4,2,2,4,1]
>>> > Answer: 5
>>> >
>>> > The solution must be of O(n) time and O(1) space
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] pgm2

2011-09-12 Thread sukran dhawan
find the length of string
count the occurenece of each character
if the length is odd den all characters shud be repeated even number of
times except one character which  shud be repeated odd no o f times

if its even then all characters shud be repeated even number of times

On Tue, Sep 13, 2011 at 12:27 AM, ankita aggarwal <
ankita.aggarwal@gmail.com> wrote:

> count the frequency of each letter.Only one odd or all even
> frequencies will form palindromes.
>
> On 9/13/11, parag khanna  wrote:
> > .write a program to find out if a word is a possible palindrome or
> > not...eg:tsetes becomes a palindrome aftr rearranging the letters so it
> is a
> > valid palindrome
> >
> >
> >
> >
> > --
> > Parag Khanna
> > B.tech Final Year
> > NIT,Kurukshetra
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
> >
>
>
> --
> Ankita Aggarwal
> UG Student
> PEC University of Technology,
> Chandigarh.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Book for C++

2011-09-12 Thread sukran dhawan
Bjarne stroustroup

On Mon, Sep 12, 2011 at 1:43 PM, Ankuj Gupta  wrote:

> Hi
>
> Which is a good book for C++ ( Robert Lafore or Bjarne Stroustrup or
> Herbert Schildt) ?
>
> Ankuj
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Data Structures

2011-09-11 Thread sukran dhawan
i think u missed a typedef b4... correct me if im wrong

On Mon, Sep 12, 2011 at 11:10 AM, teja bala wrote:

> @sukran
>
> dis was asked in microsoft written ?
>
> take node *c 'll create a new node like that
>
> On Mon, Sep 12, 2011 at 11:00 AM, sukran dhawan wrote:
>
>> pl tell me wat ur doin here... here u ve defined a variable node of type
>> struct n.
>>
>> wat does the statement node *c ??? how can u create an instance of an
>> instance ?
>>
>> On Mon, Sep 12, 2011 at 10:52 AM, teja bala wrote:
>>
>>> struct n { int data; struct n* next}node;
>>> node *c,*t;
>>> c->data = 10;
>>> t->next = null;
>>> *c = *t;
>>> what is the effect of the last statement?
>>>
>>> Is dis correct?
>>> My Ans:- c 'll point to node t which contains garbage value in data
>>> fieldc and link field a null
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] C Puzzle

2011-09-11 Thread sukran dhawan
run time error
first int * a is not assigned some address... so it will be pointing to some
garbage value
second two pointers of different types without  a typecast will result in
unpredictable results

On Mon, Sep 12, 2011 at 10:25 AM, teja bala wrote:

> #include
> main()
> {
> int *a;
> char *c;
> *a = 20;
> *c = *a;
> printf("%d %c",*a,*c);
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] need help

2011-09-11 Thread sukran dhawan
+1 to tech coder

On Mon, Sep 12, 2011 at 10:50 AM, tech coder wrote:

> if somebody has the preparation material  and videos provided by
> Careercup.com. Then please send me.
> thanks.
>
> --
> tech codYou received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Data Structures

2011-09-11 Thread sukran dhawan
pl tell me wat ur doin here... here u ve defined a variable node of type
struct n.

wat does the statement node *c ??? how can u create an instance of an
instance ?

On Mon, Sep 12, 2011 at 10:52 AM, teja bala wrote:

> struct n { int data; struct n* next}node;
> node *c,*t;
> c->data = 10;
> t->next = null;
> *c = *t;
> what is the effect of the last statement?
>
> Is dis correct?
> My Ans:- c 'll point to node t which contains garbage value in data
> fieldc and link field a null
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] requesting your suggestion

2011-09-11 Thread sukran dhawan
wat is the package ?

On Sun, Sep 11, 2011 at 9:43 PM, *$*  wrote:

> But the hikes of l&t wont be much when compared to that of Infy
>
>
> On Sun, Sep 11, 2011 at 9:20 PM, Jasveen Singh 
> wrote:
>
>> @sukran dhawan
>> thanks sukran but can u tell me about reputation of L & T infotech as i
>> know L& T is huge but not infotech partas in infosys they place in
>> abundance and if performance not good in training they will throw u in some
>> job like testing and u r stuck there for everthey just need labourers
>> and then again infosys is a big brand name!!!
>>
>>
>> On Sun, Sep 11, 2011 at 9:07 PM, sukran dhawan wrote:
>>
>>> infosys i feel... infosys training is awesome
>>>
>>> On Sun, Sep 11, 2011 at 8:34 PM, Jasveen Singh <
>>> jasveen.sing...@gmail.com> wrote:
>>>
>>>>
>>>> guys i have been selected in two companies during campus recruitment
>>>>
>>>> 1) INFOSYS
>>>> 2) L& T INFOTECH
>>>>
>>>> can you plz give me some idea that which one is better to go for??
>>>> and which is better for my career as a software developer
>>>> plz give me some idea?
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Thx,
> --Gopi
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Programs

2011-09-11 Thread sukran dhawan
#include
#include
#include
using namespace std;
int main()
{
char answer;
bitset<26> charset;
bitset<26> repeat;
char a[]={'s','a','s','a','b','v','s','a'};
#ifdef TEST
gets(a);
#endif
int i;
for(i=0;a[i]!='\0';i++){
if(charset.test(a[i]-'a')) {
repeat.set(a[i]-'a');
}

charset.set(a[i]-'a');
}

for(int j=0;jwrote:

> @neha:can u pls explain ur method?
>
>
> On Sun, Sep 11, 2011 at 9:09 PM, sukran dhawan wrote:
>
>> ya +1 to neha use bitset concept in c++
>>
>>
>> On Sun, Sep 11, 2011 at 8:24 PM, Neha Singh 
>> wrote:
>>
>>> for ques 1 use bit manipulation
>>> its more efficient
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Programs

2011-09-11 Thread sukran dhawan
ya +1 to neha use bitset concept in c++

On Sun, Sep 11, 2011 at 8:24 PM, Neha Singh wrote:

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

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



Re: [algogeeks] requesting your suggestion

2011-09-11 Thread sukran dhawan
infosys i feel... infosys training is awesome

On Sun, Sep 11, 2011 at 8:34 PM, Jasveen Singh wrote:

>
> guys i have been selected in two companies during campus recruitment
>
> 1) INFOSYS
> 2) L& T INFOTECH
>
> can you plz give me some idea that which one is better to go for??
> and which is better for my career as a software developer
> plz give me some idea?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Programs

2011-09-11 Thread sukran dhawan
int a[256] = {0};

int i;
for(i=0;str[i];i++)
a[str[i]]++;

for(i=0;str[i];i++)
{
if(a[str[i]] == 1)
{
printf("%c",str[i]);
break;
}
}

hope i am clear

On Sun, Sep 11, 2011 at 5:56 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> How will it work>?
>
>
> On Sun, Sep 11, 2011 at 5:53 PM, sukran dhawan wrote:
>
>> 1.use character count to record frequencey of occurences // initialise
>> array to 0
>> 2. for(i=0;str[i];i++)
>> {
>>if(count[str[i]] == 0) // first repeated character break;
>> }
>>
>>  On Sun, Sep 11, 2011 at 5:43 PM, Ishan Aggarwal <
>> ishan.aggarwal.1...@gmail.com> wrote:
>>
>>>  {Please solve the following questions :-
>>>
>>> 1.) Find first non repeated character.
>>>
>>> eg. total --> o
>>> teeter --> r
>>>
>>> 2.) Remove specified letters from a string.
>>>
>>> input --> "Battle of the vowels: Hawaii vs. Gronzy" , "aeiou"
>>>
>>> output --> "Bttle f th vwls: Hw vs. Grnzy"
>>>
>>> What is the problem in this solution ... Its giving compilation error.
>>>
>>>
>>> #include#include
>>>  void main(){int temp1[256];int i=0;char str[40] = "Battle of the vowels: 
>>> Hawaii vs. Gronzy";char temp[6] = "aeiou";
>>>  for(i=0;i<256;i++)
>>> temp1[i] = 0;
>>>
>>> i=0;while(temp[i]){
>>> temp1[temp[i]] = 1;
>>> i++;}
>>> i=0;while(str[i]){if(temp1[str[i]] == 1){
>>> str[i] = str[i+1];
>>> i--;}
>>> i++;}printf 
>>> <http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("%s", 
>>> str);}
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> ishan2.aggar...@aricent.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.
>>
>
>
>
> --
> Kind Regards
> Ishan Aggarwal
> [image: Aricent Group]
> Presidency Tower-A, M.G.Road,Sector-14
> Gurgaon,Haryana.122015 INDIA
> Phone : +91-9654602663
> ishan2.aggar...@aricent.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] Programs

2011-09-11 Thread sukran dhawan
1.use character count to record frequencey of occurences // initialise array
to 0
2. for(i=0;str[i];i++)
{
   if(count[str[i]] == 0) // first repeated character break;
}

On Sun, Sep 11, 2011 at 5:43 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> {Please solve the following questions :-
>
> 1.) Find first non repeated character.
>
> eg. total --> o
> teeter --> r
>
> 2.) Remove specified letters from a string.
>
> input --> "Battle of the vowels: Hawaii vs. Gronzy" , "aeiou"
>
> output --> "Bttle f th vwls: Hw vs. Grnzy"
>
> What is the problem in this solution ... Its giving compilation error.
>
>
> #include#include
>  void main(){int temp1[256];int i=0;char str[40] = "Battle of the vowels: 
> Hawaii vs. Gronzy";char temp[6] = "aeiou";
>  for(i=0;i<256;i++)
> temp1[i] = 0;
>
> i=0;while(temp[i]){
> temp1[temp[i]] = 1;
> i++;}
> i=0;while(str[i]){if(temp1[str[i]] == 1){
> str[i] = str[i+1];
> i--;}
> i++;}printf 
> ("%s", 
> str);}
>
>
>
>
>
>
> --
> Kind Regards
> Ishan Aggarwal
> [image: Aricent Group]
> Presidency Tower-A, M.G.Road,Sector-14
> Gurgaon,Haryana.122015 INDIA
> Phone : +91-9654602663
> ishan2.aggar...@aricent.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: Number of nodes at each level in binary tree

2011-09-11 Thread sukran dhawan
bfs

On Sun, Sep 11, 2011 at 1:51 PM, vijay goswami wrote:

> countNodeAtEachLevel(node * T, int a[],int level)
> {
>   if(T!=NULL){
>  a[level]+=1;
>  countNodeAtEachLevel(T->left,a,level+1);
>  countNodeAtEachLeve(T->right,a,level+1);
>   }
> }
>
> The function is called with initial values
>   countNodeAtEachLevel(Root,a,0);
>
>
> the array a[] gives the number of nodes at each level
> a[i] denotes number of nodes at level i, where i ranges between log(n) and
> n
>
>
>
>
> On Sun, Aug 21, 2011 at 9:47 AM, Amol Sharma wrote:
>
>> yesbfs will do !!
>> --
>>
>>
>> Amol Sharma
>> Third Year Student
>> Computer Science and Engineering
>> MNNIT Allahabad
>>   
>> 
>>
>>
>>
>>
>>
>> On Sun, Aug 21, 2011 at 9:37 AM, Naman Mahor wrote:
>>
>>> ght modification. so in bfs we use queue we have to add a dummy node in
>>> queue. So this node will tell us that end of level has come.so we can find
>>> out the no of node at any lev
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] alternative of stack

2011-09-10 Thread sukran dhawan
linked list

On Sun, Sep 11, 2011 at 11:22 AM, Neha Singh wrote:

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

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



Re: [algogeeks] Write a program to Convert an ASCII representation of a positive integer to it's numeric value ??

2011-09-10 Thread sukran dhawan
u can use atoi function

On Sat, Sep 10, 2011 at 10:26 PM, shady  wrote:

> #include 
> #include
>
> main(){
> char *s = "88934\0";
> int sum=0;
> int i=0;
> while(i int value = s[i]-'0';
> sum = 10*sum+value;
> i++;
> }
> printf("%s %d\n", s, sum);
>
> }
>
>
> On Sat, Sep 10, 2011 at 10:20 PM, Ishan Aggarwal <
> ishan.aggarwal.1...@gmail.com> wrote:
>
>> Not able to find some good solution for this...
>>
>>
>> On Sat, Sep 10, 2011 at 10:17 PM, shady  wrote:
>>
>>> string manipulation... google it.
>>>
>>> On Sat, Sep 10, 2011 at 10:06 PM, Ishan Aggarwal <
>>> ishan.aggarwal.1...@gmail.com> wrote:
>>>


 --
 Kind Regards
 Ishan Aggarwal
 [image: Aricent Group]
 Presidency Tower-A, M.G.Road,Sector-14
 Gurgaon,Haryana.122015 INDIA
 Phone : +91-9654602663
 ishan2.aggar...@aricent.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.
>>>
>>
>>
>>
>> --
>> Kind Regards
>> Ishan Aggarwal
>> [image: Aricent Group]
>> Presidency Tower-A, M.G.Road,Sector-14
>> Gurgaon,Haryana.122015 INDIA
>> Phone : +91-9654602663
>> ishan2.aggar...@aricent.com 
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Write a function to find the least common multiple of integers in an array

2011-09-10 Thread sukran dhawan
after finding gcd of first two elements use gcd as first no and next array
element as second no annd call gcd function
repeat the proc till array exhausts

On Sat, Sep 10, 2011 at 9:39 PM, Neha Singh wrote:

> @sukran : we hv to find gcd of all the elements of the array, not of 2
> elements.
> Give detailed algo
>
> -- peat
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] how to find if sum of some of the elements of an array equals to k

2011-09-10 Thread sukran dhawan
sorting and then adding individual elements and then comparing with k

On Sat, Sep 10, 2011 at 9:59 PM, sukran dhawan wrote:

> sorting will help i guess
>
>
> On Sat, Sep 10, 2011 at 9:51 PM, avi0889  wrote:
>
>> how to find if sum of some of the elements of an array equals to k
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/Lb3JgT4eWDAJ.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

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



Re: [algogeeks] how to find if sum of some of the elements of an array equals to k

2011-09-10 Thread sukran dhawan
sorting will help i guess

On Sat, Sep 10, 2011 at 9:51 PM, avi0889  wrote:

> how to find if sum of some of the elements of an array equals to k
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/Lb3JgT4eWDAJ.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Code it

2011-09-10 Thread sukran dhawan
best way it to invoke the function recursively

just like a k-1 ary tree
correct me if im wrong

On Sat, Sep 10, 2011 at 2:49 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> What would be the efficient way to code this program.??
>
> Given an array of size n, find all the possible sub set of the array of
> size k(all the subsets must be of size k).
>
>
> --
> Kind Regards
> Ishan Aggarwal
> Phone : +91-9654602663
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] tree traversal

2011-09-10 Thread sukran dhawan
level order traversal

On Sat, Sep 10, 2011 at 10:48 AM, ravi maggon  wrote:

> give some traversal other then pre,in and post order to print all elements
> of tree?
> Asked in informatica interview.
>
> --
>
> Regards
> Ravi Maggon
> Final Year, B.E. CSE
> Thapar University
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: Write a program

2011-09-10 Thread sukran dhawan
yes for integer arrays we need to sort o(nlogn) and den compare in o(n)

On Sat, Sep 10, 2011 at 7:12 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> Hi,
>
> Actually I am not good at hash tables. can u plzz suggest me some gud link
> from where I can study hash tables...
> and also tell me the logic for integer arrays for which the complexity will
> be o(n logn).
>
> Thanks in advance.
>
>
> --
> Kind Regards
> Ishan Aggarwal
> Phone : +91-9654602663
>
>
> On Sat, Sep 10, 2011 at 7:03 PM, Brijesh wrote:
>
>> If you are talking about character array then it can be done in space
>> O(128)=constant and time O(n),,. as Use Hash table of all 128 characters ,
>> and then traverse through your array and mark a flag in the hash table..when
>> you encounter any duplicate character , which would be marked already in the
>> hash table , dont print it..!
>>
>> And if its integer array... best would be sort it in O(n logn) and
>> traverse through the loop and print those  numbers which are not same as
>> previous number..
>>
>> On Saturday, 10 September 2011 14:51:18 UTC+5:30, Ishan Aggarwal wrote:
>>
>>> Write a program to remove duplicate elements from an array by printing
>>> them only once?
>>>
>>> What will be the minimum time and space complexity required for this
>>> program?
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> ishan2@aricent.com
>>>
>>>   --
>> 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/-/TqJhP_DAD2AJ.
>>
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] logical and physical address

2011-09-10 Thread sukran dhawan
page size (logical address space) = 512 = 2 power 9
so 9 bits

base address = 10 bits

so combining them 10+ 9 = 19 bits

On Sat, Sep 10, 2011 at 7:18 PM, rohit kumar  wrote:

> please explain ...
>
>
> On Sat, Sep 10, 2011 at 5:10 PM, bharatkumar bagana <
> bagana.bharatku...@gmail.com> wrote:
>
>> physical address:19 bits(10+9)
>> logical address : 15 bits(6+9)
>>
>>
>> On Sat, Sep 10, 2011 at 6:48 AM, ravi maggon wrote:
>>
>>> we have page table having 64 entries of 10 bits each. and page size is of
>>> 512 bytes.
>>> tell the no of bits required for physical and logical address.
>>>
>>> --
>>>
>>> Regards
>>> Ravi Maggon
>>> Final Year, B.E. CSE
>>> Thapar University
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>>
>> **Please do not print this e-mail until urgent requirement. Go Green!!
>> Save Papers <=> Save Trees
>> *BharatKumar Bagana*
>> **http://www.google.com/profiles/bagana.bharatkumar
>> *
>> Mobile +91 8056127652*
>> 
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Find th gcd of 2 nos in the most efficient way

2011-09-10 Thread sukran dhawan
while(num2 != 0)
{
rem = num1 % num2

num1 = num2
num2 = rem
}


On Sat, Sep 10, 2011 at 8:59 PM, Gaurav Menghani
wrote:

> C'mon
>
> http://en.wikipedia.org/wiki/Greatest_common_divisor
>
> On Sat, Sep 10, 2011 at 11:24 AM, Neha Singh 
> wrote:
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
>
>
>
> --
> Gaurav Menghani
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Re: How can we find second largest element in an array... in O(n+logn-2)... give me proof.....

2011-09-10 Thread sukran dhawan
where n is the size of array

On Sat, Sep 10, 2011 at 9:16 PM, sukran dhawan wrote:

>
>
> large1 = a[0];
> large2 = a[1];
>
>
> if(large1 < large2)
> swap(large1,large2)
>
> while(i < n)
> {
> if(a[i] > large1)
>{
>   large2 = large1
> large1 = a[i]
> }
> else if(a[i] > large2)
> large2 = a[i]
> }
>
> // test the case if no of elements is 1 :)
>
>
> On Sat, Sep 10, 2011 at 8:54 PM, Dave  wrote:
>
>> @Abhinav: Does it work correctly on {1, 3, 2}, or, for that matter, on
>> any array where the second largest comes after the largest?
>>
>> Dave
>>
>> On Sep 10, 10:16 am, abhinav gupta  wrote:
>> > temp2 is second largest element.
>> >
>> > On Sat, Sep 10, 2011 at 8:00 AM, abhinav gupta <
>> guptaabhinav...@gmail.com>wrote:
>> >
>> >
>> >
>> >
>> >
>> > > I can solve this problem in O(n)
>> > > i=0;
>> > > temp1=arr[0];
>> >
>> > > while(i != len)
>> > > {
>> > > if(arr[i] > temp1)
>> > > {
>> > > temp2=temp1;
>> > > temp1=arr[i]
>> > > }
>> > > i++;
>> > > }
>> >
>> > > On Sat, Sep 10, 2011 at 7:42 AM, Dave 
>> wrote:
>> >
>> > >> @Replying to my own posting: remove the words "one of the numbers
>> that
>> > >> lost to", so that the explanation reads
>> >
>> > >> The question should be "How can we find the second largest element in
>> > >> an array in n + ceiling(log_2(n)) - 2 comparisons?" The answer is to
>> > >> use a tournament to select the largest number. The second largest
>> > >> number will have lost to the largest. It takes n - 1 comparisons to
>> > >> determine the largest number. There are ceiling(log_2(n)) numbers
>> that
>> > >> have lost to the largest, and it takes ceiling(log_2(n)) - 1
>> > >> comparisons to find the largest of them.
>> >
>> > >> Dave
>> >
>> > >> On Sep 10, 9:28 am, Dave  wrote:
>> > >> > @Praveen: The question should be "How can we find the second
>> largest
>> > >> > element in an array in n + ceiling(log_2(n)) - 2 comparisons?" The
>> > >> > answer is to use a tournament to select the largest number. The
>> second
>> > >> > largest number will have lost to one of the numbers that lost to
>> the
>> > >> > largest. It takes n - 1 comparisons to determine the largest
>> number.
>> > >> > There are ceiling(log_2(n)) numbers that have lost to the maximum,
>> and
>> > >> > it takes ceiling(log_2(n)) - 1 comparisons to find the largest of
>> > >> > them.
>> >
>> > >> > Dave
>> >
>> > >> > On Sep 10, 9:18 am, praveen raj  wrote:
>> >
>> > >> > > How can we find second largest element in an array... in O(n
>> > >> > > +logn-2)... give me proof.- 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.
>> >
>> > > --
>> > > @ |3  # ! /\/ @ \./
>> >
>> > --
>> > @ |3  # ! /\/ @ \./- Hide quoted text -
>> >
>> > - Show quoted text -
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>

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



Re: [algogeeks] Write a function to find the least common multiple of integers in an array

2011-09-10 Thread sukran dhawan
find GCD by eucledian method

LCM = (a * b )/GCD;

On Sat, Sep 10, 2011 at 9:13 PM, Gaurav Menghani
wrote:

> http://tinyurl.com/3hm3gug
>
> On Sat, Sep 10, 2011 at 10:46 AM, Neha Singh 
> wrote:
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
>
>
>
> --
> Gaurav Menghani
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Re: How can we find second largest element in an array... in O(n+logn-2)... give me proof.....

2011-09-10 Thread sukran dhawan
large1 = a[0];
large2 = a[1];


if(large1 < large2)
swap(large1,large2)

while(i < n)
{
if(a[i] > large1)
   {
  large2 = large1
large1 = a[i]
}
else if(a[i] > large2)
large2 = a[i]
}

// test the case if no of elements is 1 :)

On Sat, Sep 10, 2011 at 8:54 PM, Dave  wrote:

> @Abhinav: Does it work correctly on {1, 3, 2}, or, for that matter, on
> any array where the second largest comes after the largest?
>
> Dave
>
> On Sep 10, 10:16 am, abhinav gupta  wrote:
> > temp2 is second largest element.
> >
> > On Sat, Sep 10, 2011 at 8:00 AM, abhinav gupta <
> guptaabhinav...@gmail.com>wrote:
> >
> >
> >
> >
> >
> > > I can solve this problem in O(n)
> > > i=0;
> > > temp1=arr[0];
> >
> > > while(i != len)
> > > {
> > > if(arr[i] > temp1)
> > > {
> > > temp2=temp1;
> > > temp1=arr[i]
> > > }
> > > i++;
> > > }
> >
> > > On Sat, Sep 10, 2011 at 7:42 AM, Dave  wrote:
> >
> > >> @Replying to my own posting: remove the words "one of the numbers that
> > >> lost to", so that the explanation reads
> >
> > >> The question should be "How can we find the second largest element in
> > >> an array in n + ceiling(log_2(n)) - 2 comparisons?" The answer is to
> > >> use a tournament to select the largest number. The second largest
> > >> number will have lost to the largest. It takes n - 1 comparisons to
> > >> determine the largest number. There are ceiling(log_2(n)) numbers that
> > >> have lost to the largest, and it takes ceiling(log_2(n)) - 1
> > >> comparisons to find the largest of them.
> >
> > >> Dave
> >
> > >> On Sep 10, 9:28 am, Dave  wrote:
> > >> > @Praveen: The question should be "How can we find the second largest
> > >> > element in an array in n + ceiling(log_2(n)) - 2 comparisons?" The
> > >> > answer is to use a tournament to select the largest number. The
> second
> > >> > largest number will have lost to one of the numbers that lost to the
> > >> > largest. It takes n - 1 comparisons to determine the largest number.
> > >> > There are ceiling(log_2(n)) numbers that have lost to the maximum,
> and
> > >> > it takes ceiling(log_2(n)) - 1 comparisons to find the largest of
> > >> > them.
> >
> > >> > Dave
> >
> > >> > On Sep 10, 9:18 am, praveen raj  wrote:
> >
> > >> > > How can we find second largest element in an array... in O(n
> > >> > > +logn-2)... give me proof.- 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.
> >
> > > --
> > > @ |3  # ! /\/ @ \./
> >
> > --
> > @ |3  # ! /\/ @ \./- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



[algogeeks] backtracking

2011-09-08 Thread sukran dhawan
guys which is the best site or book to practise backtracking and branch and
bound programs ?

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



Re: [algogeeks] answer these interesting questions

2011-09-08 Thread sukran dhawan
1 a
2 c
3 b

On Wed, Sep 7, 2011 at 11:08 PM, Mani Bharathi wrote:

> “Kya-Kya” is an island inhabitants of which always answer any question with
> two
> answers , one of which is true and the other is false .
>
> 1.You are walking on a road and came to a park . You ask the inhabitants
> Ram , Laxman and Lila , “which road will
> take me to the village ?”Ram says “I never speak to strangers . I am new to
> these parts .”Laxman says,”I am married
> to Lila . Take the left road .”Lila says “I am married to Ram . He is not
> new in these place .”Which of the following is
> true ?(a)Left road takes you to the village(b)Right road takes you to the
> village(c)Lila is married to Laxman.(d)none.
>
> 2.You find that your boat is stolen . You question three inhabitants of the
> island and reply as follows . John saya “I
> didn’t do it . Mathew did not do it .”Mathew says “I did not do it .
> Krishna did not do it .”Krishna says “I did not do
> it . I do not know who did it .” Who stole your boat ?
> (a)John(b)Mathew(c)Krishna(d)All three (e)none.
>
> 3.You want to speak to the chief of the village . You question three
> inhabitants Amar , Bobby and Charles . Only
> Bobby is wearing a red shirt . Amar says “I am not Bobby’s son .The chief
> wears a red shirt.”Bobby says “I am
> Amar’s father . Charles is the chief.”Charles says “The chief is one among
> us . I am the chief .”Who is the chief?
> (a)Amar(b)Bobby(c)Charles(d)None.
>
> 4.There is only one pilot in the island.You interview three men:Koik,lony
> and Mirna.You also notice that Koik is
> wearing a cap.Mirna says “Lony’s father is the pilot.Lony is not the
> priest’s son.”Koik says “I am the pilot.On this
> island only priests can wear cap.”Lony says “I am the priest’s son.Koik is
> not the priest .”Which of the following is
> true?(a)Lony is not Koik’s son(b)Koik is the pilot(c)Mirna is the
> pilot(d)Lony is the priest.
> --
> 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/-/QsepdSoM9esJ.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] What is the Output?? and How??

2011-09-07 Thread sukran dhawan
its already been explained in previous thread
On Wed, Sep 7, 2011 at 11:01 PM, NAGARAJAN SIVARAMAN wrote:

> #include
> #include
> #define prn(a) printf("%d ",a)
> #define print(a,b,c) prn(a),prn(b),prn(c)
> #define max(a,b) (a void main()
> {
>
>int x=1,y=2;
>clrscr();
>print(max(x++,y),x,y);
> printf("\n%d %d\n",x,y);
>print(max(x++,y),x,y);
>printf("\n%d %d\n",x,y);
>
>getch();
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] MS written test

2011-09-07 Thread sukran dhawan
which is the best site where in can find backtracking and branch and bound
programs ?

On Wed, Sep 7, 2011 at 8:58 PM, gmagog...@gmail.com wrote:

> 0xa == 0x 1010, which stands for all the even bits
> 0x5 == 0x 0101, which stands for all the odd bits
>
> >>1 and <<1 means shifting odd to even and even to odd
>
> then | means putting new even bits and odd bits together
>
> Yanan Cao
>
>
>
> On Wed, Sep 7, 2011 at 10:23 AM, teja bala wrote:
>
>>
>> Can anyone plzz xplain the code?
>>
>> public static int swapOddEvenBits(int x) {
>>  return ( ((x & 0x) >> 1) | ((x & 0x) << 1) );
>>  }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] plz xplain the o/p

2011-09-07 Thread sukran dhawan
you are just changing the pointers . so second ptr will point to third
string and third will point to second string

On Wed, Sep 7, 2011 at 11:34 AM, Shachindra A C wrote:

> I assume you expect to see the strings interchanged. But you are not
> changing anything in the memory. So in main(), pstr[0] and pstr[1] contains
> whatever was there earlier. If you change the parameters of the swap to
> swap(char **,char **), pass the addresses of pstr[0] ,pstr[1] and then do
> whatever u r doing in swap, the strings will get exchanged.
>
> On Wed, Sep 7, 2011 at 11:26 AM, piyush agarwal wrote:
>
>> #includevoid swap(char *, char *);
>> int main()
>> {
>> char *pstr[2] = {"Hello", "piyush"};
>> swap(pstr[0], pstr[1]);
>> printf("%s\n%s", pstr[0], pstr[1]);
>> return 0;
>> }void swap(char *t1, char *t2)
>> {
>> char *t;
>> t=t1;
>> t1=t2;
>> t2=t;
>> }
>>
>>
>>
>> --
>> Piyush Agarwal
>> Final Year Undergraduate
>> Department of Computer Engineering
>> Malaviya National Institute of Technology
>> Jaipur
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Shachindra A C
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks]

2011-09-07 Thread sukran dhawan
sieve of erathothenes algo

On Wed, Sep 7, 2011 at 1:36 PM, Yogesh Yadav  wrote:

> prime no has only 2 factors. number itself and 1.
>
>
>
>
> On Wed, Sep 7, 2011 at 12:14 PM, aayush jain  wrote:
>
>> can anybody tell me the code of find the prime no. and after finding prime
>> no. find its prime factore using linkes list?? --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks]

2011-09-07 Thread sukran dhawan
hey its compiler dependent ... no meaning in discussing such questions as
standard c considers it as a undefined behaviour

On Wed, Sep 7, 2011 at 1:08 PM, annarao kataru wrote:

> hai in gcc compiler of fedora 14
>
> int main()
> {
> int a=4;
> printf("%d  %d  %d  %d",++a,++a,++a,++a);
> return 0;
> }
> o/p  7 7 7 7
>
> but if i replace ++a  with  a++ in above expn  i am getting o/p as  7 6 5 4
>
> why ??  can u  explain ?
>
> thanks  in advance...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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

2011-09-07 Thread sukran dhawan
null is a macro defined in stdio.h which is equal to 0 . so  sizeof(0) is 4
:)

On Wed, Sep 7, 2011 at 2:44 AM, UTKARSH SRIVASTAV
wrote:

> and why sizeof(NULL) is giving 4 any ans?
>
>
>
>
>
>> --
>> *UTKARSH SRIVASTAV
>> CSE-3
>> B-Tech 3rd Year
>> @MNNIT ALLAHABAD*
>>
>>
>>
>
>
>
> --
> *UTKARSH SRIVASTAV
> CSE-3
> B-Tech 3rd Year
> @MNNIT ALLAHABAD*
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Re: Please provide Code to Find kth Smallest or kth Largest element in unsorted array in liner time ?

2011-09-06 Thread sukran dhawan
+1 to piyush

On Tue, Sep 6, 2011 at 11:15 PM, Piyush Grover wrote:

> this can be done using heap tree data structure.
>
> -create a max heap tree of first k elements (for finding kth min)
>  -keep on adding elements in the heap
> if the root element is greater than the current element, remove root
> element and insert the current element in the tree
> once done with n elements
> the root element will give the kth min element.
> Time complexity: O(nlogk)
> Tho piyushis method is very much effective for k << n (when k is a
> constant)
>
> Same can be done for kth max.
>
>
> On Tue, Sep 6, 2011 at 9:00 PM, Shravan Kumar  wrote:
>
>>
>> http://jonah.cs.elon.edu/sduvall2/courses/csc331/2006spring/Lectures/Order_statistics.ppt
>>
>>
>> On Tue, Sep 6, 2011 at 7:53 PM, yamini gupta 
>> wrote:
>>
>>> partition the array using quick sort
>>> and find the kth smallest or largest number
>>>
>>>
>>> On Sep 6, 12:20 am, learner  wrote:
>>> > @Dave,All So Can Anyone Provide The Working Code in Linear Time for
>>> > the same ?
>>> >
>>> > Thanks
>>> >
>>> > On Sep 5, 6:41 pm, Dave  wrote:
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > > @Sachin: Correct: in one quicksort pivoting pass, the array is
>>> > > rearranged so that the pivot element is put in the correct spot, with
>>> > > larger elements on the right and smaller ones on the left. Now, if
>>> the
>>> > > pivot, a[p], is at location k, i.e. p = k, then you are done. If not,
>>> > > do another quicksort on the correct side of p; i.e., either on a[0]
>>> to
>>> > > a[p-1] or on a[p+1] to a[n-1], depending on whether k is less than p
>>> > > or greater than p.
>>> >
>>> > > Dave
>>> >
>>> > > On Sep 5, 1:27 am, sachin goyal  wrote:
>>> >
>>> > > > PLEASE TELL ME HOW WE CAN USE QUICK SORT TO FIND THE ELEMENT
>>> > > > BECAUSE IN QUICK SORT ONE ELEMENT IN SHIFT IN ITS RIGHT POSITION
>>> ALL LEFTS
>>> > > > ARE SMALLER AND ALL RIGHT ARE BIG
>>> >
>>> > > > On Mon, Sep 5, 2011 at  POSIT11:55 AM, sachin goyal
>>> > > > wrote:
>>> >
>>> > > > > PLEASE TELL HOW
>>> >
>>> > > > > On Sun, Sep 4, 2011 at 7:23 PM, sarath prasath <
>>> prasathsar...@gmail.com>wrote:
>>> >
>>> > > > >> another sol which i learned from my friend is
>>> > > > >> think of heap sort...
>>> >
>>> > > > >> On Sun, Sep 4, 2011 at 6:28 PM, learner <
>>> nimish7andr...@gmail.com> wrote:
>>> >
>>> > > > >>> something I Know using quick sort randomization function we can
>>> find
>>> > > > >>> kt smallest/largest in unsorted array , but i am not able to
>>> write
>>> > > > >>> code , please help me in this and provide the code for the
>>> same.?
>>> >
>>> > > > >>> Thanks
>>> > > > >>> Nimish K.
>>> > > > >>> 1st Year
>>> > > > >>> IITR
>>> >
>>> > > > >>> --
>>> > > > >>> You received this message because you are subscribed to the
>>> Google Groups
>>> > > > >>> "Algorithm Geeks" group.
>>> > > > >>> To post to this group, send email to
>>> algogeeks@googlegroups.com.
>>> > > > >>> To unsubscribe from this group, send email to
>>> > > > >>> algogeeks+unsubscr...@googlegroups.com.
>>> > > > >>> For more options, visit this group at
>>> > > > >>>http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>> > > > >>  --
>>> > > > >> You received this message because you are subscribed to the
>>> Google Groups
>>> > > > >> "Algorithm Geeks" group.
>>> > > > >> To post to this group, send email to algogeeks@googlegroups.com
>>> .
>>> > > > >> To unsubscribe from this group, send email to
>>> > > > >> algogeeks+unsubscr...@googlegroups.com.
>>> > > > >> For more options, visit this group at
>>> > > > >>http://groups.google.com/group/algogeeks?hl=en.-Hidequoted text
>>> -
>>> >
>>> > > > - Show quoted text -
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
alg

Re: [algogeeks]

2011-09-06 Thread sukran dhawan
function pointer

so answer is size of pointer can be 4 or 2 depending on word size

On Tue, Sep 6, 2011 at 11:21 PM, siddharam suresh
wrote:

> *main()* is an address/probably the function pointer,
> Thank you,
> Sid.
>
>
>
> On Tue, Sep 6, 2011 at 11:19 PM, Sanjay Rajpal  wrote:
>
>> #include 
>> #include
>> int main() {
>>
>> printf(" %d",sizeof(main()));
>> ... getche();
>> return 0;
>> }
>> o/p is 4..how ???
>>
>>
>> Sanju
>> :)
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] c output .. help plz

2011-09-06 Thread sukran dhawan
coz both floating point are stored in ieee format which is different from
integers

On Tue, Sep 6, 2011 at 10:18 PM, sukran dhawan wrote:

> it wil not truncate the floating point to integer remember...
>
>
> On Tue, Sep 6, 2011 at 9:55 PM, sivaviknesh s wrote:
>
>> printf("%d",3.14*6.25*6.25);
>>
>> ...ans : 0 ..how and why?? why not type conversion take place??
>>
>> --
>> Regards,
>> $iva
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

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



Re: [algogeeks] c output .. help plz

2011-09-06 Thread sukran dhawan
it wil not truncate the floating point to integer remember...

On Tue, Sep 6, 2011 at 9:55 PM, sivaviknesh s wrote:

> printf("%d",3.14*6.25*6.25);
>
> ...ans : 0 ..how and why?? why not type conversion take place??
>
> --
> Regards,
> $iva
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] C output????

2011-09-06 Thread sukran dhawan
addresses are compared here  i think

On Tue, Sep 6, 2011 at 9:04 PM, sivaviknesh s wrote:

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

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



Re: [algogeeks] DE shaw question- urgent

2011-09-06 Thread sukran dhawan
ya dont be upset if some one who is not as good as u get a job and u don get
it ... think positively ... think that the company don deserve u and start
working on ur weak areas

On Tue, Sep 6, 2011 at 2:34 PM, siddharam suresh wrote:

> my personal experience.
> guys don't regret while placements,
> it wont bring any work-ability in the preparation.
> always look for what was missing in the last interview, prepare well.
>
> I didnt prepare because of the initial failure in the placements(ended up
> where i did not planed). I wish that wont happen with anybody.
>
> Thank you,
> Sid.
>
>
>
> On Tue, Sep 6, 2011 at 2:19 PM, rahul vatsa  wrote:
>
>> :D
>> may be u lost this to gt something better :-)
>>
>>
>> On Tue, Sep 6, 2011 at 4:32 AM, ROHIT SINGHAL 
>> wrote:
>>
>>> due to this singleton class i lost 6.5 lpa opportunity :( in Hcentive
>>> noida
>>>
>>>
>>> On Tue, Sep 6, 2011 at 12:58 PM, rahul vatsa wrote:
>>>
 there is no restriction at all, you can create n no of objects. A member
 function can call a private constructor any number of times.

 Just 1 single object is created bcoz this is the property of singleton
 class.
 A singleton class is a class which ensures the class has only one
 instance & it provides a global point of access to it.  that it provides
 through a public static member function.
 This member function when invoked , first checks if the single instance
 has already been create, if yes it doesn't create a new 1, it gives you 
 back
 the already created one, so even if you call it multiple times, you get the
 same object. nd thatz basically the intent behind.

 If you want to have more than one objects, you can modify this member
 function & can do that.




 On Mon, Sep 5, 2011 at 12:45 PM, Neha Singh >>> > wrote:

> Guys hv a doubt, plz clarify ..
> You mentioned that if a class has a private constructor then the object
> of that class can be created using call to a static method which 
> internally
> calls the constructor and returns its reference. I can't understand why 
> only
> 1 object can be created as mentioned by you. As in, we can call the static
> method multiple times and create multiple objects..
>
> --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 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: convert a word into a palindrome with minimum addition of letters to it

2011-09-06 Thread sukran dhawan
my soln works without increasing the string length

just start with first and last character copy last character with first
increment i and decrement j and contibue the procedure
continue the same till u get mid element :)

On Tue, Sep 6, 2011 at 12:56 PM, Atul Modi  wrote:

> can u remove letters also?as in the example 1 'o' seems to have been
> removed?
>
>
> On Tue, Sep 6, 2011 at 12:25 PM, anshu mishra 
> wrote:
>
>> http://www.spoj.pl/problems/AIBOHP/
>>
>> same problem u have asked!!
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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