100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSC148 Exam Study Questions 2024 with Complete solutions (A Graded) $12.79   Add to cart

Exam (elaborations)

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

 0 view  0 purchase
  • Course
  • CSC148
  • Institution
  • CSC148

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

Preview 2 out of 7  pages

  • September 7, 2024
  • 7
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSC148
  • CSC148
avatar-seller
KenAli
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),

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller KenAli. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.79. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79035 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.79
  • (0)
  Add to cart