On 9.3.20 12:02, Ahem A Rivet's Shot wrote:
> On Mon, 09 Mar 2020 07:32:28 GMT
> Jan Panteltje wrote:
>
>> Nice, I like linked lists.
>
> All right time to share an ancient hack (that I actually used once).
>
> You have a single linked list which you wish was a double linked
> list but due to resource limits you can't simply create a double linked
> list and copy the data you have to convert it in place without using any
> extra space. How ? (You may assume the list uses integers as pointers).
> .
> thinking space
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> .
> Instead of 'next' the pointer field contains 'next xor previous'
> provided you know where you came from 'last' you go to 'last xor pointer'
> to continue in the same direction.
That was used in Data General's disk systems for sequential file
block linkage.
--
-TV
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|