Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!bionet!agate!saturn!ssyx.ucsc.edu!sirkm From: sirkm@ssyx.ucsc.edu (Greg Anderson) Newsgroups: comp.sys.mac.programmer Subject: Text editor data types (Was: Serious programming question) Message-ID: <9492@saturn.ucsc.edu> Date: 23 Oct 89 21:13:57 GMT References: <89295.142753CXT105@PSUVM.BITNET> <4002@helios.ee.lbl.gov> Sender: usenet@saturn.ucsc.edu Reply-To: sirkm@ssyx.ucsc.edu (Greg Anderson) Organization: UC Santa Cruz; Division of Social Sciences Lines: 17 In article <4002@helios.ee.lbl.gov> beard@ux1.lbl.gov (Patrick C Beard) writes: >In article <89295.142753CXT105@PSUVM.BITNET> CXT105@PSUVM.BITNET (Christopher Tate) writes: >I've thought about this a bit, though I've not gotten around to implementing >it. The solution that seems the most flexible is a doubly linked list of >lines (or paragraphs if you prefer). > >This is an interesting topic. What have others done? I did something similar, but kept the lines in a B-tree instead of a linked list. That way any line may be accessed in O(ln N) time instead of O(N), and insertions/deletions are still easy. I could put this code up for anonymous ftp if anyone was interested. ___\ /___ Greg Anderson ___\ /___ \ \ / / Social Sciences Computing \ \ / / \ /\/\ / University of California, Santa Cruz \ /\/\ / \/ \/ sirkm@ssyx.ucsc.edu \/ \/