Re: [algogeeks] cisco

2011-08-12 Thread Naveen Kumar
@ aditya,

Cisco is not in losses they make better profit then expected by the market
this quarter  share rises by 16% after results.
Moreover cisco sacked only 2200 employees and some 2-3k took VRS.


On Fri, Aug 12, 2011 at 9:58 PM, Nanda Kishore
nanda.kishore...@gmail.comwrote:



 On Fri, Aug 12, 2011 at 8:16 PM, siddharth srivastava akssps...@gmail.com
  wrote:



 On 12 August 2011 19:20, aditya kumar aditya.kumar130...@gmail.comwrote:

 is CISCO cuming fr recruitment ?? they are in huge loss and they have
 sacked around 1 employees .


 well, this is what Goldman Sachs also did, but they are also doing
 recruitment.
  No company virtually ever stops recruitment. Sacking is done to fill
 space with less expensive resources (though clearly a bad indicator)


 well,cisco off campus for s/w engg had written test,followed by G.D and
 two interviews

 written test consists of 50 questions,sections coverin those questions
 were
  1.general aps,
 2.Networking
 ,3.sqa,
 4.c programmin


 On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan 
 sukrandha...@gmail.comwrote:

 can anybody tell abt the interview process in cisco ?

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


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




 --
 Regards
 Siddharth Srivastava



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


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks]

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

On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh
siddharam@gmail.com wrote:
 the evaluation of parameters in printf() done from right to left.

 Thank you,
 Siddharam


 On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal experience...@gmail.com
 wrote:

 can anybody explain how its printing
  4 5 5 4 5

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


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Problems on Linked List

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

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

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

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Problems on Linked List

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

On Thu, Aug 11, 2011 at 12:12 AM, sukran dhawan sukrandha...@gmail.com wrote:
 reverse the list inplace and compare the two list element by element

 On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.com wrote:

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


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

 On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar
 naveenkumarve...@gmail.com wrote:

 for first reverse one of the link list by changing the pointer and
 than traverse one from backward and compare it the the other.

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

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



 --
 Cheers
 Naveen Kumar

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




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

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

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks]

2011-08-10 Thread Naveen Kumar
at each node swap left  right pointers

On Thu, Aug 11, 2011 at 12:25 AM, sukran dhawan sukrandha...@gmail.com wrote:
 how to find the mirror image of a binary tree ?

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Re: MS

2011-07-23 Thread Naveen Kumar
how will be able to arrange the words back?

On Sat, Jul 23, 2011 at 4:50 PM, rajeev bharshetty rajeevr...@gmail.com wrote:
 How about using quicksort and then comparing adjacent elements (characters)
 and then finding the uniqueness and deleting repeated characters ?
 On Sat, Jul 23, 2011 at 4:38 PM, Akshata Sharma akshatasharm...@gmail.com
 wrote:

 @akash, the questions says no addition DS should be used. Its  asks for
 inplace algorithm.
 @chinna, can you explain how heapsort will do it?

 On Sat, Jul 23, 2011 at 3:17 PM, pacific :-) pacific4...@gmail.com
 wrote:

 heapsort ?

 On Sat, Jul 23, 2011 at 1:26 PM, Akshata Sharma
 akshatasharm...@gmail.com wrote:

 better than O(n^2)..

 On Sat, Jul 23, 2011 at 1:08 PM, Akshata Sharma
 akshatasharm...@gmail.com wrote:

 Given a string *Str of ASCII characters, write the pseudo code to
 remove the duplicate elements present in them. For example, if the given
 string is Potato, then, the output has to be Pota. Additional 
 constraint
 is, the algorithm has to be in-place( no extra data structures allowed) .
 Extend your algorithm to remove duplicates in the string which consisted 
 of
 UNICODE characters.


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

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

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



 --
 Regards
 Rajeev N B

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] puzzle-plz explain stepwise

2011-07-13 Thread Naveen Kumar
http://www.geekinterview.com/question_details/56715

I think you missed zero :)

On Thu, Jul 14, 2011 at 12:20 AM, shiv narayan
narayan.shiv...@gmail.com wrote:
 A car is traveling at a uniform speed.The driver sees a milestone
 showing a 2-digit number. After traveling for an hour the driver sees
 another milestone with the same digits in reverse order.After another
 hour the driver sees another milestone containing the same two digits.
 What is the average speed of the driver?

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





-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] questions related to C

2011-07-08 Thread Naveen Kumar
read KR

On Fri, Jul 8, 2011 at 4:20 PM, vikas mehta...@gmail.com wrote:
 Q1 - write a generic macro to swap two values (int,float,double,pointers as
 well )

 Q2 - Implement your own malloc() and  free() function

 Q3 - Two unsigned ints given a, b you have add these numbers and return
 the sum ...Make sure in case of overflow return error.


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Java Developer Needed in MD -- F2F required

2011-06-30 Thread Naveen Kumar
banned in 6 mins pretty cool... :)

On Thu, Jun 30, 2011 at 10:19 PM, shady sinv...@gmail.com wrote:
 banned

 On Thu, Jun 30, 2011 at 10:13 PM, Leon Parker leon.pan...@gmail.com wrote:

 Hello Associates,
 Wishes for the day!!

 Please go through the below requirement and let me know if you have any
 consultants for the below position?

 Job Title: Java Developer
 Location: Silver Spring, MD
 Duration: 7-12 Months

 Must have skills:
 Java 5; JEE technologies
 Expertise with Spring, iBatis and Velocity
 Oracle or other RDBMS
 Rational Application Developer
 WebSphere application server
 Web technologies:  HTML, HTML5, JavaScript, CSS, JQuery, cross-browser
 compatibility
 CVS or SVN source code control
 Continuous Integration development
 Experience working in an Agile or Scrum team

 Desired Skills:
 Endeca
 Linux
 Apache configuration
 Experience building and installing software, including open source
 Strong shell scripting skills
 Akamai or other CDN
 Content Management Systems (CMS)
 Autonomy TeamSite
 MySQL server administration
 Mobile applications (iOS/Android)

 Required Qualifications:
 Requires bachelor's degree (in Computer Science or related field).
 Eight years of related experience in J2EE development.

 Thanks
 Leon Parker - l...@panzersolutions.com
 203-983-9475

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

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] preprocessor query

2011-06-29 Thread Naveen Kumar
Its swapping correctly
Now x is pointing to b and y is pointing to a.

On Wed, Jun 29, 2011 at 3:45 PM, Anika Jain anika.jai...@gmail.com wrote:

 #define FUN(a,b,c)    c t; t=a;a=b;b=t;


 int main()
 {
     int a=2,b=3;
     int *x,*y;
     x=a,y=b;
     FUN(x,y,int *);
     printf(%d %d \n,a,b);
     return 0;
 }


 why doesnt this macro swap pointers wen it can work for variables??

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] preprocessor query

2011-06-29 Thread Naveen Kumar
You're printing a  b.
Value of a and b are not changed.

On Wed, Jun 29, 2011 at 3:51 PM, Naveen Kumar
naveenkumarve...@gmail.com wrote:
 Its swapping correctly
 Now x is pointing to b and y is pointing to a.

 On Wed, Jun 29, 2011 at 3:45 PM, Anika Jain anika.jai...@gmail.com wrote:

 #define FUN(a,b,c)    c t; t=a;a=b;b=t;


 int main()
 {
     int a=2,b=3;
     int *x,*y;
     x=a,y=b;
     FUN(x,y,int *);
     printf(%d %d \n,a,b);
     return 0;
 }


 why doesnt this macro swap pointers wen it can work for variables??

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




 --
 Cheers
 Naveen Kumar




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Re: c query

