Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!SHUM.HUJI.AC.IL!gadi From: gadi@SHUM.HUJI.AC.IL (Gad Aharoni) Newsgroups: comp.lang.misc Subject: Re: C's sins of commission Message-ID: <393@shum.huji.ac.il> Date: 15 Oct 90 11:10:54 GMT References: <387@shum.huji.ac.il> <65664@lanl.gov> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: shum!gadi@lilac.berkeley.edu (Gad Aharoni) Organization: The Hebrew University of Jerusalem Lines: 25 In article <65664@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >... Graphs are easy >to implement as recursive data structures without any user-visible >variable whose value is an address - that is to say: without explicit >pointers. Ok. Show me how you would implement a graph data structure without using pointers, and when I say pointers I also mean array indices. The only other way I can think of is to use the standard logic, or relational database technique of listing the dependencies. I am not too fond of this method of representing a graph because when a path in the graph is followed, the next node is not "at hand". When a list is followed the next element is always there, when following the right son of a tree, the subtree is there, at hand, immediatly accessible. In this method of representing a graph the next node has to be searched for in the table before the node is accessed. This is in fact simulating store, only without the advantage of immediate access. Gadi -- Gad Aharoni TEL: +972-2-584932 BITNET: gadi@humus.bitnet CSNET & INTERNET: gadi@humus.huji.ac.il Snail: Dept. of CS, Hebrew University of Jerusalem, Jerusalem 91904, Israel