Vermiculus

Linked List System

Feb 16th, 2012
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. ===NODE===
  2. Node has a value:integer
  3. Node has a state:boolean
  4. Node has a Node-Reference next
  5. Node has a Node-Reference prev
  6.  
  7. ===NODE-REFERENCE===
  8. A NodeReference is just a pointer to a Node
  9.  
  10. ===LINKED-LIST===
  11. LinkedList has a Node-Reference head
  12. LinkedList has a Node-Reference tail
  13. LinkedList has a size-now:integer
  14. LinkedList has a size-min:integer
  15.  
  16. LinkedList has Constructors:
  17. Default
  18. Creates an empty LinkedList and initializes 'head' and 'tail'
  19. Minimum Size
  20. Creates an empty LinkedList with a trivial minimum size
  21. Copy
  22. Creates a copy of another LinkedList
  23. LinkedList has Destructors:
  24. Default
  25. Frees all memory used by the LinkedList (each and every Node)
  26.  
  27. LinkedList has Accessors:
  28. Size
  29. Returns the current count of Nodes
  30. Get
  31. Returns the value of a specific Node
  32.  
  33. LinkedList has Mutators:
  34. Neutral:
  35. Setup
  36. Does operations common to all constructors
  37. Not truly necessary, but makes things simpler
  38. and more concise
  39. Constructive:
  40. Append
  41. Appends a value to the end of the LinkedList
  42. Special case:
  43. Append-Unused
  44. Appends an unused, gibberish Node to the LinkedList
  45. InsertAfter
  46. Inserts a value to come after a NodeReference given
  47. Expand
  48. Applies Append-Unused however many times is necessary
  49. Destructive:
  50. Trim
  51. Removes the last element
  52. Trim-Unused
  53. Removes all unused Nodes at the end of list, not exceeding size-min
  54. Remove
  55. Removes an arbitrary element
  56. Destroy
  57. Frees memory used by a NodeReference
Advertisement
Add Comment
Please, Sign In to add comment