# Defining Greedy Algorithm

An algorithm is called *greedy* if it follows the problem-solving heuristic of making the *locally* optimal choice at each stage with the aim of finding a *global* optimum.

In most situations, a greedy strategy does not lead to the optimal solution. Hence, it is extremely important to reason about the correctness of the greedy strategy before using it to solve a problem.

## Problem 1: Too much to do!

Let's say you have to maximise the number of tasks that you complete in a 10-hour duration. You are given an array T = [2, 4, 1, 6] where T_{i} denotes the time required to complete the i^{th} task.

The answer to this question would be **3** as you would choose to do tasks** T**_{2}, T_{0} and **T**_{1 }— which take 1, 2 and 4 hours respect...