1/495
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Abstract class
A "partial" or "incomplete" class that contains bodies for some but (typically) not all of the methods of the interfaces it claims to implement
Method bodies that can be written once— and work for any implementation of NaturalNumberKernel because they are programmed to that interface—have been factored out into an abstract class
No - You can't use an abstract class like a normal class and create objects from it
Unit under testing
"Re-route" all UUT constructor calls to another method, which then calls the UUT constructor, so only the body of that one method needs to be changed to accommodate a different UUT
Kernel class that directly represents the new type using a component from Java libraries
There is a distinct variable (with the same name) for each instance of the class in which it is declared
Sequence represented as 2 stacks, left and right. Sequence = rev(left) + right
Representation of sequence is 2 stacks "facing each other" in the middle of sequence
Mathematical models, method contracts
Kernel interface shows WHAT the software does
Data representation, algorithms
Kernel class shows HOW the software does it
The set of all possible math model values as seen by the client
The set of all possible math model values of the data representation
How to interpret any concrete value (that satisfies the representation invariant) as an abstract value?
@correspondence
What configurations of values of the instance variables can arise?
@convention
False
False
False
True
False
True
True
True
Any type whose abstract mathematical model involves: string, set, multiset, tree, binary tree
Array, queue, set, sequence, stack, map, sorting machine
-Direct access
-Constant time access (regardless of length)
-Fixed size; can run out of room
-Fixed size; initialization might be expensive if entries go unused
-Adding/removing entires in the middle requires moving other entries, which is slow
A contiguous block of memory locations with consecutive memory addresses so the memory address of the entry at index i can be directly calculated from the memory address of the first entry, by using simple arithmetic
Java Virtual Machine
-Can be empty tree
-Or can be non-empty tree consisting of root node and 2 subtrees
-Mathematical type: Binary trees with any label of type T
A binary tree where the left node < root, and right node > root
-Allows adding elements of type T to a
collection of such elements, and then removing them one at a time in sorted order
-Mathematical model: 3-tuple
{insertion_mode: boolean,
ordering: binary relation on T,
contents: finite multiset of T}
-If all elements are already sorted by the end of "changeToExtractionMode", then there is no difference in performance
-If elements are not already sorted by the end of "changeToExtractionMode", then the performance advantage is that you don't need to remove all the elements
False
False
False
True
2 references per node: one to the "next" node and one to the "previous" node