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 Questions 2024 with Complete solutions (A Graded)

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

CSC148 Exam Study Questions 2024 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
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CSC148 Exam Study Questions 2024 with
Complete solutions (A Graded)

Huffman's algorithm - ANSWER used to organize the file compression by giving short codes to
frequent symbols and longer codes to infrequent symbols


byte - ANSWER an integer in the range 0-255


searching with sorted vs unsorted list - ANSWER unsorted : O(n)
sorted: log2(n) ( log(n)



general tree with n items insert, delete. - ANSWER insert can be fast, if you insert as a child of
the root - O(1), search and delete can be slow since you might need to check every item in the
tree - o(n) in the worst case



search efficiency in a BST: - ANSWER BST with n nodes has height logn and insert/delete/search
time of O(n) , if BST is balanced then it takes logn node accesses.



Python interpreter, java compiler, and pycharm and pythonTA - ANSWER -a program that
runs python code


-java compiler is a program that turns java code into a sequence of "Primitive instructions"
Pycharm and pythonTA are programs that analyze Python code and report potential problems

, Expressions vs statements - ANSWER Expression is a unit of code that, when evaluated
produces a single value, a statement is more general: evaluating a statement can produce a
value, or has some other effect.


EVERY expression is a statement, but not vice-versa!


Variable environment - ANSWER a map from variable names to values



Evaluating an Assign and consolidation - ANSWER name.evaluate-look up the variable name in
the current environment


evaluating an assign mutates the env


Assign.evaluate add a new variable binding to the current environment (mutates env)


Module - ANSWER a class that represents an entire Python program. Its
body is a list of statements



Sorting and the times, bubble, selection, insertion, quick, radix, merge? - ANSWER bubble ->
n^2, selection also n^2, insertion too, n^2



How does quicksort work? - ANSWER randomly select a pivot point, split list such that all
elements to the left are lower than P and all to the right are higher, then repeat the same
idea for the two partitions



Complexities of quicksort runtime - ANSWER If we always choose a pivot thats around median,
then the two partitians are about equal and the runtime is (nlog(n)), if we choose one that's
always min/max we get O(n^2),

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