2011-06-29 Thread Naveen Kumar
Hi Rajeev,

Is there any documentation/link which shows this behavior?

On Wed, Jun 29, 2011 at 8:17 AM, varun pahwa varunpahwa2...@gmail.com wrote:
 Here is the attached image of code run in codeblocks. I think its compiler
 dependent that structure can be print like this
 printf(%f %d,2[*arr]); provided format specifiers in order of structure
 elements.


 On Tue, Jun 28, 2011 at 6:35 PM, sameer.mut...@gmail.com
 sameer.mut...@gmail.com wrote:

 its tryin to acess arr[3] which is not defined and nullhence it is
 giving null and priniting default value 0.000.arr[2[ is only the last
 defined array of structure.

 On Tue, Jun 28, 2011 at 12:07 PM, udit sharma sharmaudit...@gmail.com
 wrote:

 I think this is also a compiler dependent program..
 Bcz if u run d code

 #includestdio.h
 typedef struct
 {
   char *name;
    double salary;
 }job;

 main()
 {
     static job a={tcs,15000.0};
     static job a={ibm,25000.0};
     static job a={google,35000.0};
     int x=5;
     job *arr[3]={a,b,c};
  printf(%s %f\t,(3)[*arr]);
 }


 it'll give u : (null) 0.00
 This indicates tat d compiler is evaluating (3)[*arr] in  (3,x1)[*arr]

 And if d compiler gives: google 35000.00 as a result, means it is
 evaluating (3,x1)[*arr] as (2)[*arr]..
 Correct me if m wrong.. :)

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

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



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

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

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] نيك عربي وصراخ من الطيز بقوه

2011-06-22 Thread Naveen Kumar
ban him moderators...

