Midterm Review Flashcards

1
Q

Arrays

A

Linear lists which use contiguous memory and are usually homogenous.
Operations are limited to its structure.
Can be used to implement different types of lists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List Operations

A

Insert, Delete, Update, Read

Search, Reorder, Resize, Rules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Stacks

A

Structures that use the LIFO approach. Elements can only be pushed onto or popped from the top of the stack.
Peek operation may give access to top without modifying the stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Overflow

A

When a stack is full and does not contain enough space to accept new values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Stack Operations

A

Push() - add to top
Pop() - remove from top
Peek() - look at top
isFull() - check for overflow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Singly Linked List

A

Can be traversed in one direction (head to tail).

Each node contains a pointer to the next node (null if none).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Linked List Operations

A

addNode() - add new after current

deleteNode() - delete current (none if null)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Queue

A

A list that grows by adding to its tail and shrinks by removing from its head and is a FIFO structure which operates similar to stacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Queue Operations

A
Clear - clear queue
Enqueue - add to tail
Dequeue - remove from head
Peek - return first element without removing
isEmpty - check if anything in queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Insertion Sort

A

Consider first 2 and swap if needed.

For every following element, place in proper position.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Bubble Sort

A

Swap adjacent elements (if wrong order) and reduce inspected elements by 1 for each pass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Selection Sort

A

Find lowest and place in front. Find next and place next to front, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Merge Sort

A
  1. Divide: if input small enough use straightforward method, otherwise divide into subsets
  2. Recur: recursively solve subproblems in subsets
  3. Conquer: take solutions and merge into full solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Quick Sort

A
  1. Divide: select a specific element to be pivot and store in 3 sequences - less than, equal to, and greater than (LEG)
  2. Recur: recursively sort L and G
  3. Conquer: order by inserting L then E then G
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Specialization

A

A specific version of a templated function AKA generated function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Generic Class

A

A class that defines all the algorithms used by that class; however, the actual type of the data being manipulated will be specified as a parameter when objects of that class are created.