Skip to content

Commit 7f16149

Browse files
Update README.md
1 parent 1420517 commit 7f16149

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
# greedy-algorithms-interview-questions
1+
<div data-v-5e9078c0="" data-v-b06dc010="" class="QuestionsList"><div data-v-5e9078c0=""><h1 data-v-5e9078c0="">
2+
Top 7 Greedy Algorithms interview
3+
questions and answers in 2021.
4+

5+
You can check all
6+
7
7+
Greedy Algorithms interview questions here 👉
8+
https://devinterview.io/data/greedyAlgorithms-interview-questions
9+


🔹 1. What is a Greedy Algorithm?

Answer:

We call algorithms greedy when they utilise the greedy property. The greedy property is:

At that exact moment in time, what is the optimal choice to make?

Greedy algorithms are greedy. They do not look into the future to decide the global optimal solution. They are only concerned with the optimal solution locally. This means that the overall optimal solution may differ from the solution the greedy algorithm chooses.

They never look backwards at what they've done to see if they could optimise globally. This is the main difference between Greedy Algorithms and Dynamic Programming.

Source: skerritt.blog   


🔹 2. What Are Greedy Algorithms Used For?

Answer:

Greedy algorithms are quick. A lot faster than the two other alternatives (Divide & Conquer, and Dynamic Programming). They're used because they're fast. Sometimes, Greedy algorithms give the global optimal solution every time. Some of these algorithms are:

  • Dijkstra's Algorithm
  • Kruskal's algorithm
  • Prim's algorithm
  • Huffman trees

These algorithms are Greedy, and their Greedy solution gives the optimal solution.

Source: skerritt.blog   


🔹 3. What is the difference between Dynamic Programming and Greedy Algorithms?

10+
👉🏼 Check
11+

🔹 4. What's the difference between Greedy and Heuristic algorithm?

12+
👉🏼 Check
13+

🔹 5. Compare Greedy vs Divide & Conquer vs Dynamic Programming Algorithms

14+
👉🏼 Check
15+

🔹 6. Is Dijkstra's algorithm a Greedy or Dynamic Programming algorithm?

16+
👉🏼 Check
17+

🔹 7. Are there any proof to decide if Greedy approach will produce the best solution?

18+
👉🏼 Check
19+


20+
Thanks 🙌 for reading and good luck on your next tech interview!
21+

22+
Explore 3800+ dev interview question here 👉
23+

0 commit comments

Comments
 (0)