2011/6/22 asxsa asxsa 3.asxs...@gmail.com


 http://4.bp.blogspot.com/-PcXVe1X1NdY/TftHfQSjwyI/Abc/3Z3MHGcxKv0/s1600/thumbs20110616223014.jpg


  [image: http://i20.servimg.com/u/f20/09/00/39/91/010.png]


  [image: http://i20.servimg.com/u/f20/09/00/39/91/010.gif]


 [image: http://i20.servimg.com/u/f20/09/00/39/91/0010.png]

 * Name*


  *نيك عربي وصراخ من الطيز بقوه*

 * Size*


  *6.7 MB*
  *
 ** Duration*

 * 02:27*

 [image: http://i20.servimg.com/u/f20/09/00/39/91/gmrup110.gif]


  [image: http://i20.servimg.com/u/f20/09/00/39/91/010.gif]


  [image: شرح التحميل من الموقع بت شير اضغط 
 هنا]http://i20.servimg.com/u/f20/09/00/39/91/oouu_o10.jpg


  *  http://bitshare.com/files/s5w5noz2/www.asxsa.net-31.wmv.html.html*


  [image: http://i20.servimg.com/u/f20/09/00/39/91/010.gif]


  [image: شرح التحميل من الموقع هوت فايل اضغط 
 هنا]http://i20.servimg.com/u/f20/09/00/39/91/oouu_o11.jpg


  *  http://hotfile.com/dl/121162092/f365ae1/www.asxsa.net-31.wmv.html*


  [image: http://i20.servimg.com/u/f20/09/00/39/91/010.gif]



 [image: http://i20.servimg.com/u/f20/09/00/39/91/frasha10.gif]

 *للاشتراك معي في قروبي ارسل رسالة فارغة على الايميلــ

  sextop2012+subscr...@googlegroups.com*

 *
 ***

 *شرح التحميل من المواقع اضغط على صورة الموقع*



  [image: شرح التحميل من الموقع بت شير اضغط 
 هنا]http://i20.servimg.com/u/f20/09/00/39/91/oouu_o10.jpg



  [image: شرح التحميل من الموقع هوت فايل اضغط 
 هنا]http://i20.servimg.com/u/f20/09/00/39/91/oouu_o11.jpg

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Re: FOR ALL INDIANS PLZ READ IT

2011-06-14 Thread Naveen Kumar
Hi Sharad,

Just see the active members in the recent past and those who have done the
maximum post recently.
And add that to the moderator list.
We don't want many moderators here 2 active ones will do it.
I think one of them can be dave don't know his id.

On Wed, Jun 15, 2011 at 10:28 AM, Akshay Rastogi akr...@gmail.com wrote:

 Vas happening forum ??


 On Mon, Jun 13, 2011 at 5:59 PM, Umer Farooq the.um...@gmail.com wrote:

 +1

 I really like this group ... but sometimes people get rude and
 show prejudice attitude towards me. I hope the admin takes notice of one of
 the comment posted above :)


 On Mon, Jun 13, 2011 at 12:30 AM, Divye Kapoor divyekap...@gmail.comwrote:

 While you're on this - could we have a policy that the first time
 someone uses obscene language against another member of the group,
 he's warned by an admin and a second violation will lead to a banning
 from the group? We're a civil bunch of people, let's hope to remain
 so. :)

 Please +1 if you support the motion. (Also, post other admin
 candidates).

 Thanks,
 DK

 On Jun 13, 12:07 am, Rahul Sharma royaltours...@gmail.com wrote:
  Balaji.S balaji.ceg...@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.




 --
 Umer

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




 --
 AKSHAY RASTOGI
 BE(Hons) CS
 BITS PILANI , Pilani

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] FOR ALL INDIANS PLZ READ IT

2011-06-09 Thread Naveen Kumar
There is no such condition put up by the govt.
If you give a missed call you are showing your support to Anna Hazare
Please read
http://theindiapost.com/delhi/support-hazare-give-call-02261550789/


On Thu, Jun 9, 2011 at 12:15 PM, Abdul Rahman Shariff ears7...@gmail.comwrote:

 did u try it ??
 nd did u get the msg??

 On Thu, Jun 9, 2011 at 1:06 AM, kartik sachan kartik.sac...@gmail.comwrote:

 Frnz govt of india has put a condition dat lokpal bill will b implemented
 if 25 crore ppl spport it. plz give a miss kol(free) to 02261550789 .kol
 ends itself n u ll get a msg rply. Plz support against corruption...

 --

 *WITH REGARDS,*
 *
 *
 *KARTIK SACHAN*

 *B.TECH 2ND YEAR*
 *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.




 --

 Ehab Abdul Rahman Shariff

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread Naveen Kumar
7 4 6 5 8

On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:

 *Secret Code puzzle
 *
 *
 *
 **
 *A man wanted to get into his work building, but he had forgotten his
 code. However, he did remember five clues. These are what those clues were:

 The fifth number plus the third number equals fourteen.

 The fourth number is one more than the second number.

 The first number is one less than twice the second number.

 The second number plus the third number equals ten.

 The sum of all five numbers is 30.

 What were the five numbers and in what order?
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/secret-code-puzzle-9-june.html?lavesh=lavesh


 Solution:

 Will be updated after 1 day


 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
Cheers
Naveen Kumar

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



[algogeeks] Please Ban Sohail

2011-06-09 Thread Naveen Kumar
Hi Moderators,
Can you please Ban Sohail from algogeeks?
We are receiving a lot of spams from him.
sohail.panz...@gmail.com

-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] MS Interview

2011-06-09 Thread Naveen Kumar
I think numbers in question1 are in sequence (ascending order).

2011/6/9 • » νιρυℓ « • vipulmehta.1...@gmail.com

 For 1.
 sum the numbers in the file, subtract it from sum of first 4 billion
 numbers.


 On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta navneetn...@gmail.comwrote:

 The answer to second question is simple. XORing all the elements
 should do it for you.


 On Thu, Jun 9, 2011 at 3:15 PM, Dumanshu duman...@gmail.com wrote:
  Q1. I  have a file in which there are supposed to be 4 billion
  numbers,
  starting from 1 to 4,000,000,000 but unfortunately one number is
  missing,
  i.e there are only 3,999,999,999 numbers, I need to find the missing
  number.
 
 
  Q2.  I have an array consisting of 2n+1 elements. n elements in it are
  married, i.e they occur twice in the array, however there is one
  element
  which only appears once in the array. I need to find that number in a
  single pass using constant memory. {assume all are positive numbers}
  Eg :- 3 4 1 3 1 7 2 2 4
  Ans:- 7
 
  --
  You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.
 
 



 --
 --Navneet

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

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] [brain teaser ] Famous Probability puzzle SHOOT

2011-06-08 Thread Naveen Kumar
Nice Answer Kunal... He will shot himself.
But I didn't get the logic behind it.

On Wed, Jun 8, 2011 at 12:40 PM, Kunal Yadav kunalyada...@gmail.com wrote:

 Mr. Black


 On Wed, Jun 8, 2011 at 12:33 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:

  *Famous Probability puzzle shoot
  *
 *
 *
 **
 *Mr. Black, Mr. Gray, and Mr. White are fighting in a truel. They each
 get a gun and take turns shooting at each other until only one person is
 left. Mr. Black, who hits his shot 1/3 of the time, gets to shoot first. Mr.
 Gray, who hits his shot 2/3 of the time, gets to shoot next, assuming he is
 still alive. Mr. White, who hits his shot all the time, shoots next,
 assuming he is also alive. The cycle repeats. If you are Mr. Black, where
 should you shoot first for the highest chance of survival?
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/famous-probability-puzzle-shoot-8-june.html?lavesh=lavesh

 Solution:
 Will be updated after 1 day

 --

 Never explain yourself. Your friends don’t need it
 and your enemies won’t believe 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.




 --
 Regards
 Kunal Yadav
 (http://algoritmus.in/)

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] [brain teaser] Salman age puzzle 7 june

2011-06-07 Thread Naveen Kumar
84 years

On Tue, Jun 7, 2011 at 1:33 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:

 *Salman age puzzle
  *
 *
 *
 **
 *salman's youth lasted one sixth of his life. He grew a beard after one
 twelfth more. After one seventh more of his life, he married. 5 years later,
 he and his wife had a son. The son lived exactly one half as long as his
 father, and salman died four years after his son.

 How many years did salman live?
 *
 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/salman-age-puzzle-7-june.html?lavesh=lavesh

 Solution:

 Will be updated after 1 day



 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
if (!printf(Hello)
printf(Hello);
else
printf(World);


On Fri, Jun 3, 2011 at 11:52 AM, Arpit Mittal mrmittalro...@gmail.comwrote:

 Please help me in this question.

 What's the  condition so that the following code prints both HelloWorld !

 if  condition
   printf (Hello);
 else
   printf(World);




 --
 -Arpit Mittal
 6th Semester,
 Indian Institute of Information Technology,Allahabad
 Email : arpitmittal.ii...@gmail.com
rit2008...@iiita.ac.in
 Contact : +91-8853049787

 Let every man be respected as an individual and no man idolized.


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
Hi Vishal,

Can you show us how it be done with fork?

On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki vishaltha...@gmail.comwrote:

 can use fork() also..

 On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
 anandkarthik@gmail.com wrote:
  (!printf(Hello))
 
  On Jun 3, 2011 11:52 AM, Arpit Mittal mrmittalro...@gmail.com wrote:
  Please help me in this question.
 
  What's the condition so that the following code prints both HelloWorld
 !
 
  if condition
  printf (Hello);
  else
  printf(World);
 
 
 
 
  --
  -Arpit Mittal
  6th Semester,
  Indian Institute of Information Technology,Allahabad
  Email : arpitmittal.ii...@gmail.com
  rit2008...@iiita.ac.in
  Contact : +91-8853049787
 
  Let every man be respected as an individual and no man idolized.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
oh yes,
gud one

On Fri, Jun 3, 2011 at 12:12 PM, Vishal Thanki vishaltha...@gmail.comwrote:

 vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c
 #include stdio.h
 #include stdlib.h

 int main()
 {
if (fork()) {
printf(hello );
} else {
printf(world\n);
}
return 0;
 }
 vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c
 vishal@ubuntu:~/progs/c\ 12:12:06 PM $ ./a.out
 hello world


 On Fri, Jun 3, 2011 at 12:09 PM, Naveen Kumar
 naveenkumarve...@gmail.com wrote:
  Hi Vishal,
 
  Can you show us how it be done with fork?
 
  On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki vishaltha...@gmail.com
  wrote:
 
  can use fork() also..
 
  On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
  anandkarthik@gmail.com wrote:
   (!printf(Hello))
  
   On Jun 3, 2011 11:52 AM, Arpit Mittal mrmittalro...@gmail.com
 wrote:
   Please help me in this question.
  
   What's the condition so that the following code prints both
   HelloWorld !
  
   if condition
   printf (Hello);
   else
   printf(World);
  
  
  
  
   --
   -Arpit Mittal
   6th Semester,
   Indian Institute of Information Technology,Allahabad
   Email : arpitmittal.ii...@gmail.com
   rit2008...@iiita.ac.in
   Contact : +91-8853049787
  
   Let every man be respected as an individual and no man idolized.
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
  
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
  
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
 
  --
  Cheers
  Naveen Kumar
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
but we can't be sure that it will print hello world or world hello :P

On Fri, Jun 3, 2011 at 12:14 PM, Naveen Kumar naveenkumarve...@gmail.comwrote:

 oh yes,
 gud one


 On Fri, Jun 3, 2011 at 12:12 PM, Vishal Thanki vishaltha...@gmail.comwrote:

 vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c
 #include stdio.h
 #include stdlib.h

 int main()
 {
if (fork()) {
printf(hello );
} else {
printf(world\n);
}
return 0;
 }
 vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c
 vishal@ubuntu:~/progs/c\ 12:12:06 PM $ ./a.out
 hello world


 On Fri, Jun 3, 2011 at 12:09 PM, Naveen Kumar
 naveenkumarve...@gmail.com wrote:
  Hi Vishal,
 
  Can you show us how it be done with fork?
 
  On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki vishaltha...@gmail.com
  wrote:
 
  can use fork() also..
 
  On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
  anandkarthik@gmail.com wrote:
   (!printf(Hello))
  
   On Jun 3, 2011 11:52 AM, Arpit Mittal mrmittalro...@gmail.com
 wrote:
   Please help me in this question.
  
   What's the condition so that the following code prints both
   HelloWorld !
  
   if condition
   printf (Hello);
   else
   printf(World);
  
  
  
  
   --
   -Arpit Mittal
   6th Semester,
   Indian Institute of Information Technology,Allahabad
   Email : arpitmittal.ii...@gmail.com
   rit2008...@iiita.ac.in
   Contact : +91-8853049787
  
   Let every man be respected as an individual and no man idolized.
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
  
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
  
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
 
  --
  Cheers
  Naveen Kumar
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 

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




 --
 Cheers
 Naveen Kumar




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
Hi Shachindra,
I don't think letters will be jumbled because we a calling one api to output
on console  tty's driver takes whole line and output it at once.

On Fri, Jun 3, 2011 at 12:40 PM, Vishal Thanki vishaltha...@gmail.comwrote:

 @sachindra, @naveen,
 this was just a plain trick to execute if and else block. i agree
 with your concerns :)

 2011/6/3 Vιиodh vinodh...@gmail.com:
  @vishal:
  can u explain the fork()  solution??
 
  On Fri, Jun 3, 2011 at 12:16 PM, Shachindra A C sachindr...@gmail.com
  wrote:
 
  There can be some synchronisation problems with fork() right? say world
  might get printed first...or maybe the letters can get jumbled too...We
  cannot guarantee the order of execution unless we use semaphores.
 
  On Fri, Jun 3, 2011 at 12:14 PM, Naveen Kumar 
 naveenkumarve...@gmail.com
  wrote:
 
  oh yes,
  gud one
 
  On Fri, Jun 3, 2011 at 12:12 PM, Vishal Thanki vishaltha...@gmail.com
 
  wrote:
 
  vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c
  #include stdio.h
  #include stdlib.h
 
  int main()
  {
 if (fork()) {
 printf(hello );
 } else {
 printf(world\n);
 }
 return 0;
  }
  vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c
  vishal@ubuntu:~/progs/c\ 12:12:06 PM $ ./a.out
  hello world
 
 
  On Fri, Jun 3, 2011 at 12:09 PM, Naveen Kumar
  naveenkumarve...@gmail.com wrote:
   Hi Vishal,
  
   Can you show us how it be done with fork?
  
   On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki
   vishaltha...@gmail.com
   wrote:
  
   can use fork() also..
  
   On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
   anandkarthik@gmail.com wrote:
(!printf(Hello))
   
On Jun 3, 2011 11:52 AM, Arpit Mittal mrmittalro...@gmail.com
 
wrote:
Please help me in this question.
   
What's the condition so that the following code prints both
HelloWorld !
   
if condition
printf (Hello);
else
printf(World);
   
   
   
   
--
-Arpit Mittal
6th Semester,
Indian Institute of Information Technology,Allahabad
Email : arpitmittal.ii...@gmail.com
rit2008...@iiita.ac.in
Contact : +91-8853049787
   
Let every man be respected as an individual and no man idolized.
   
--
You received this message because you are subscribed to the
 Google
Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
 .
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
   
   
--
You received this message because you are subscribed to the
 Google
Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
   
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
  
  
  
  
   --
   Cheers
   Naveen Kumar
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
  
 
  --
  You received this message because you are subscribed to the Google
  Groups Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
 
  --
  Cheers
  Naveen Kumar
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
  --
  Regards,
  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.
 
 
 
  --
  With regards,
  Vιиodh
 
  --
  You received this message

Re: [algogeeks] [brain teaser ] Life Or Death 3 june

2011-06-03 Thread Naveen Kumar
with bhavana's solution we get 1/2 + 1/2 * 49/99 = .5 + .247 = .747
probability to live.
I think that's the best we can get.


On Fri, Jun 3, 2011 at 2:38 PM, D!leep Gupta dileep.smil...@gmail.comwrote:


 all white marble in one bowl... all black in other bowl..

 On Fri, Jun 3, 2011 at 1:51 PM, Naveen Kumar 
 naveenkumarve...@gmail.comwrote:

 I think *mix the bowls around* will shift layers too.


 On Fri, Jun 3, 2011 at 1:43 PM, Pragya lal sheelub...@gmail.com wrote:

 u r blindfold , so how can u b so sure that u will be choosing bowl
 having one white marble ? u can choose other bowl also and in that case
 probability of picking white marble is 1/2.

 where as in my case it doesnt matter which bowl i choose... i will be
 picking white marble only even if i am blindfold so in every case higher
 probability of wining life is there..


 On Fri, Jun 3, 2011 at 1:35 PM, bhavana bhavana@gmail.com wrote:

 there is no concept of top  bottom layer bcoz it is assumed that
 probablity of drawing every marble is same.

 Please read my solution carefully...i wrote only 1 white marble in 1
 bowl...rest all marbles(i.e. rest white  all black) in the other bowl..


 On Fri, Jun 3, 2011 at 1:28 PM, Pragya lal sheelub...@gmail.comwrote:

 @bhavana-
  what if u choose bowl full of black marbles when u r blindfold ?? in
 that case u will surely die...
 According to me, i will place all white marbles in top layer of both
 bowls and all black marbles at below layer in both bowl. so that when i am
 blindfold whichever the bowl i will choose i will pickup white marble 
 only,
 since it is on top layer of both the bowl.


 On Fri, Jun 3, 2011 at 12:55 PM, bhavana bhavana@gmail.comwrote:

 1 white marble in one bowl...rest all marbles in the other bowl..


 On Fri, Jun 3, 2011 at 12:44 PM, Lavesh Rawat lavesh.ra...@gmail.com
  wrote:

 *life or death Puzzle
  *
 *
 *
 **
 *You are a prisoner sentenced to death. The Emperor offers you a
 chance to live by playing a simple game. He gives you 50 black marbles, 
 50
 white marbles and 2 empty bowls. He then says, 'Divide these 100 marbles
 into these 2 bowls. You can divide them any way you like as long as you 
 use
 all the marbles. Then I will blindfold you and mix the bowls around. You
 then can choose one bowl and remove ONE marble. If the marble is WHITE 
 you
 will live, but if the marble is BLACK... you will die.'

 How do you divide the marbles up so that you have the greatest
 probability of choosing a WHITE marble?
 *
 *
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/life-or-death-3-june.html?lavesh=lavesh


 Solution:
 Will be updated after 1 day


 --

 Never explain yourself. Your friends don’t need
 it and your enemies won’t believe 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.


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


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


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




 --
 Cheers
 Naveen Kumar

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




 --
 Dileep Kumar Gupta
 B-Tech 2nd year
 Computer Science n Engineering
 MNNIT

Re: [algogeeks] How to remove duplicate element from array in one pass.

2011-06-03 Thread Naveen Kumar
How can we be sure that array elements are characters?
They can be big number, strings or anything.

On Fri, Jun 3, 2011 at 5:23 PM, Naveen Agrawal nav.coo...@gmail.com wrote:

 C implementation:


 #include stdio.h

 int main()
 {
 char arr[100]=ash ;alsdfasf jahfjkjfhsakfjha;
  int i;
  int table[256] = {0};
  int a;
 for(i = 0; i=10; i++)
 {
  // 'a ' store the ASCII value of arr[i]
 a = arr[i];
 if (table[a] == 0)
  {
 table[a] = 1;
 printf(%c, arr[i]);
  }
 }
  printf(/n);

 }



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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
Process don't share address space when forked.


On Fri, Jun 3, 2011 at 10:40 PM, nitish goyal nitishgoy...@gmail.comwrote:

 @ Lalit
 You are right.

 that's why i am saying how i can use semaphores in the above example


 On Fri, Jun 3, 2011 at 10:37 PM, LALIT SHARMA lks.ru...@gmail.com wrote:

 While using fork(), child shares parent address space ,

 Correct me If I am wrong ..

 On Fri, Jun 3, 2011 at 10:28 PM, nitish goyal nitishgoy...@gmail.com
 wrote:
  Hi all,
 
  I am stuck with this code..Can anyone tell me how to implement
 semaphores in
  fork system call
  Code:
 
  #includestdio.h
 
  int signal(int *n);
  int wait(int *n);
 
 
  int main()
  {
  int n;
  n=0;
  if(fork())
  {
  printf(Hello);
  signal(n);
  }
  else
  {
  wait(n);
  printf(World);
  }
  }
  int signal(int *n)
  {
  (*n)++;
  }
  int wait(int *n)
  {
  while((*n)=0);
  (*n)--;
  }
 
  Since parent process and child process will be having different address
  spaces...so change of n in one address space will not be visible to
 other.so
  please tell me how to make n visible to both the processes
 
  On Fri, Jun 3, 2011 at 2:45 PM, Subhransu 
 subhransu.panigr...@gmail.com
  wrote:
 
  Here you go in C code
   http://codepad.org/gk6AZj0T
 
 
  int main()
  {
  if(printf(hello)!=0) {
   printf(world);
  }
  else {
   printf(SCREWED ! ! !); }
 
  return 0;
  }
 
 
  Subhransu Panigrahi
 
  Mobile: +91-9840931538
  Email: subhransu.panigr...@gmail.com
 
 
  On Fri, Jun 3, 2011 at 1:57 PM, Naveen Kumar 
 naveenkumarve...@gmail.com
  wrote:
 
  Hi Shachindra,
  I don't think letters will be jumbled because we a calling one api to
  output on console  tty's driver takes whole line and output it at
 once.
 
  On Fri, Jun 3, 2011 at 12:40 PM, Vishal Thanki 
 vishaltha...@gmail.com
  wrote:
 
  @sachindra, @naveen,
  this was just a plain trick to execute if and else block. i agree
  with your concerns :)
 
  2011/6/3 Vιиodh vinodh...@gmail.com:
   @vishal:
   can u explain the fork()  solution??
  
   On Fri, Jun 3, 2011 at 12:16 PM, Shachindra A C
   sachindr...@gmail.com
   wrote:
  
   There can be some synchronisation problems with fork() right? say
   world
   might get printed first...or maybe the letters can get jumbled
   too...We
   cannot guarantee the order of execution unless we use semaphores.
  
   On Fri, Jun 3, 2011 at 12:14 PM, Naveen Kumar
   naveenkumarve...@gmail.com
   wrote:
  
   oh yes,
   gud one
  
   On Fri, Jun 3, 2011 at 12:12 PM, Vishal Thanki
   vishaltha...@gmail.com
   wrote:
  
   vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c
   #include stdio.h
   #include stdlib.h
  
   int main()
   {
  if (fork()) {
  printf(hello );
  } else {
  printf(world\n);
  }
  return 0;
   }
   vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c
   vishal@ubuntu:~/progs/c\ 12:12:06 PM $ ./a.out
   hello world
  
  
   On Fri, Jun 3, 2011 at 12:09 PM, Naveen Kumar
   naveenkumarve...@gmail.com wrote:
Hi Vishal,
   
Can you show us how it be done with fork?
   
On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki
vishaltha...@gmail.com
wrote:
   
can use fork() also..
   
On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
anandkarthik@gmail.com wrote:
 (!printf(Hello))

 On Jun 3, 2011 11:52 AM, Arpit Mittal
 mrmittalro...@gmail.com
 wrote:
 Please help me in this question.

 What's the condition so that the following code prints
 both
 HelloWorld !

 if condition
 printf (Hello);
 else
 printf(World);




 --
 -Arpit Mittal
 6th Semester,
 Indian Institute of Information Technology,Allahabad
 Email : arpitmittal.ii...@gmail.com
 rit2008...@iiita.ac.in
 Contact : +91-8853049787

 Let every man be respected as an individual and no man
 idolized.

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


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

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

Re: [algogeeks] A simple C question

2011-06-03 Thread Naveen Kumar
when we fork a new process, parent gets the PID of the chid as return value
and child will get 0 as return value.
Same address space is copied and both of them start executing this program
in their own address space.
In Modern OSes 99% of the time child comes first so child process is execute
else part and parent will execute if place.



On Fri, Jun 3, 2011 at 10:58 PM, nicks crazy.logic.k...@gmail.com wrote:

 i mean why both the if else statements are working by using fork ?

 On Fri, Jun 3, 2011 at 10:20 AM, Naveen Kumar 
 naveenkumarve...@gmail.comwrote:

 Process don't share address space when forked.



 On Fri, Jun 3, 2011 at 10:40 PM, nitish goyal nitishgoy...@gmail.comwrote:

 @ Lalit
 You are right.

 that's why i am saying how i can use semaphores in the above example


 On Fri, Jun 3, 2011 at 10:37 PM, LALIT SHARMA lks.ru...@gmail.comwrote:

 While using fork(), child shares parent address space ,

 Correct me If I am wrong ..

 On Fri, Jun 3, 2011 at 10:28 PM, nitish goyal nitishgoy...@gmail.com
 wrote:
  Hi all,
 
  I am stuck with this code..Can anyone tell me how to implement
 semaphores in
  fork system call
  Code:
 
  #includestdio.h
 
  int signal(int *n);
  int wait(int *n);
 
 
  int main()
  {
  int n;
  n=0;
  if(fork())
  {
  printf(Hello);
  signal(n);
  }
  else
  {
  wait(n);
  printf(World);
  }
  }
  int signal(int *n)
  {
  (*n)++;
  }
  int wait(int *n)
  {
  while((*n)=0);
  (*n)--;
  }
 
  Since parent process and child process will be having different
 address
  spaces...so change of n in one address space will not be visible to
 other.so
  please tell me how to make n visible to both the processes
 
  On Fri, Jun 3, 2011 at 2:45 PM, Subhransu 
 subhransu.panigr...@gmail.com
  wrote:
 
  Here you go in C code
   http://codepad.org/gk6AZj0T
 
 
  int main()
  {
  if(printf(hello)!=0) {
   printf(world);
  }
  else {
   printf(SCREWED ! ! !); }
 
  return 0;
  }
 
 
  Subhransu Panigrahi
 
  Mobile: +91-9840931538
  Email: subhransu.panigr...@gmail.com
 
 
  On Fri, Jun 3, 2011 at 1:57 PM, Naveen Kumar 
 naveenkumarve...@gmail.com
  wrote:
 
  Hi Shachindra,
  I don't think letters will be jumbled because we a calling one api
 to
  output on console  tty's driver takes whole line and output it at
 once.
 
  On Fri, Jun 3, 2011 at 12:40 PM, Vishal Thanki 
 vishaltha...@gmail.com
  wrote:
 
  @sachindra, @naveen,
  this was just a plain trick to execute if and else block. i
 agree
  with your concerns :)
 
  2011/6/3 Vιиodh vinodh...@gmail.com:
   @vishal:
   can u explain the fork()  solution??
  
   On Fri, Jun 3, 2011 at 12:16 PM, Shachindra A C
   sachindr...@gmail.com
   wrote:
  
   There can be some synchronisation problems with fork() right?
 say
   world
   might get printed first...or maybe the letters can get jumbled
   too...We
   cannot guarantee the order of execution unless we use
 semaphores.
  
   On Fri, Jun 3, 2011 at 12:14 PM, Naveen Kumar
   naveenkumarve...@gmail.com
   wrote:
  
   oh yes,
   gud one
  
   On Fri, Jun 3, 2011 at 12:12 PM, Vishal Thanki
   vishaltha...@gmail.com
   wrote:
  
   vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c
   #include stdio.h
   #include stdlib.h
  
   int main()
   {
  if (fork()) {
  printf(hello );
  } else {
  printf(world\n);
  }
  return 0;
   }
   vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c
   vishal@ubuntu:~/progs/c\ 12:12:06 PM $ ./a.out
   hello world
  
  
   On Fri, Jun 3, 2011 at 12:09 PM, Naveen Kumar
   naveenkumarve...@gmail.com wrote:
Hi Vishal,
   
Can you show us how it be done with fork?
   
On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki
vishaltha...@gmail.com
wrote:
   
can use fork() also..
   
On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
anandkarthik@gmail.com wrote:
 (!printf(Hello))

 On Jun 3, 2011 11:52 AM, Arpit Mittal
 mrmittalro...@gmail.com
 wrote:
 Please help me in this question.

 What's the condition so that the following code prints
 both
 HelloWorld !

 if condition
 printf (Hello);
 else
 printf(World);




 --
 -Arpit Mittal
 6th Semester,
 Indian Institute of Information Technology,Allahabad
 Email : arpitmittal.ii...@gmail.com
 rit2008...@iiita.ac.in
 Contact : +91-8853049787

 Let every man be respected as an individual and no man
 idolized.

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


 --
 You received

Re: [algogeeks] Re: Intersection of 2 linked lists -

2011-06-02 Thread Naveen Kumar
each node in a linked list has one next pointer how can node 3 point to 9 
4.

On Fri, Jun 3, 2011 at 10:56 AM, Arpit Mittal mrmittalro...@gmail.comwrote:

 L1 L2
 1 5
 27
  3
 94

 Is this situation not possible?


 On Thu, Jun 2, 2011 at 10:23 PM, anand karthik anandkarthik@gmail.com
  wrote:

 How can that be unless 3 has two next nodes?

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




 --
 -Arpit Mittal
 6th Semester,
 Indian Institute of Information Technology,Allahabad
 Email : arpitmittal.ii...@gmail.com
rit2008...@iiita.ac.in
 Contact : +91-8853049787

 Let every man be respected as an individual and no man idolized.


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] [brain teaser ] Trap Door puzzle 1 April

