Data & Analysis

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/47

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:11 AM on 9/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

48 Terms

1
New cards

What is an algorithm?

A well-defined computational procedure that takes input, produces output, and finishes in a finite amount of time.

2
New cards

What are the two main issues related to algorithms?

How to design algorithms and how to analyze algorithm efficiency.

3
New cards

What does analysis of algorithms mean?

Predicting the resources an algorithm requires, such as memory and computational time.

4
New cards

What are the two main efficiency measures emphasized in algorithm analysis?

Time efficiency and space efficiency.

5
New cards

How is time efficiency measured?

By counting how many times the algorithm's basic operation is executed as a function of input size.

6
New cards

How is space efficiency measured?

By counting the extra memory units consumed by the algorithm as a function of input size.

7
New cards

Why is actual clock time not the best way to analyze an algorithm?

It depends on the computer speed, implementation quality, compiler, and difficulty of accurately measuring runtime.

8
New cards

What is an algorithm's basic operation?

The operation that contributes most to running time, usually one executed most frequently.

9
New cards

For searching a list of n items, what is the input size and basic operation?

Input size: n, the number of items. Basic operation: key comparison.

10
New cards

For a typical graph problem, how is input size commonly measured?

By the number of vertices and/or edges.

11
New cards

What is the general plan for analyzing a nonrecursive algorithm?

Choose input size n; identify the basic operation; determine best, average, and worst cases if needed; set up a sum for the number of basic operations; simplify the sum.

12
New cards

What is worst-case efficiency?

The maximum number of basic operations among all inputs of size n.

13
New cards

What is best-case efficiency?

The minimum number of basic operations among all inputs of size n.

14
New cards

What is average-case efficiency?

The expected number of basic operations for inputs of size n under an assumed probability distribution.

15
New cards

Is average-case efficiency just the average of best case and worst case?

No. It is an expected value based on a probability distribution over possible inputs.

16
New cards

For sequential search, what is the best case?

The search key is the first element, so Cbest(n) = 1.

17
New cards

For the maximum-element algorithm on an array, what is the basic operation?

The comparison A[i] > maxval.

18
New cards

For the maximum-element algorithm on n items, how many comparisons are made?

n - 1 comparisons.

19
New cards

What identity is Euclid's algorithm based on?

gcd(m,n) = gcd(n, m mod n).

20
New cards

When does Euclid's algorithm stop?

When the second number becomes 0; then the first number is returned as the gcd.

21
New cards

Compute gcd(60,24) using Euclid's algorithm.

gcd(60,24) = gcd(24,12) = gcd(12,0) = 12.

22
New cards

What is the main idea of the Sieve of Eratosthenes?

Start with integers 2 through n and eliminate multiples of each remaining prime candidate. The numbers left are prime.

23
New cards

What three asymptotic notations are used to compare orders of growth?

O (Big-O), Ω (Big-Omega), and Θ (Big-Theta).

24
New cards

What does Big-O describe?

An asymptotic upper bound. t(n) is in O(g(n)) if t(n) ≤ c·g(n) for all sufficiently large n.

25
New cards

What does Big-Omega describe?

An asymptotic lower bound. t(n) is in Ω(g(n)) if t(n) ≥ c·g(n) for all sufficiently large n.

26
New cards

What does Big-Theta describe?

A tight asymptotic bound. t(n) is in Θ(g(n)) when it is bounded both above and below by constant multiples of g(n) for sufficiently large n.

27
New cards

What is an intuitive meaning of Θ(n²)?

The running time is roughly proportional to n² when n is large.

28
New cards

What are the major efficiency classes from better growth to worse growth?

1, log n, n, n log n, n², n³, 2ⁿ, n!.

29
New cards

How does n² change when n doubles?

It becomes 4 times as large: (2n)² = 4n².

30
New cards

How does n³ change when n doubles?

It becomes 8 times as large: (2n)³ = 8n³.

31
New cards

How does log₂ n change when n doubles?

It increases by 1 because log₂(2n) = 1 + log₂ n.

32
New cards

What does lim t(n)/g(n) = 0 mean for order of growth?

t(n) grows more slowly than g(n).

33
New cards

What does lim t(n)/g(n) = c, where c > 0, mean?

t(n) and g(n) have the same order of growth.

34
New cards

What does lim t(n)/g(n) = ∞ mean?

t(n) grows faster than g(n).

35
New cards

What asymptotic class do logarithms with any fixed base greater than 1 belong to?

Θ(log n).

36
New cards

What asymptotic class does a polynomial of degree k with positive leading coefficient belong to?

Θ(n^k).

37
New cards

What is the time complexity of repeatedly dividing n by 2 until reaching 1?

Θ(log₂ n), usually written Θ(log n).

38
New cards

What is an array?

A sequence of same-type items stored contiguously in memory and accessed using an index.

39
New cards

What is a linked list?

A sequence of nodes containing data and one or more pointers to other nodes.

40
New cards

What is a stack?

A list where insertions and deletions happen only at the top; it follows LIFO, last in first out.

41
New cards

What is a queue?

A structure where elements are added at the rear and removed from the front; it follows FIFO, first in first out.

42
New cards

What is a priority queue?

A collection that supports selecting the highest-priority item, deleting it, and adding new items.

43
New cards

What data structure is commonly used as a better implementation of a priority queue?

A heap.

44
New cards

What is a graph?

A set of vertices (nodes) together with a set of edges connecting pairs of vertices.

45
New cards

What is a tree?

A connected acyclic graph.

46
New cards

What is a forest?

An acyclic graph that is not necessarily connected; each connected component is a tree.

47
New cards

What is a rooted tree?

A tree with one designated root, usually shown at level 0, with vertices organized into levels below it.

48
New cards

What is a binary tree?

An ordered tree in which each vertex has at most two children, designated left and right.