Exam 1 Flashcards
Ch. 11-14
The efficiency of an algorithm is usually expressed in terms of its use of __________ ____.
processing time
The _______ __ ___________ involves categorizing an algorithm in terms of efficiency.
analysis of algorithms
For every algorithm we want to analyze, we need to define the ____ of the problem
size
For a searching algorithm, the size of the problem is the size of the _________ ____
searching pool
For a sorting algorithm, the size of the problem is the ______ __ ________ to be sorted
number of elements
CPU processing time
time complexity
memory space
space complexity
A ______ ________ shows the relationship between the size of the problem (n) and the value optimized (time).
growth function
__________ __________ is based on the dominant term of the growth function - the term that increases most quickly as n increases
Asymptotic complexity
Asymptotic complexity is called the _____ of the algorithm
order
We say that an algorithm is order n^2 which is written ____
O(n^2)
Processor speed and memory ______ make up for the differences in efficiency of algorithms.
cannot
As n increases, the various growth functions diverge ____________
dramatically
nested loops: multiply the complexity of the _____ ____ by the complexity of the _____ ____
outer loop; inner loop
to analyze loop execution: first determine the order of the ____ of the loop, then multiply that by the _____ __ _____ the loop will execute
body; number of times
We can use _________________ to measure elapsed execution time in Java
System.nanoTime()
A __________ is an object that holds and organizes another object. It provides operations for accessing and managing its elements
collection
Some collections are ______ in nature, others are _________
linear; non-linear
A linear collection is one in which the elements of the collection are organized in a ________ ____
straight line
A nonlinear collection is one in which the elements are organized in something other than a straight line such as _________ or a network
hierarchy
An ___________ hides details to make a concept easier to manage
abstraction
A collection is an abstraction that defines the
_____________ operations through which the
user can manage the objects in the collection.
interface
The interface hides (_______________) the object’s data and the implementation of the
operations.
encapsulates
A
_________________ is a group of values and the operations defined on those values.
data type
A
__________________________ is the set of programming constructs and techniques
used to implement a collection.
data structure
An
_______________________________ (ADT) is a data type that is not pre-defined in the
programming language.
abstract data type
A class that uses a collection interacts with it through a particular _______________
interface