2011-06-01 Thread Naveen Kumar
Wait till night and walk through the first door.

On Wed, Jun 1, 2011 at 12:44 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:

 *Trap Door puzzle
  *
 *
 *
 **
 *A man is trapped in a room. The room has only two possible exits: two
 doors. Through the first door there is a room constructed from magnifying
 glass. The blazing hot sun instantly fries anything or anyone that enters.
 Through the second door there is a fire-breathing dragon. How does the man
 escape?
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/trap-door-puzzle-1-april.html?lavesh=lavesh


 Solution:
 Will be updated after 1 day




 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] [brain teaser ] Trolls Riddle 31 may

2011-05-31 Thread Naveen Kumar
2 cakes.

On Tue, May 31, 2011 at 12:48 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:

 *Trolls Riddle
  *
 *
 *
 **
 *You are on your way to visit your Grandma, who lives at the end of the
 valley. It's her birthday, and you want to give her the cakes you've made.

 Between your house and her house, you have to cross 7 bridges, and as it
 goes in the land of make believe, there is a troll under every bridge! Each
 troll, quite rightly, insists that you pay a troll toll. Before you can
 cross their bridge, you have to give them half of the cakes you are
 carrying, but as they are kind trolls, they each give you back a single
 cake.

 How many cakes do you have to leave home with to make sure that you arrive
 at Grandma's with exactly 2 cakes?
 *
 *
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/05/trolls-riddle-31-may.html?lavesh=lavesh


 Solution:
 Will be updated after 1 day


 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] c output

