Term
|
Definition
| An object encapsulates state and behavior |
|
|
Term
|
Definition
A class such as ArrayList that takes a type parameter to indicate what kind of values will be used.
An object in java that accepts another type as part of itself |
|
|
Term
|
Definition
| A class that "wraps" primitive data as an object |
|
|
Term
|
Definition
| An automatic conversion from primitive data to a wrapped object of the appropriate type (e.g. an int boxed to form an Integer) |
|
|
Term
|
Definition
| An automatic conversion from a wrapped object to its corresponding primitive data (e.g. an Integer unboxed yields an int) |
|
|
Term
|
Definition
| A well-defined procedure for deciding, given a pair of values, the relative order if the two values |
|
|
Term
|
Definition
| The order imposed on a type by its comparison function |
|
|
Term
|
Definition
| An object that stores a group of othert objects, called its elements |
|
|
Term
|
Definition
A collection that stores a list of elements in small object containers called nodes, which are linked together.
Strengths: excells in add/removes
Weaknesses: No random access
|
|
|
Term
|
Definition
| An object that allows you to efficiently retrieve the elements of a list in sequential order |
|
|
Term
|
Definition
A specification of a type of data and the operations that can be performed on it.
|
|
|
Term
|
Definition
| A collection that stopres a group of elements and prevents duplicates and can be searched efficiently |
|
|
Term
|
Definition
| A collection that associates objects called keys with objects called values in wghich each key is associated with a corresponding value. |
|
|
Term
|
Definition
| A programming technique in which you describe actions to be repeated using a loop |
|
|
Term
|
Definition
| A programming technique in which you describe actions to be repeated using a method that calls itself |
|
|
Term
|
Definition
| A case that is so simple it can ber solved directly without a recursive call. |
|
|
Term
|
Definition
| A case that involves reducing the overall problem into a simpler problem of the same kind that can be solved by a recursive call. |
|
|
Term
|
Definition
| The internal structure that keeps track of the sequence of methods that have been called. |
|
|
Term
|
Definition
| A programming technique in which a derived class extends the functionality of a base case, inheriting all of its state and behavior |
|
|
Term
|
Definition
| The parent class in an inheritance relationship |
|
|
Term
|
Definition
| A child class in an inheritance relationship |
|
|
Term
|
Definition
| To implement a new version of a method to replace code that would otherwise have been implemented from a superclass. |
|
|
Term
|
Definition
| The ability for the same code to be used with several different types of objects and behave differently depending on the actual type of object used. |
|
|
Term
|
Definition
| The ability or ab object of a subclass to be used succesfully anywhere an object of the superclass is expected. |
|
|
Term
|
Definition
A connection between two objects where one has a field that refers to the other. The contained object acts as part of the containing objects state.
|
|
|
Term
|
Definition
| A set of methods that classes can promise to implement, allowing you to treat those classes similiarly in your code. |
|
|
Term
|
Definition
| A method that is declared (as an interface) but not implemented. Abstract methods represent the behavior a class promises to implement when it implemements an interface. |
|
|
Term
| Object-Oriented Design (OOD) |
|
Definition
| Modeling a program or system as a collection of cooperating objects, implemented as a set of classes using class hierarchies |
|
|
Term
|
Definition
| A java class cannot be instantiated, but instead serves as a superclass to hold common code and declare abstract behavior. |
|
|
Term
| What is the difference between the "client view" and the "implementer view"? |
|
Definition
| External client view is the "what" part and the implementer view is the "how" part. |
|
|
Term
| What method is called in the ArrayList class to dynamically include new items? |
|
Definition
|
|
Term
| In the ArrayList class describe the use of the contains() method |
|
Definition
| returns TRUE if a given element is in the list |
|
|
Term
| What method is called in the ArrayList class to dynamically eliminate items |
|
Definition
|
|
Term
| In the ArrayList class describe the use of the size() method |
|
Definition
| returns the number of elements |
|
|
Term
What is the problem with the following code:
for (String s:Words)
{
if (s.equals("hello"))
{
Words.add("goodbye");
}
} |
|
Definition
You cannot change the list in any way while iterating through it with the "for each"
|
|
|
Term
What is the problem with the following code:
ArrayList numbers = new ArrayList();
|
|
Definition
| The "int" cannot be primitive types, must be objects! i.e. "Integer" |
|
|
Term
| Which interface is used to implement object comparison? |
|
Definition
Comparable
???? NEED MORE INFO ??? |
|
|
Term
| What is the name of the frameworkk that is largely contained in the package java.util |
|
Definition
| Java Collections Framework |
|
|
Term
|
Definition
| A collection where elements are removed in the order they were added (FIFO) |
|
|
Term
|
Definition
| An ordered collection of elements accessed by integer indexes |
|
|
Term
|
Definition
| A collection where the last element added is the first one to be removed |
|
|
Term
| 12 methods of the Collection interface |
|
Definition
- add(element)
- addAll(collection)
- clear()
- contains()
- containsAll()
- isEmpty()
- iterator()
- remove(element)
- removeAll(collection)
- retainAll(collection)
- size()
- toArray()
|
|
|
Term
| 3 Methods of Iterator Objects |
|
Definition
|
|
Term
|
Definition
- random access: an element can be accessed quickly
- adding and removing at the end of the list is fast
|
|
|
Term
|
Definition
- adding and removing at either end is fast
- fast add/remove suring a sequential access with an iterator
- no need to expand an array when full
- can be more easily used as a queue
|
|
|
Term
| 11 Useful static methods of Collections class |
|
Definition
- binarySearch(list,value)
- copy(destinationList, sourceList)
- fill(list,value)
- max(list)
- min(list)
- replaceAll(list,oldValue,newValue)
- reverse(list)
- rotate(list,distance)
- shuffle(list)
- sort(list)
- swap(list,index1,index2)
|
|
|
Term
| 2 Strengths of the HashSet |
|
Definition
- extremely fast performance for add, contains, remove
- can be used with any type of objects as its elements
|
|
|
Term
2 Strengths of the TreeSet
|
|
Definition
- elements are stored i sorted order
- must be used with elements that can be compared.
|
|
|
Term
|
Definition
- union -- addAll
- intersection -- retainAll
- difference -- removeAll
- superset,subset -- containsAll
|
|
|
Term
| 11 useful methods of Maps |
|
Definition
- clear()
- containsKey(key)
- containsValue(value)
- get(key)
- isEmpty()
- keySet()
- put(key,value)
- putAll(map)
- remove(key)
- size()
- values()
|
|
|
Term
Comparison of ADT and interface name
Lists: What are the 2 implementations? |
|
Definition
|
|
Term
Comparison of ADT and interface name
Set: What are the 2 implementations?
|
|
Definition
|
|
Term
Comparison of ADT and interface name
Map: What are the 2 implementations?
|
|
Definition
|
|
Term
Comparison of ADT and interface name
List: What is(are) weaknesses? (2)
|
|
Definition
| slow to search,slow to add/remove arbitrary elements |
|
|
Term
Comparison of ADT and interface name
Set: What is(are) weaknesses? (2)
|
|
Definition
| does not have indexes; cannot retrieve arbitrary elements from it |
|
|
Term
Comparison of ADT and interface name
Map: What is(are) weaknesses? (2)
|
|
Definition
| not a general purpose collection; cannot easily map backward from a value to its key |
|
|
Term
|
Definition
| must use Comparable interface |
|
|
Term
|
Definition
| A hierarchical connection between two categories where one type can be treated as a specialized version of the other |
|
|
Term
|
Definition
| A set of hiearchical relationships between classes of objects |
|
|
Term
| What is the purpose if the binarySearch(list value) method of the Collections class? |
|
Definition
| quickly searches a sorted list and returnes the element its index |
|
|
Term
|
Definition
| The task of attempting to find a particular target value in a collection or an array. |
|
|
Term
|
Definition
| The task of arranging the elements of a list or an array into natural ordering |
|
|
Term
| CH 13| A Comparator object... |
|
Definition
| describes a customized way to compare objects, enabling arrays or lists of these objects to be searched and sorted in many orders |
|
|
Term
|
Definition
| The technique of running a program or algorithm to determine it's runtime. |
|
|
Term
| CH 13| Algorithm Analysis: |
|
Definition
| the technique of examining an algorithm's code or pseudocode to make inferences about its efficiency. |
|
|
Term
|
Definition
| An O(N) searching algorithm that looks at every elemement of a list until the target is found. |
|
|
Term
|
Definition
is an O(log N) searching algorithm that operated on a sorted dataset and sucessively eliminates half of the data until the target element is found.
|
|
|
Term
|
Definition
| Selection sort is an O(N^2) sorting algorithm that repeatedly finds the smallest unprocessed element of the array and moves it to the frontmost remaining slot in the array |
|
|
Term
|
Definition
| Merge sort is an O(N log N) sorting algorithm often implemented recursively, that sucessively divides the dataset into two halves, recursive soorts the halves, and then merges the sorted halves into a sorted whole. |
|
|
Term
|
Definition
| A measure of the computer resources used by a piece of code such as time, memory, or disk space. |
|
|
Term
|
Definition
| A category of algortih efficiency based upon the algorithm's relationship to the input data size. |
|
|
Term
| CH 13| Constant-time Complexity Class |
|
Definition
| O(1) - Those whose runtimes dont sepend on the input size such as code to convert a value from Farenheit to celcius |
|
|
Term
| CH 13| Logarithmic or O(log N) Complexity Class |
|
Definition
| Algorithms that typically divide a problem space in half repeatedly until the problem is solved. Binary search is an example. |
|
|
Term
|
Definition
| algorithms are those whose runtimes are directly proportional to N... i.e. rouchly double when N doubles. |
|
|
Term
| CH 13| Log Linear or O(N log N) |
|
Definition
| algorithms typically perform a combination of log and linear operations, such as executing a log function over every element of a dataset of size N. Many efficient sorting algoithms, such as merge sort are log-linear |
|
|
Term
| CH 13| Quadratic of O(N^2) |
|
Definition
| alg. are those whose runtimes are proportional to the square of the the input size. This means that quardatic alg. runtimes roughly quadruple when N doubles, |
|
|
Term
|
Definition
| alg. are those whose runtimes are proportional to the cube of the input size. |
|
|
Term
| CH 13| Exponential or O(2^N) |
|
Definition
| alg are those whose runtimes are proportional to 2 raised to the power of the input size. This means if the input size increases by just one, the algo. will take twice as long to execute. |
|
|
Term
|
Definition
| A graphical window on a screen |
|
|
Term
|
Definition
| A widget, such as a button or a text field, that resides inside a graphical window |
|
|
Term
|
Definition
| A Java object that decides the positions, sizes, and resizing behavior of the components within a frame or other container on the screen |
|
|
Term
|
Definition
| An object representing a user's interaction with a GUI component, which can be handled by your programs to create interactive components. |
|
|
Term
|
Definition
| An object the is notified when an event occurs and executes code to respond to that event. |
|
|
Term
|
Definition
| A layered layout using several layout managers in different nested containers |
|
|