Into to Alg FINAL

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/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:51 PM on 7/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

What is the time complexity of the basic polynomial algorithm (nested loops)?

O(n^2)

2
New cards

What algorithm evaluates a polynomial in O(n)time?

Horner's Method (factors out x to use only 1 multiplication and 1 addition per step).

3
New cards

Why does the greedy "nearest neighbor" rule fail for the Traveling Salesman Problem (TSP)?

Short-sighted choices early on can trap you into taking extremely long routes later.

4
New cards

What is a Bipartite Graph?

A graph whose nodes can be split into 2 teams where every connection goes between the teams (never inside the same team).

5
New cards

What graph feature makes a graph impossible to be bipartite?

An odd-length cycle (like a triangle).

6
New cards

How do you solve the Two-Clique Problem using a bipartite graph test?

Build the complement graph (flip all edges) and test if that complement graph is bipartite.

7
New cards

How many characters can 7-bit ASCII represent?

128 characters (2^7 = 128).

8
New cards

What is the difference between Lossless and Lossy compression?

Lossless: Perfect recovery, 0 data lost (e.g., ZIP, PNG). Lossy: Permanently throws away unused data for smaller size (e.g., JPEG, MP3).

9
New cards

How does Huffman Coding save space?

Gives frequent characters short binary codes and rare characters longer binary codes.

10
New cards

What is the fastest time complexity to merge k sorted lists with n total elements?

O(n log k). It uses a Min-Priority Queue of size k containing the front element of each list. Each insertion and removal takes O(log k) time across all n elements.

11
New cards

In modular exponentiation by repeated squaring (g^x mod p), when and how do you update the running result r?

You update r = (r * c) mod p only when the current rightmost binary bit of the exponent d is 1 (d mod 2 == 1). If the bit is 0, r remains unchanged.

12
New cards

In the Diffie-Hellman protocol, how does Alice compute the shared secret key using Bob's public value B, her private secret a, and modulus p?

Alice computes K = B^a mod p. Since Bob's public value is B = g^b mod p, her calculation equals (g^b)^a mod p = g^(ab) mod p.