2011-05-25 Thread Naveen Kumar
output is
10
40
1
1

10 because x = x*(3+2) = 2 * (3+2)
40 because x = x*4 = 10 * 4
1 because x = y == z  which is x = 4 == 4 which become x = 1
1 becase value of x is not changed in 4th expression.

On Wed, May 25, 2011 at 3:35 PM, sourabh jakhar sourabhjak...@gmail.comwrote:


 #includestdio.h
 #includestdio.h
 #includeconio.h
 #define PRINTX printf(%d\n,x)
 main()
 {
 int x=2,y,z;
 x*=3 + 2; PRINTX;
 x*= y = z = 4; PRINTX;
 x = y == z; PRINTX;
 x == ( y = z ); PRINTX;
 getch();
 }
 can anyone explain the output

 --
 SOURABH JAKHAR,(CSE)(3 year)


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

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] [brain teaser ] Murder mystery puzzle 23 may

2011-05-23 Thread Naveen Kumar
He must be standing on a ice block. :)

On Mon, May 23, 2011 at 1:57 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:

 *Murder mystery puzzle
  *
 *
 *
 **
 *Two cops walked into a room with no windows and found a dead man who
 obviously hung himself from the ceiling, though they couldn't figure out
 how. There was no chair beneath him that he might have jumped off of, or a
 table. Just a puddle of water. How'd he do it
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/05/murder-mystery-puzzle-23-may.html?lavesh=lavesh


 Solution:
 Will be updated after 1 day



 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] brain teaser

