Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Greedy Algorithms

8

Flashcards

0/8

Still learning
StarStarStarStar

Prim's Algorithm

StarStarStarStar

Strategy: Grow a minimum spanning tree by starting from an arbitrary node and repeatedly adding the cheapest edge that extends the tree. Example: Constructing minimum spanning trees in network optimization.

StarStarStarStar

Coin Change Problem

StarStarStarStar

Strategy: Make change for a particular amount of money with the fewest coins by choosing the largest coin value that does not exceed the remaining amount. Example: Cashier systems for returning the minimal number of coins as change.

StarStarStarStar

Huffman Coding

StarStarStarStar

Strategy: Create a variable-length, prefix-free binary code for encoding data with the most frequent pieces of data using the shortest codes. Example: Data compression algorithms like file compression tools.

StarStarStarStar

Dijkstra's Algorithm

StarStarStarStar

Strategy: Find the shortest paths from a single source to all other vertices by iteratively selecting the vertex with the smallest known distance and updating its neighbors' distances. Example: GPS navigation systems for finding shortest driving routes.

StarStarStarStar

Activity Selection Problem

StarStarStarStar

Strategy: Select the maximum number of activities that don't overlap by always choosing the next activity that finishes first. Example: Scheduling tasks within given time slots without overlaps.

StarStarStarStar

Fractional Knapsack Problem

StarStarStarStar

Strategy: Maximize total value in a knapsack with limited capacity by selecting fractions of items based on the ratio of value to weight. Example: Resource allocation problems where division of resources is possible.

StarStarStarStar

Kruskal's Algorithm

StarStarStarStar

Strategy: Build a minimum spanning tree by choosing edges in increasing order of weight, ignoring those that form a cycle. Example: Finding the minimum spanning tree in a weighted graph.

StarStarStarStar

Job Sequencing with Deadlines

StarStarStarStar

Strategy: Maximize profit by scheduling jobs to occur before their deadlines while considering profit—schedule jobs with the highest profit first. Example: Any scheduling problem where tasks have deadlines and profits associated with timely completion.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.