CS2400 M5 Flashcards
List
A collection of same-type data in order.
Items may be added anywhere.
List methods
*getLength
isEmpty
add(entry)
*add(pos, entry)
*remove(pos)
*replace(pos, newEntry)
clear
*getEntry(pos)
contains(entry)
toArray
What is JavaDoc
JavaDoc is a file created upon executing the generation program. It creates documentation for your code based on the notation you made.
List vs bag
List is ordered and 2D, with position and entry values
JUnit
A test program that tests the implementation of a method.
LinkedList add
Cases
1: empty list
2: add to beginning
3: add to middle
4: add to end
Head vs tail reference
A reference to firstNode as well as lastNode, to increase method efficiency. Allows some methods to go from O(n) to O(1)
List vs stack
Spatial order vs reverse chronological order. In a stack, you can only access the most recent addition.
Program stack
Java stack is a stack of activation records. Contains arguments, local variables, and reference.