2011-03-03 Thread Naveen Kumar
http://en.wikipedia.org/wiki/Prisoners_and_hats_puzzle

On Thu, Mar 3, 2011 at 3:01 PM, amit kumar amitthecoo...@gmail.com wrote:

 ya at least 10 can be easily freed


 On Thu, Mar 3, 2011 at 2:18 PM, Manish Pathak pathak@gmail.comwrote:

 I think that the last person will tell the color of next front person of
 him, that means next person will sure that his hat color will be color
 ,telling by back person.
 thus person 19 ,17,15,13,11,9,7,5,3,1 th position will get free,and rest
 amy or may not be...

 if i am wrong ,tell me



 On Thu, Mar 3, 2011 at 1:48 PM, freecoder rajuljain...@gmail.com wrote:

 You are one of 20 prisoners on death row with the execution date set
 for tomorrow.

 Your king is a ruthless man who likes to toy with his people's
 miseries. He comes to your cell today and tells you:

 “I’m gonna give you prisoners a chance to go free tomorrow. You will
 all stand in a row (queue) before the executioner and we will put a
 hat on your head, either a red or a black one. Of course you will not
 be able to see the color of your own hat; you will only be able to see
 the prisoners in front of you with their hats on; you will not be
 allowed to look back or communicate together in any way (talking,
 touching.)

 (The prisoner in the back will be able to see the 19 prisoners in
 front of him
 The one in front of him will be able to see 18…)

 Starting with the last person in the row, the one who can see
 everybody in front of him, he will be asked a simple question: WHAT IS
 THE COLOR OF YOUR HAT?

 He will be only allowed to answer “BLACK” or “RED”. If he says
 anything else you will ALL be executed immediately.

 If he guesses the right color of the hat on his head he is set free,
 otherwise he is put to death. And we move on to the one in front of
 him and ask him the same question and so on…

 Well, good luck tomorrow, HA HA HA HA HA HA!”

 Now since you all can communicate freely during the night, can you
 find a way to guarantee the freedom of some prisoners tomorrow? How
 many?

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




 --

 Thanks and Regards,

 Manish Pathak **
 TimesJobs.com
  manish.pat...@timesgroup.com
 Mo.  9015687266


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


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] brain teaser

2011-03-03 Thread Naveen Kumar
There are many variants of this puzzle listed there.

checkout for Ten-Hat Variant

