Algorithms and Data Structures in an Object-Oriented Framework (“ADSOOF”)
Code for “Linked Lists” section
LispListA.java
An implementation of the abstract data type “Lisp list” by an
array of the same length and ordering.
LispListB.java
An implementation of the abstract data type “Lisp list” by a
linked list. Includes an equals
method.
LispList.java
An implementation of the abstract data type “Lisp list” by a
linked list, with a more efficient equals
method
than the one in LispListB
.
UseArrayListsLispLists.java
A program which creates and uses an object of Java's ArrayList
type with base type LispList<Integer>
(that is, an
arrayList of Lisp lists of integers). Shows Java's code for
ArrayList
relies on the base type having a correct
equals
method.
MyArrayList5
An implementation of arrayList by a linked list.
MyArrayList6.java
An implementation of arrayList by a linked list with a count of the size of the list.
MyArrayList7.java
An implementation of arrayList by a linked list with a count
of the size of the list and a pointer to the back cell.
MyArrayList8.java
An implementation of arrayList by a doubly linked list.
UseMyArrayLists5.java
Support code to demonstrate the use of an object using MyArrayList5.java
.
UseMyArrayLists6.java
Support code to demonstrate the use of an object using MyArrayList6
.
UseMyArrayLists7.java
Support code to demonstrate the use of an object using MyArrayList7
.
UseMyArrayLists8.java
Support code to demonstrate the use of an object using MyArrayList8
.
CellsAndPointers.java
Sets up two linked list data structures referenced by variables l1
and l2
,
where the lists are [a,b,c,d]
and [x,y]
respectively (they are linked lists
of characters).
UseLinkedLists.java
Support code enabling you to type in lists of integers in the standard
format used for Lisp lists, and access them directly as linked list data
structures. Includes a destructive and a constructive change method
as examples of methods which directly manipulate linked lists.
UseLinkedListsRec.java
As UseLinkedLists
, but has the change
methods implemented using
recursion rather than iteration.
UseLinkedListsStrings.java
Support code enabling you to type in lists of strings in the standard
format used for Lisp lists, which are sorted in alphabetical order and
then returned as a linked list data structure. Includes methods for
constructive and destructive insertion of a Comparable
object into an ordered linked list of Comparable
objects.
Last modified: 16 July 2019