2024-DSA-Course Preparation
2024-DSA-Course Preparation
15
Algorithm Efficiency
1. What is algorithm? Give some examples of algorithm in real-
world/life. How can an algorithm be represented?
2. What are the characteristics of algorithm?
3. How can we compare the time factor (speed) of two or more
algorithms for the same problem?
4. What is Big-O notation? What is growth rate function? List of the
common growth rate functions.
5. What is best-case scenario? worst-case? average case?
16
1
Sorting Algorithms
1. What are the purposes of sorting?
2. Give some applications of sorting (i.e., the problems can be solved
MORE efficiently using sorting)
3. Some terms:
• internal sorting, external sorting.
List some of the sorting algorithms for each category. Why do
people have to divide into two groups?
• stable/un-stable, in-place
• comparison-based, non-comparison-based sorting algorithms.
17
Sorting Algorithms
For each sorting algorithm:
1. What is/are the main idea(s)? Can we get the main ideas from the
name of the algorithm?
2. How it works. (You can demonstrate step-by-step the algorithm
when given a collections of elements, e.g, integer elements)
3. Analyzing the algorithm
4. Strength(s) (Advantages)
5. Weakness(es) (Disadvantages)
18
2
Tree Structures
1. Terminologies: Node, Root, Leaf, Parent, Child, Degree/Order,
Height, Level/Depth,…
2. (General) Tree traversal: Pre-order, Post-order, In-order. Give
specific application(s) of each traversal method.
3. Binary and other kinds of binary trees (perfect binary tree, complete
binary tree, full binary tree)
4. Search trees (Binary search tree, M-way search tree)
5. Balanced tree(s): AVL tree, (AA tree, Red-black tree), 2-3 tree, 2-3-4
tree, B-tree
19
Graph Structures
• Definitions/Terms
• Ways of representing graph(s): adjacency matrix, adjacency list,
edge list
• Graph traversal: Depth first search (DFS), Breadth first search (BFS)
• Spanning tree, Minimum spanning tree. (Prim's)
• Shortest path(s): (Dijikstra's)
• Topological sorting
20
3
Hashing and Hash Tables
1. What is hash table? What can it be used for?
2. Hashing and its applications?
3. What is hash function? Describe some of the hash functions.
4. Collision? How to resolve the collision?
• Resolving techniques (open-hashing, closed-hashing):
• Separate chaining
• Open addressing (linear probing, quadratic probing, double hashing)
21