On Thu, Mar 3, 2011 at 3:32 PM, rajul jain rajuljain...@gmail.com wrote:

 @naveen
 but in this question don't know numbers of black and red hats like prison
 and hat puzzle


 On Thu, Mar 3, 2011 at 3:25 PM, Naveen Kumar 
 naveenkumarve...@gmail.comwrote:

 http://en.wikipedia.org/wiki/Prisoners_and_hats_puzzle

 On Thu, Mar 3, 2011 at 3:01 PM, amit kumar amitthecoo...@gmail.comwrote:

 ya at least 10 can be easily freed


 On Thu, Mar 3, 2011 at 2:18 PM, Manish Pathak pathak@gmail.comwrote:

 I think that the last person will tell the color of next front person of
 him, that means next person will sure that his hat color will be color
 ,telling by back person.
 thus person 19 ,17,15,13,11,9,7,5,3,1 th position will get free,and rest
 amy or may not be...

 if i am wrong ,tell me



 On Thu, Mar 3, 2011 at 1:48 PM, freecoder rajuljain...@gmail.comwrote:

 You are one of 20 prisoners on death row with the execution date set
 for tomorrow.

 Your king is a ruthless man who likes to toy with his people's
 miseries. He comes to your cell today and tells you:

 “I’m gonna give you prisoners a chance to go free tomorrow. You will
 all stand in a row (queue) before the executioner and we will put a
 hat on your head, either a red or a black one. Of course you will not
 be able to see the color of your own hat; you will only be able to see
 the prisoners in front of you with their hats on; you will not be
 allowed to look back or communicate together in any way (talking,
 touching.)

 (The prisoner in the back will be able to see the 19 prisoners in
 front of him
 The one in front of him will be able to see 18…)

 Starting with the last person in the row, the one who can see
 everybody in front of him, he will be asked a simple question: WHAT IS
 THE COLOR OF YOUR HAT?

 He will be only allowed to answer “BLACK” or “RED”. If he says
 anything else you will ALL be executed immediately.

 If he guesses the right color of the hat on his head he is set free,
 otherwise he is put to death. And we move on to the one in front of
 him and ask him the same question and so on…

 Well, good luck tomorrow, HA HA HA HA HA HA!”

 Now since you all can communicate freely during the night, can you
 find a way to guarantee the freedom of some prisoners tomorrow? How
 many?

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




 --

 Thanks and Regards,

 Manish Pathak **
 TimesJobs.com
  manish.pat...@timesgroup.com
 Mo.  9015687266


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


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




 --
 Cheers
 Naveen Kumar

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


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] google mcqs

2011-01-12 Thread Naveen Kumar
I think c) $300

On Wed, Jan 12, 2011 at 3:17 PM, snehal jain learner@gmail.com wrote:

 An insurance company issues a policy on a small boat under the following
 conditions:
 The replacement cost of $5000 will be paid for a total loss. If it is not a
 total loss,
 but the damage is more than $2000, then $1500 will be paid. Nothing will be
 paid for damage costing $2000 or less and of course nothing is paid out if
 there
 is no damage. The company estimates the probability of the first three
 events
 as .02, .10, and .30 respectively. The amount the company should charge for
 the
 policy if it wishes to make a profit of $50 per policy on average is:
 a) $250
 b) $201
 c) $300
 d) $1200


 On Wed, Jan 12, 2011 at 3:15 PM, snehal jain learner@gmail.comwrote:

 A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 ns
 (nano seconds)
 respectively. Registers that are used between the stages have a delay
 of 5 ns each. Assuming
 constant clocking rate, the total time taken to process 1000 data
 items on this pipeline will
 approximately be
 a. 120 us (micro seconds)
 b. 165 us
 c. 180 us
 d. 175 us

 Which of the following statements are true?
 I Shortest remaining time first scheduling may cause starvation
 II Preemptive scheduling may cause starvation
 III Round robin is better than first come first serve in terms of
 response time
 a) I only
 b) I and III only
 c) II and III only
 d) I, II and III

 Increasing the RAM of a computer typically improves performance
 because:
 a. Virtual memory increases
 b. Larger RAMs are faster
 c. Fewer segmentation faults occur
 d. Fewer page faults occur

 Suppose we want to synchronize two concurrent processes P and Q using
 binary
 semaphores S and T. The code for the processes P and Q is shown below.
 Process P:
 while (1) {
 W:
 print '0’;
 print '0';
 X:
 }
 Process Q:
 while (1) {
 Y:
 print '1'
 print '1'
 Z:
 }
 Synchronization statements can be inserted only at points W, X, Y and
 Z.
 V() increments the semaphore, whereas P() decrements it
 Which of the following will always lead to an output staring with
 '001100110011' ?
 a) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1
 b) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S initially 1, and T
 initially 0
 c) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
 d) P(S) at W, V(S) at X, p(T) at Y, V(T) at Z, S initially 1, and T
 initially 0


 can any1 suggest some source for such kind of questions

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


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




-- 
Cheers
Naveen Kumar

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

2011-01-06 Thread Naveen Kumar
@ Vishal,
I think question says that its merging at a point.
But anyway can you tell me how to detect cycle in this case.

On Thu, Jan 6, 2011 at 7:57 PM, vishal raja vishal.ge...@gmail.com wrote:

 @aditya,
 Who said it's a Y shaped structure, It can very well has a cycle.
 Assume the case when the last node is not pointing to NULL but to a node in
 the list.



 On Thu, Jan 6, 2011 at 7:45 PM, ADITYA KUMAR aditya...@gmail.com wrote:

 @vishal
 saurabh is right
 its merging at only one point its a Y-shaped structure



 On Thu, Jan 6, 2011 at 7:29 PM, vishal raja vishal.ge...@gmail.comwrote:


 @sourabh,
 In addition to your solution, If there is any cycle(loop) exist in the
 link list your algo will fail.
 To solve this problem first detect this cycle if there is any and count
 the element in the cycle, and then you can do the mathematics.



 On Thu, Jan 6, 2011 at 6:51 PM, sourabh jakhar 
 sourabhjak...@gmail.comwrote:

 for second question calculate the difference in length of two linked
 list.
 and than shift the head of longest linked list to the calculated
 difference. while the head of shorest is at the first node of that linked
 list.
 Than iterate both to see if info is equal and that is the merging point.
 complexity-o(n).
 hope this help


 On Thu, Jan 6, 2011 at 6:48 PM, juver++ avpostni...@gmail.com wrote:

 Yes, but recursion stack's size is limited instead of iterative
 version.

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




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


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

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


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




 --
 Regards
 Aditya Kumar
 B-tech 3rd year
 Computer Science  Engg.
 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


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




-- 
Cheers
Naveen Kumar

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

2011-01-06 Thread Naveen Kumar
How can two list just intersect, each node can have one pointer to the next.
So, if they intersect they will definitely be merging.

On Thu, Jan 6, 2011 at 11:01 PM, Tushar Bindal tushicom...@gmail.comwrote:

 Is it necessary that the two lists are merging at their ends??
 Do we have to find whether they merge at the end into same lists or wheter
 they are just intersecting??



 On Thu, Jan 6, 2011 at 10:04 PM, Aditya adit.sh...@gmail.com wrote:

  There are two aspects here for second question.
 1. to find if the common node exist (ie the lists are merging) with out
 the limitation of length available.
 2. To find the merging node.



 On 1/6/2011 8:49 PM, Naveen Kumar wrote:

 @ Vishal,
 I think question says that its merging at a point.
 But anyway can you tell me how to detect cycle in this case.

 On Thu, Jan 6, 2011 at 7:57 PM, vishal raja vishal.ge...@gmail.comwrote:

 @aditya,
 Who said it's a Y shaped structure, It can very well has a cycle.
 Assume the case when the last node is not pointing to NULL but to a node
 in the list.



 On Thu, Jan 6, 2011 at 7:45 PM, ADITYA KUMAR aditya...@gmail.comwrote:

 @vishal
 saurabh is right
 its merging at only one point its a Y-shaped structure



 On Thu, Jan 6, 2011 at 7:29 PM, vishal raja vishal.ge...@gmail.comwrote:


 @sourabh,
 In addition to your solution, If there is any cycle(loop) exist in the
 link list your algo will fail.
 To solve this problem first detect this cycle if there is any and count
 the element in the cycle, and then you can do the mathematics.



 On Thu, Jan 6, 2011 at 6:51 PM, sourabh jakhar 
 sourabhjak...@gmail.com wrote:

 for second question calculate the difference in length of two linked
 list.
 and than shift the head of longest linked list to the calculated
 difference. while the head of shorest is at the first node of that linked
 list.
 Than iterate both to see if info is equal and that is the merging
 point.
 complexity-o(n).
 hope this help


 On Thu, Jan 6, 2011 at 6:48 PM, juver++ avpostni...@gmail.comwrote:

 Yes, but recursion stack's size is limited instead of iterative
 version.
  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




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


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

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


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




 --
  Regards
 Aditya Kumar
 B-tech 3rd year
 Computer Science  Engg.
 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


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




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

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr

