wu :: forums
« wu :: forums - Single and double linked list »

Welcome, Guest. Please Login or Register.
Jun 1st, 2024, 2:39pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: ThudnBlunder, towr, Grimbal, SMQ, william wu, Eigenray, Icarus)
   Single and double linked list
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Single and double linked list  (Read 775 times)
oriole
Newbie
*





   


Posts: 32
Single and double linked list  
« on: Jun 28th, 2008, 11:59pm »
Quote Quote Modify Modify

Can doubly linked list be simulated through singly linked list Huh
IP Logged
TenaliRaman
Uberpuzzler
*****



I am no special. I am only passionately curious.

   


Gender: male
Posts: 1001
Re: Single and double linked list  
« Reply #1 on: Jun 29th, 2008, 2:22am »
Quote Quote Modify Modify

Keep two singly linked list, one goes in forward and one goes in reverse direction.
 
-- AI
IP Logged

Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
oriole
Newbie
*





   


Posts: 32
Re: Single and double linked list  
« Reply #2 on: Jun 29th, 2008, 4:27am »
Quote Quote Modify Modify

Oops that was too simple...
 
was thinking of doing it through a single link list  Sad
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Single and double linked list  
« Reply #3 on: Jun 29th, 2008, 7:19am »
Quote Quote Modify Modify

Keep two pointers, change every next pointer into a XOR of the two consecutive next pointers.
 
There should be a number of threads this has come up in; one of which is here.
(Success at using the search function may vary, but just in case you hadn't seen/tried it, I would like to point out it does exist, it's at the top of the page.)
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
oriole
Newbie
*





   


Posts: 32
Re: Single and double linked list  
« Reply #4 on: Jun 29th, 2008, 9:43am »
Quote Quote Modify Modify

on Jun 29th, 2008, 7:19am, towr wrote:
Keep two pointers, change every next pointer into a XOR of the two consecutive next pointers.
 
There should be a number of threads this has come up in; one of which is here.
(Success at using the search function may vary, but just in case you hadn't seen/tried it, I would like to point out it does exist, it's at the top of the page.)

 
 
Thanks towr..
I did tried to search but did not get any relevant links..
 
next time I'll try modifying my search string  
 Smiley
IP Logged
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2084
Re: Single and double linked list  
« Reply #5 on: Jun 30th, 2008, 7:57am »
Quote Quote Modify Modify

on Jun 29th, 2008, 9:43am, oriole wrote:
next time I'll try modifying my search string Smiley

It's also often helpful to extend the maximum search time.  The default is 365 days: I usually make it 3650 just because it's an easy change...
 
--SMQ
IP Logged

--SMQ

Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board