Re: [algogeeks] Printing semicolon without semicolon

2011-08-13 Thread paul suganthan
if(printf(%c,59))
{
}

On Sun, Aug 14, 2011 at 8:46 AM, muruga murugavidya1...@gmail.com wrote:

 Printing ;(semicolon) using c program without using semicolon
 anywhere???Pay Pal asked this question in written

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



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



Re: [algogeeks] Hash Table Objective Question

2011-08-11 Thread paul suganthan
Total number of entries=10

The entries that may lead to 2 are 7,8,9,10,1,2

So its 6/10 = 0.6

Paul

On Thu, Aug 11, 2011 at 10:33 PM, Mani Bharathi manibharat...@gmail.comwrote:

 how?

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

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


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



Re: [algogeeks] Data Structure Objective Question

2011-08-11 Thread paul suganthan
queue.Its level order traversal

On Thu, Aug 11, 2011 at 10:36 PM, Mani Bharathi manibharat...@gmail.comwrote:

 Which data structure is useful in transferring a given graph by breadth
 first  search.


 a. heapb. linkedlist   c. array   d. stack   e. queue

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


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

2011-08-11 Thread paul suganthan
Answer is 5.
the relation is
No of leaf nodes = (n-1)*(no of internal nodes) + 1

Paul

On Thu, Aug 11, 2011 at 10:44 PM, amit karmakar
amit.codenam...@gmail.comwrote:

 * correction
 (5*5(There are 5*5 nodes in level 2)-4(These became internal nodes..))

 On Aug 11, 9:58 pm, amit karmakar amit.codenam...@gmail.com wrote:
  5 is possible.
  Considering root of the tree to be at level 0,
  level 1 and level 2 are completely filled.
 
  There are 5 internal nodes in level 1, (since all level 2 nodes are
  present)
  Now only (10 - 5(from level 1)+1(the root)) nodes are required.
  So choose 4 nodes from level 2 and make them interior node.
  So you get 4*5(4 nodes have 5 children) + (5*5(There are 5*5 nodes in
  level 2)-4(These became leaves)) leaves.
 
  Unfortunately 5 is not in the option
 
  On Aug 11, 7:31 pm, rShetty rajeevr...@gmail.com wrote:
 
 
 
A complete n- array tree in which each node has n children or no
   children, let i be the number of internal nodes and L be the number of
   leaves in a complete n- array tree. If L=41 and i=10 what is the value
   of n.
 
   a. 3b. 6   c. 4
 
   How to solve such problems??

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



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



Re: [algogeeks] Hash Table Objective Question

2011-08-11 Thread paul suganthan
if the hash function evaluates to 3 or 4 , collision occurs and by linear
probing they are put into 5(nearest free entry). Also 5 and 6 are empty.

But if the hash value points to 7,8,9,10 or 1 , they will be put into
2(nearest free entry).

On Thu, Aug 11, 2011 at 10:53 PM, Mani Bharathi manibharat...@gmail.comwrote:

 how do u say that they will lead to 2?

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

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


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



Re: [algogeeks] reverse

2011-08-11 Thread paul suganthan
You are trying to reverse the bits. not the number.
This will not work for bits also!

If given input is 1101 0011
you will get
0010 1100

On Thu, Aug 11, 2011 at 11:01 PM, Naren s sweetna...@gmail.com wrote:

 not 100% sure if this is what you are asking for but here it goes.

 you have a number  (binary) and you want  (binary)?

 you want to use the xor operator ^

 value = 0xf0; // binary
 printf(before %d\n);
 value ^= 0xff; // binary
 printf(after%d\n);


 output:
 before 240
 after 15

 240 in binary is 
 15 in binary is 
 http://wiki.answers.com/Q/How_do_you_reverse_a_number_using_bitwise_operator#ixzz1Uk5fUjai


 On Thu, Aug 11, 2011 at 10:43 PM, Rajeshwar Patra 
 rajeshwarpa...@gmail.com wrote:

 how can we reverse a number using bitwise operators?

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

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




 --
 *Narayanan S,*
 B.E., C.S.E., (final year),
 College Of Engineering Guindy,
 Anna University,
 Chennai-25.


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


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



Re: [algogeeks] reverse

2011-08-11 Thread paul suganthan
yaa..this is bitwise complement !

On Thu, Aug 11, 2011 at 11:11 PM, Mani Bharathi manibharat...@gmail.comwrote:

 this is bit wise complement na?

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

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


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