Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!bloom-beacon!athena.mit.edu!eichin From: eichin@athena.mit.edu (Mark W. Eichin) Newsgroups: comp.lang.c Subject: Re: XOR-trick and PUZZLE (was comma-operator) Summary: Use it for redundancy Keywords: BYTE xor files Message-ID: <2484@bloom-beacon.MIT.EDU> Date: 23 Jan 88 21:19:44 GMT References: <269@vsi1.UUCP> <226@goofy.megatest.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: eichin@athena.mit.edu (Mark W. Eichin) Organization: Mercury, Io and Titan Lines: 20 In article <226@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: >PUZZLE for those lucky enough not to have seen it previously: > >How can you use the XOR trick to keep a doubly linked list, using only >one field for in each record, to code for finding both the following and >the previous record? I recall seeing an article in BYTE about five years back on using this for a floppy disk file management technique... I think the suggestion was to keep it as an extra pointer to recover from, but from a given record you could always find the `next' record. Anybody recall the reference in more detail? Mark Eichin SIPB Member & Project Athena ``Watchmaker'' Mark Eichin SIPB Member & Project Athena ``Watchmaker''