Shared Flashcard Set

Details

CS228 IOWA STATE FINAL
N/A
17
Computer Science
Undergraduate 2
05/08/2014

Additional Computer Science Flashcards

 


 

Cards

Term
recursive preorder
Definition
(prints top down from left to right)
print
left
right
Term
recursive postorder
Definition
(prints largest to smallest)
left
right
print
Term
recursive inorder
Definition
(prints smallest to largest)
left
print
right
Term
top down binary tree
Definition
add elements on each level
Term
postfix to infix
Definition
pop top and goes right (unless ^)
Term
infix/postfix Big O
Definition
O(n)
Term
binary search Big O
Definition
O(logn)
Term
heap sort Big O
Definition
O(nlogn)
Term
quicksort Big O
Definition
O(n^2)
Term
mergesort Big O
Definition
O(nlogn)
Term
selection sort Big O
Definition
O(n^2)
Term
insertion sort Big O
Definition
O(n^2)
Term
BFS and DFS Big O
Definition
O(n+m)
n=# nodes
m=# edges
Term
BFS creation uses
Definition
Queues
Term
DFS creation uses
Definition
Stacks
Term
Big O of:
int n = arr.length;
int limit = n * n;
for ( int k = 0; k < limit; k += 2 )
{
int t = 1;
for ( j = limit - 1; j > 0; j /= 2 )
Definition
O(logn)
Term
Write the heading of the Pair class with the type parameters E and F, where the type E may inherit the compareTo() method of the Java Comparable interface from its supertype or may implement the compareTo() method itself. The Pair class implements Comparable>. Declare two private reference variables one of type E and two of type F.
Definition
public class Pair, F> implements Comparable> { private E one; private F two;
Supporting users have an ad free experience!