zuai-logo
zuai-logo
  1. AP Computer Science Principles
FlashcardFlashcard
Study GuideStudy GuideQuestion BankQuestion Bank

What are the differences between decision and optimization problems?

Decision: Yes/No answer | Optimization: Seeks the best solution.

Flip to see [answer/question]
Flip to see [answer/question]
Revise later
SpaceTo flip
If confident

All Flashcards

What are the differences between decision and optimization problems?

Decision: Yes/No answer | Optimization: Seeks the best solution.

What are the differences between reasonable and unreasonable time?

Reasonable: Polynomial time | Unreasonable: Exponential/Factorial time.

What are the differences between algorithms and heuristics?

Algorithms: Guarantee a correct solution | Heuristics: Aim for a 'good enough' solution.

Compare the time complexity of linear search vs. binary search.

Linear Search: O(n) | Binary Search: O(log n) (for sorted data).

Compare the space complexity of iterative vs. recursive algorithms.

Iterative: Generally lower space complexity | Recursive: Can have higher space complexity due to call stack.

What are the differences between a brute-force algorithm and a dynamic programming algorithm?

Brute-force: Tries all possible solutions | Dynamic Programming: Breaks the problem into subproblems and stores the results to avoid redundant computations.

What are the differences between best-case, average-case, and worst-case time complexity?

Best-case: Minimum time required | Average-case: Expected time required | Worst-case: Maximum time required.

Compare and contrast depth-first search (DFS) and breadth-first search (BFS) graph traversal algorithms.

DFS: Explores as far as possible along each branch before backtracking | BFS: Explores all the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.

What are the differences between a greedy algorithm and a divide-and-conquer algorithm?

Greedy: Makes the locally optimal choice at each step | Divide-and-conquer: Divides the problem into smaller subproblems, solves them recursively, and combines the solutions.

What are the differences between time complexity and space complexity?

Time complexity: Measures the amount of time an algorithm takes to run as a function of the input size | Space complexity: Measures the amount of memory space an algorithm requires as a function of the input size.

How is pathfinding (shortest path) applied in real-world scenarios?

GPS navigation systems, network routing, logistics optimization.

How are sorting algorithms applied in real-world scenarios?

Database management, search engine results, e-commerce product listings.

How are heuristics used in AI?

Game playing (e.g., chess), machine learning model training, spam filtering.

How is cryptography related to computer science?

It uses algorithms to secure data and communications, ensuring confidentiality and integrity.

How is dynamic programming applied in bioinformatics?

Sequence alignment for DNA and protein analysis.

How are graph algorithms used in social networks?

Friend recommendation, community detection, influence analysis.

How is machine learning used in fraud detection?

Identifying patterns of fraudulent behavior based on transaction data.

How are search algorithms used in web search engines?

Indexing and retrieving relevant web pages based on search queries.

How is data compression used in multimedia applications?

Reducing the size of images, audio, and video files for efficient storage and transmission.

How are scheduling algorithms used in operating systems?

Managing and prioritizing processes to optimize CPU utilization and system performance.

What is an algorithm?

A set of instructions designed to solve a specific problem.

What is a problem instance?

A specific input to a problem.

What is a decision problem?

A problem with a yes or no answer.

What is an optimization problem?

A problem that seeks the best solution from many possibilities.

What is algorithm efficiency?

A measure of how many computational resources an algorithm uses.

What is 'reasonable time' in algorithm analysis?

Algorithms that run in polynomial time or lower.

What is 'unreasonable time' in algorithm analysis?

Algorithms that run in exponential or factorial time.

What are heuristics?

Approximation techniques used when finding an exact solution is too difficult or time-consuming.

Define polynomial time.

A running time that increases as a polynomial function of the input size (e.g., n, n^2, n^3).

Define exponential time.

A running time that increases exponentially as the input size grows (e.g., 2^n, 3^n).