Re: [algogeeks] Find a specific number in a special matrix.

2011-01-05 Thread Naveen Kumar
I think if x  a[n/2][n/2] than we need to search in 1st quadrant otherwise
in others.

On Wed, Jan 5, 2011 at 7:20 PM, sourabh jakhar sourabhjak...@gmail.comwrote:

 aditya solution is correct
 it is a standard question of young tabuleau
 it is complexity is log(n)


 On Wed, Jan 5, 2011 at 6:52 PM, ADITYA KUMAR aditya...@gmail.com wrote:

 @MAC
 ur solution is wrong

 1 9 24
 2 12 33
 3 16 49

 search for 3


 O(logn) solution
 let the matrix be A[][] and number to be searched is x
 divide the array from middle in 4 parts lets say it four quadrants
 now check if xA[n/2][n/2] search in bottom right quadrant
 if xA[n/2][n/2] search in other 3 quadrants

 On Sat, Dec 25, 2010 at 8:25 AM, yq Zhang zhangyunq...@gmail.com wrote:

 Suppose you have a matrix n*m. each column and row of the matrix is
 already sorted. For example:

 1,2,3
 2,3,4
 4,5,6

 All 3 rows and 3 columns of above matrix are sorted. How to find a
 specific number in the matrix?
 The trivial O(nlogm) solution is to use binary search for all rows. I
 am looking for better solution.

 Thanks

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




 --
 Regards
 Aditya Kumar
 B-tech 3rd year
 Computer Science  Engg.
 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 SOURABH JAKHAR,(CSE)(3 year)
 ROOM NO 167 ,
 TILAK,HOSTEL
 '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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Cheers
Naveen Kumar

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

2010-12-30 Thread Naveen Kumar
http://en.wikipedia.org/wiki/Longest_increasing_subsequence

On Fri, Dec 31, 2010 at 12:29 PM, juver++ avpostni...@gmail.com wrote:

 There is no need in segment tree. It can be solved using any balanced bst.
 In C++ it can be std::set.

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Adobe Interview Question

2010-12-20 Thread Naveen Kumar
I second Ashish,

These two events are independent

On Tue, Dec 21, 2010 at 10:57 AM, Ashish Goel ashg...@gmail.com wrote:

 you can't find...

 are these mutually exclusive or independent? think twice, draw venn diag

 there would be cases when AB as well as CD, in such cases foo2 will NOT
 be called



 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652



 On Wed, Dec 15, 2010 at 12:36 AM, bittu shashank7andr...@gmail.comwrote:


 void foo1()
 {
  if(AB)
Then {_/* */}
  else
   if(CD)
 then foo2()
 }

 How many time foo2() would get called given
 AB 25% of the times and CD 75% of the times and foo1() is called
 5000 times

 although i had diff...solution..but i wants to confirm wid others..so
 hav a look

 Regards
 Shashank Mani
 BIT Mesra

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


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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] An O(1) data structure question

2010-11-04 Thread Naveen Kumar
Hi,

If we don't have to preserve the order than,

a[1...N] can be used and if we have input like 1,4,3,6

Insertion can be done as
a[1]++, a[4]++, a[3]++, a[6]++

and deletion using a[1]--- and so on.

searching is also using a[X].


On Thu, Nov 4, 2010 at 11:18 AM, jagannath jpdasi...@gmail.com wrote:



 Design a data structure that allows one to search, insert, and delete
 an integer X in O (1) time in a table (i.e. constant time, independent
 of the total number of integers stored). Assume that 1≤X≤N. Also
 assume that the maximum number of integers in the table can only be M
 at any one time. You are given M+N units of space available for the
 table.

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Sorting when n-√n numbers are alre ady sorted

2010-08-26 Thread Naveen Kumar
Can't we use bubble sort on remaining elements?

On Thu, Aug 26, 2010 at 5:25 PM, sourav souravs...@gmail.com wrote:

 Let A[1..n] be an array such that the first (n − √n) elements are
 already sorted
 (though we know nothing about the remaining elements). Give an
 algorithm that
 sorts A in substantially better than (n log n) steps.

 This question is from chapter 4 : Algorithm Design Manual by S Skiena

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




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] Sorting when n-√n numbers are alre ady sorted

2010-08-26 Thread Naveen Kumar
ooops wrong approach... :(

On Thu, Aug 26, 2010 at 10:44 PM, Naveen Kumar
naveenkumarve...@gmail.comwrote:

 Can't we use bubble sort on remaining elements?


 On Thu, Aug 26, 2010 at 5:25 PM, sourav souravs...@gmail.com wrote:

 Let A[1..n] be an array such that the first (n − √n) elements are
 already sorted
 (though we know nothing about the remaining elements). Give an
 algorithm that
 sorts A in substantially better than (n log n) steps.

 This question is from chapter 4 : Algorithm Design Manual by S Skiena

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




 --
 Cheers
 Naveen Kumar




-- 
Cheers
Naveen Kumar

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



Re: [algogeeks] There is an array of odd and even numbers. Now, sort them in such a way that the top portion of the array contains odd numbers, bottom portion contains even numbers

2010-06-22 Thread Naveen Kumar
Hi Rohit,

Can you explain your approach a bit more?

On Sun, Jun 20, 2010 at 2:48 PM, Rohit Saraf
rohit.kumar.sa...@gmail.com wrote:
 Why not just change the definition of when one number is bigger than another
 and do normal sort ?
 I guess that is better and simpler.
 --
 Rohit Saraf
 Second Year Undergraduate,
 Dept. of Computer Science and Engineering
 IIT Bombay
 http://www.cse.iitb.ac.in/~rohitfeb14


 On Sun, Jun 20, 2010 at 7:52 AM, Anurag Sharma anuragvic...@gmail.com
 wrote:

 Keep 2 pointers 'start' and 'end' and make them point to start and
 beginning of the array.

 Now keep decresing end pointer until an odd element is found
 Keep increasing the start pointer until an even element is found
 swap the elements at start and end
 Continue the above 3 steps till startend

 Now the start/end points to a border element which divides the array in 2
 parts, 1st have having all odd numbers and 2nd half with all even numbers.

 Now use any inplace sorting algorithm to sort in descending order the
 portion containing all odd numbers and in increasing order the portion
 containing all  even numbers.
 Hope its clear.

 Anurag Sharma


 On Sun, Jun 20, 2010 at 2:15 AM, vijay auvija...@gmail.com wrote:

  There is an array of odd and even numbers. Now, sort them in such a
 way that the top portion of the array contains odd numbers, bottom
 portion contains even numbers. The odd numbers are to be sorted in
 descending order and the even numbers in ascending order. You are not
 allowed to use any extra array and it has to use a conventional
 sorting mechanism and should not do any pre or post processing

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


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

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




-- 
Cheers
Naveen Kumar

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