100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSE 2050 Exam 2 Vocab Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution CA$11.45   Add to cart

Exam (elaborations)

CSE 2050 Exam 2 Vocab Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution

 4 views  0 purchase
  • Course
  • Institution

CSE 2050 Exam 2 Vocab Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution

Preview 2 out of 5  pages

  • June 24, 2024
  • 5
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
avatar-seller
CSE 2050 Exam 2 Vocab
recursion - ANS-when a function calls itself

induction - ANS-checking if something is true by going from specific examples to the
general fact

basic rules for a recursive algorithm - ANS-1. base case
2. each recursive call should move towards the base case

golden ratio - ANS-kth fibonacci sequence (1.618)

what is the input and output for euclid's algorithm? - ANS-input: pair of integers
output: greatest common divisor

division - ANS-iterated subtraction

dynamic programming - ANS-an approach to writing algorithms in which a problem is
solved using solutions to the same problem on smaller instances

greedy - ANS-add the largest value until you are done

memoization - ANS-optimization technique used to speed up computer programs by
storing the results of function calls and returning that stored value when the same input
happens again

what is the major difference between dynamic programming and memoization? -
ANS-dynamic programming builds results from the bottom up
memoization builds results from the top down

subsequence - ANS-string t is a ______ of string s if all the characters of t appear in s in
the same order

ex: s = axxxbxxxc
t = abc

t is a ______ of s

, binary search - ANS-looking for an item in an already sorted list by breaking the list in
half and comparing each element to the median until the target element is found

linear recursion - ANS-a function that only makes a single recursive call to itself each
time the function is called

tail recursion - ANS-special case of linear recursion where the function directly returns
the result of the recursive function call

in general, tail recursion.... - ANS-can always be replaced by a loop

what functions are in the sorted list ADT? - ANS-add(item)
remove(item)
__getitem__(index)
__contains__(item)
__iter__
__len__

add(item) - ANS-adds item to the sorted list

remove(item) - ANS-removes 1st occurrence of the item

__getitem__(index) - ANS-returns item with given index

selection - ANS-returns item with given index

__contains__(item) - ANS-returns true if item is found

__iter__ - ANS-returns an iterator over the sorted list that yields the items in order

__len__ - ANS-returns the length of the sorted list

transitive - ANS-if a < b and b < c then a < c

invariant - ANS-something that is true every time we reach a certain point in the
algorithm

bubble - ANS-biggest element to last spot, next biggest to second to last spot, etc.

sort() - ANS-sorts a list

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 Hkane. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78998 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
CA$11.45
  • (0)
  Add to cart