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

CSC148 Exam Study Guide Questions with Complete solutions (A Graded

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
07-09-2024
Written in
2024/2025

CSC148 Exam Study Guide Questions with Complete solutions (A Graded

Institution
CSC148
Course
CSC148









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

Written for

Institution
CSC148
Course
CSC148

Document information

Uploaded on
September 7, 2024
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CSC148 Exam Study Guide Questions with
Complete solutions (A Graded)
depth of a nested list - ANSWER the maximum number of times a list is nested inside other lists


partial tracing - ANSWER -> trace the base case
-> trace the recursive step while assuming it will return the correct answer



design recipe for recursive functions - ANSWER -> determine the recursive structure of the
input, then use an appropriate code template
-> implement code for base cases


a tree is either - ANSWER empty or has a root value, or subtrees


size of a tree - ANSWER the total number of values in a tree


a leaf - ANSWER a value with no subtrees


height of subtree - ANSWER longest path from root to one of its leaves


children of a value - ANSWER all values directly connected underneath that value


descendants of a value - ANSWER all values beneath the value


parent - ANSWER value immediately above & connected to a value

, ancestors - ANSWER all values that come before a value



preconditions for trees - ANSWER if root is none, the tree is empty
if root is none then subtrees is empty



error that is encountered when we delete a value by promoting its subtrees - ANSWER if that
value is a leaf, then we create an empty subtree - which is not allowed



binary search tree - ANSWER every item is greater than all items in its left subtree and less than
all items in its right subtree


binary search tree structure - ANSWER if root is none, left and right are none


if root is not none, left and right are either noneor a tree


pre-order traversal - ANSWER dealing with the root before its subtrees


post order traversals - ANSWER processing the root after its subtrees


what abstract data type is a tree - ANSWER multiset


a tree of height h can have at least how many items - ANSWER 2^h - 1



range of size of a binary search tree - ANSWER at largest -> n
smallest -> log(n)


run time of sorted list | search, insert, delete - ANSWER search: worst case is O(logn)

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.
KenAli West Virginia University
View profile
Follow You need to be logged in order to follow users or courses
Sold
84
Member since
1 year
Number of followers
5
Documents
17177
Last sold
1 week ago

2.9

19 reviews

5
4
4
4
3
4
2
0
1
7

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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Frequently asked questions