Unit 1e – Runtime Analysis

0.0(0)
studied byStudied by 1 person
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

7 Terms

1
New cards

What is Big-O notation?

Describes worst-case growth rate of algorithm runtime.

Sequential search: O(n)

Binary search: O(log n)

Bubble sort: O(n²)

2
New cards

What are common g++ options?

-o prog → name output file

-g → debug info

-Wall → warnings

3
New cards

How do you compile multiple files?

g++ main.cpp helper.cpp -o prog

Without a prototype, a compile-error is generated

4
New cards

What are prototypes and header files for?

Prototypes go in .h files, which are #included in .cpp files to avoid duplication.

5
New cards

Rules for headers?

Don’t compile .h files directly.

Recompile .cpp files if header changes.

6
New cards

Algorithms:

An ordered set of unambiguous, executable steps that defines a terminating process

7
New cards

Runtime:

Worst case run time