hello
  well from the problem u stated, i guess u know the value(i.e index or say 
length) of n
  as u mentioned n is odd the formula to find middle node(n/2 used for even 
"n") has to b modified.
  the general convention is (n+1)/2
  so u will get the middle node index
  let me remind u u haven't traversed the list yet,u hav only calculated the 
index value for middle node.
  from that by simply traversing for d first time u can get the value(data) of 
middle node
ok??
sunil_h_v <[EMAIL PROTECTED]> wrote:
          Hi everyone, 

I have a problem, i need the logic for it, i dont want any code
snippets or program for it. If you know please explain the logic for this.

Given a linked list of n nodes, n is an odd number, i.e; there are odd
number of nodes in it, I need to find the middle node of the linked
list, i am supposed to traverse only once, i am not supposed to use
any kind of an array to store the address values of the nodes, i am
allowed to use pointers.

How do i go about solving this problem ?

No codes or program please.

Regards,

Sunil.



                         

       
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 

[Non-text portions of this message have been removed]

Reply via email to