Top "Greedy" questions

A greedy algorithm is an algorithm that follows the problem solving heuristic of making the locally optimal choice at each stage with the hope of finding a global optimum.

Non greedy (reluctant) regex matching in sed?

I'm trying to use sed to clean up lines of URLs to extract just the domain. So from: http://www.…

regex sed pcre greedy regex-greedy
What is the difference between dynamic programming and greedy approach?

What is the main difference between dynamic programming and greedy approach in terms of usage? As far as I understood, …

algorithm dynamic graph greedy
How to find maximum spanning tree?

Does the opposite of Kruskal's algorithm for minimum spanning tree work for it? I mean, choosing the max weight (edge) …

algorithm minimum-spanning-tree greedy kruskals-algorithm
Why does the greedy coin change algorithm not work for some coin sets?

I understand how the greedy algorithm for the coin change problem (pay a specific amount with the minimal possible number …

algorithm greedy coin-change
Greedy, Non-Greedy, All-Greedy Matching in C# Regex

How can I get all the matches in the following example: // Only "abcd" is matched MatchCollection greedyMatches = Regex.Matches("abcd", @"…

c# regex greedy regex-greedy non-greedy
How is dynamic programming different from greedy algorithms?

In the book I am using Introduction to the Design & Analysis of Algorithms, dynamic programming is said to focus …

algorithm dynamic-programming greedy
Usage examples of greedy algorithms?

What is the use of greedy algorithms? An real example?

algorithm greedy
What's the difference between greedy and heuristic algorithm?

What's the difference between greedy and heuristic algorithm? I have read some articles about the argument and it seems to …

algorithm heuristics greedy
Optimal room count and sizes for N overlapping Meeting Schedules

I bumped into this question and I am not sure if my solution is optimal. Problem Given N weighted (Wi) …

algorithm scheduling dynamic-programming intervals greedy
Optimal Algorithm for Winning Hangman

In the game Hangman, is it the case that a greedy letter-frequency algorithm is equivalent to a best-chance-of-winning algorithm? Is …

algorithm probability greedy game-theory