DS Module 2: Linked Lists and Analysis of Algorithms

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

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:49 AM on 5/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

Recursion

repetition where a funct calls itself until base case.

2
New cards

Base Case

condition that stop repetition in recursive.

3
New cards

Factorial (Recursive Formula)

If n > 0, n! = n * (n-1)!; if n = 0, 0! = 1.

4
New cards

Recursive Trace

visualization technique to track recursive calls and value

5
New cards

Recursive Linear Sum

method where sum of n int is calculated as LinearSum(A, n-1) + A[n-1]

6
New cards

Linear Fibonacci

recursive algorithm with only k-1 calls, avoiding redundant operations

7
New cards

Constant Function

f(n) = c; no of operations independent of input size n

8
New cards

Logarithm Function

f(n) = log_b(n), commonly base 2 in cs

9
New cards

Log Rule 1 (Product)

log(ac) = log(a) + log(c).

10
New cards

Log Rule 2 (Quotient)

log(a/c) = log(a) - log(c).

11
New cards

Log Rule 3 (Power)

log(a^c) = c * log(a).

12
New cards

Linear Function

f(n) = n; represents runtime of single loop through n elem

13
New cards

N-Log-N Function

f(n) = n * log(n); grows slight faster than linear but slower than quadratic.

14
New cards

Quadratic Function

f(n) = n^2; runtime of nested loops (n * n iterations).

15
New cards

Growth Rate

how running time inc as input size n grows

16
New cards

Big O (Upper Bound)

f(n) is O(g(n)) if f(n) <= c * g(n) for all n >= n0.

17
New cards

Big Omega (Lower Bound)

f(n) is Ω(g(n)) if f(n) >= c * g(n) for all n >= n0.

18
New cards

Big Theta (Tight Bound)

f(n) is Θ(g(n)) if it's bounded above and below by g(n).

19
New cards

Reflexivity (Big O)

property that any function f is O(f).

20
New cards

Transitivity (Big O)

If f = O(g) and g = O(h), then f = O(h).

21
New cards

Sums Rule (Big O)

If f1 = O(g1) and f2 = O(g2), then f1 + f2 = O(max{g1, g2}).

22
New cards

Asymptotic Simplification

keeping only highest-order term

23
New cards

Hidden Constants

Factors ignored in Big O that may make an O(n) algorithm slower than O(n log n) in practice.

24
New cards

Array Shifting Inefficiency

Add/remove in large arrays is O(n) bc many elem may be shifted.

25
New cards

Linked List

A ds made of chain of nodes with elem and pointers.

26
New cards

Node

An object that stores elem and >1 pointer to another node.

27
New cards

Singly Linked List

chain of nodes with each having only 1 "next" pointer.

28
New cards

Head and Tail

The "head" first node. "tail" last node and "next" points to NULL.

29
New cards

Friend Keyword (Linked Lists)

Allow LinkedList class to access private members of Node class.

30
New cards

DLL Sentinels

Special dummy nodes (header and trailer) that simplify list operations.

31
New cards

DLL Deletion Logic

Updating adjacent nodes to bypass target node

32
New cards

Circularly Linked List

last node points back to first node instead of NULL.

33
New cards

Circular List advance()

A method that moves the cursor to the next node in the circular chain.