100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CS 101 FINAL EXAM QUESTIONS & ANSWERS

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
10-12-2025
Written in
2025/2026

CS 101 FINAL EXAM QUESTIONS & ANSWERS

Institution
CS 101
Module
CS 101









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CS 101
Module
CS 101

Document information

Uploaded on
December 10, 2025
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CS 101 FINAL EXAM QUESTIONS & ANSWERS

worst time complexity for min/max heap - Answer -O(1)

worst time complexity for inserting/deleting from heap - Answer -O(log n)

worst time complexity for queues and queue functions (ex. enQueue, deQueue): -
Answer -O(1)

worst time complexity for heapsort - Answer -O(n log n)

worst time complexity for inserting/deleting in Binary Search Tree: - Answer -O(n)

worst time complexity for push/pop on stack (array implementation) - Answer -O(1)

worst time complexity for inserting in hash table - Answer -O(n)

goal time complexity for inserting in hash table - Answer -O(1)

Binary Search Tree pre-order - Answer -root, left, right

Binary Search Tree post-order - Answer -left, right, root

Binary Search Tree in-order - Answer -left, root, right

enQueue() - Answer -adds new node after rear and moves rear to next node

deQueue() - Answer -removes front node and moves front to next node

parent equation for a 0 indexed heap - Answer -(i-1) / 2

left child equation for a 0 indexed heap - Answer -2i + 1

right child equation for a 0 indexed heap - Answer -2i + 2

where in memory is a pointer stored - Answer -the runtime stack

where in memory is an object stored - Answer -the heap

a good hash function should: - Answer -spread the input values over the range of
integer outputs

which operation do hash tables not support efficiently: - Answer -sorting

which operation do min ordered heaps not support efficiently: - Answer -search

, Huffman codes will provide the most benefit when: - Answer -there is a skewed
distribution of characters

(T or F) After an exception is thrown and a catch block executes, execution resumes
after the throw statement. - Answer -false

(T or F) For a function that may contain a throw, the function's statements must be
surrounded by a try block. - Answer -false

(T or F) A key advantage of a class template is relieving the programmer from having to
write redundant code that differs only by type. - Answer -true

(T or F) The big three functions for classes include a destructor, copy constructor, and
default constructor. - Answer -false

What is the minimum height of a BST with 10,000 nodes? - Answer -height = log base
2 (n)
height = log base 2 (10,000)
height = 13.28
= 13

Assuming "myClass prevObj" has already been declared, which special member
function will be called by the statement "myClass obj2 = prevObj;"? - Answer -Copy
Constructor

How many steps does it take to build a BST, via repeated insertion? - Answer -O(n^2)

The worst-case to grow the size of a dynamic array by 1 is _____ steps? - Answer -
O(n)

The amortized cost to grow the size of a dynamic array by 1 is _____ steps? - Answer -
O(1)

What is the time complexity of this code fragment?
for (J=n; J>0; J /= 2)
for (K=0; K<J; K++)
sum += K; - Answer -O(n)

What is the time complexity of this code fragment?
for (K=0; K< n; K=K+2)
sum += K; - Answer -O(n)

What is the time complexity of this code fragment?
for(i = 1; i < (n*n); i *= 2)
cout << i; - Answer -O(log n)

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GEEKA YALA UNIVERSITY
View profile
Follow You need to be logged in order to follow users or courses
Sold
2001
Member since
3 year
Number of followers
1445
Documents
47105
Last sold
1 day ago

3.8

342 reviews

5
170
4
61
3
44
2
16
1
51

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions