Cracking the Coding Interview

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Multipart Algorithm: Multiply

"Do this for each time you do that"

Multipart Algorithm: Add

"Do this, then, when done, do that."

Steps of the Problem Solving Strat

1. Listen 2. Example (Diagram and Draw) 3. Brute Force 4. Optimize (BUD system) 5. Walk Through (Talk it, Understand it) 6. Implement 7. Test

Big O Notation

A metric used to describe the efficiency of algorithms. Expression of how runtime scales.

Constant-time statement

A statement that is "simple" (only involves basic operations).

Time-complexity (of an algorithm)

Asymptotic runtime of an algorithm (a line that approaches a curve but never touches)

Amortized time

Average time required over a sequence of operations

Omega (big omega) (academia)

Describes the lower bound on the time.

O (big O) (academia)

Describes the upper bound on the time

Balanced Binary Search Tree (big O Notation)

O (log N)

Space Complexity

The concept of how much space (memory) an algorithm requires.

O(log N)

Typically describes when the number of elements in the problem space are halved at each iteration

Theta (big theta) (academia)

When an algorithm is both O(N) and Omega(N)

Dropping Non-Dominant Terms

When describing an algorithm like: O (N^2 + N) we ignore and remove the non-dominant term and describe is as O (N^2) instead. A non-dominant term is one that has a slower rate of increase.

Dropping Constants

trsting


Ensembles d'études connexes

Chapter 4 - Intellectual Property

View Set

chapter 11 quizzes (Spring 2015, Fall 2018, Spring 2016, Fall 2015, this years quiz)

View Set

BIOL 1030 - Chapter 12 MasteringBiology

View Set

MedSurg Ch 27- Assessment and Management of Patients with Hypertension

View Set

Real Estate Test 3, Real Estate Study Questions, Real Estate Test 2, Real Estate Test 1

View Set

International Chapter 8 questions

View Set

Alta - Chapter 8 - Confidence Intervals - Part 1

View Set