Data Structure and Algorithm II Flashcards

1
Q

What are the key steps in problem solving?

A

Understand the problem.
Break it down.
Make a plan.
Execute the solution.
Look back to refine.

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

What is an algorithm?

A

A step-by-step set of instructions to solve a problem or perform a task.

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

What is pseudocode?

A

A high-level, human-readable description of an algorithm.

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

What is Bubble Sort?

A

A sorting algorithm that repeatedly swaps adjacent items if they’re in the wrong order.

Time Complexity: O(N²).

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

What is Selection Sort?

A

Finds the smallest item in the unsorted section and swaps it with the first unsorted item.

Time Complexity: O(N²).

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

What is Insertion Sort?

A

Builds a sorted section by inserting items one at a time.

Time Complexity: O(N²) average, O(N) best case (sorted array).

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

What is Merge Sort?

A

A divide-and-conquer algorithm that splits, sorts, and merges halves.

Time Complexity: O(N log N).

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

What is a Binary Search Tree (BST)?

A

A tree where:

Left child < Parent < Right child.

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

What are BST operations?

A

Insertion: Place value in the correct position.
Search: Traverse left or right to find the value.
Traversal Orders:
In-Order: Left → Root → Right (sorted order).
Pre-Order: Root → Left → Right.
Post-Order: Left → Right → Root.

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