CSCI 2410 Data Structures and Algorithms
Armstrong Atlantic State University
Instructor: Y. Daniel Liang
Total (41 pts)
0. (3 pts)
Given f(n) = 5n3 + 8n2, answer the following questions:
1. Is f(n) O(n2)? no
2. Is f(n) O(n3)? yes
3. Is f(n) O(n4)? yes
4. Is f(n) Ω(n2)? yes
5. Is f(n) Ω(n3)? yes
6. Is f(n) Ω(n4)? no
7. Is f(n) Θ(n2)? no
8. Is f(n) Θ(n3)? yes
9. Is f(n) Θ(n4)? no
1. (3 pts)
Suppose you need to store a list of elements, if the number
of elements in the program is fixed, what data structure
should you use? (array, ArrayList, or LinkedList)
If you have to add or delete the elements at the beginning
of a list, should you use ArrayList or LinkedList?
If most of operations on a list involve retrieving an
element at a given index, should you use ArrayList or
LinkedList?
2. (3 pts) Show the BST after inserting 35, 85 and 103.
A: