Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ===NODE===
- Node has a value:integer
- Node has a state:boolean
- Node has a Node-Reference next
- Node has a Node-Reference prev
- ===NODE-REFERENCE===
- A NodeReference is just a pointer to a Node
- ===LINKED-LIST===
- LinkedList has a Node-Reference head
- LinkedList has a Node-Reference tail
- LinkedList has a size-now:integer
- LinkedList has a size-min:integer
- LinkedList has Constructors:
- Default
- Creates an empty LinkedList and initializes 'head' and 'tail'
- Minimum Size
- Creates an empty LinkedList with a trivial minimum size
- Copy
- Creates a copy of another LinkedList
- LinkedList has Destructors:
- Default
- Frees all memory used by the LinkedList (each and every Node)
- LinkedList has Accessors:
- Size
- Returns the current count of Nodes
- Get
- Returns the value of a specific Node
- LinkedList has Mutators:
- Neutral:
- Setup
- Does operations common to all constructors
- Not truly necessary, but makes things simpler
- and more concise
- Constructive:
- Append
- Appends a value to the end of the LinkedList
- Special case:
- Append-Unused
- Appends an unused, gibberish Node to the LinkedList
- InsertAfter
- Inserts a value to come after a NodeReference given
- Expand
- Applies Append-Unused however many times is necessary
- Destructive:
- Trim
- Removes the last element
- Trim-Unused
- Removes all unused Nodes at the end of list, not exceeding size-min
- Remove
- Removes an arbitrary element
- Destroy
- Frees memory used by a NodeReference
Advertisement
Add Comment
Please, Sign In to add comment