Question DSA-GRDY-0074
HardDijkstra's algorithm is greedy. Which choice does it make at each step?
- A.
It picks the vertex with the most edges
- B.
It picks a random vertex
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Greedy question
Dijkstra's algorithm is greedy. Which choice does it make at each step?
It picks the vertex with the most edges
It picks a random vertex
Sign up free to see the answer and a step-by-step explanation.
It finalises the unvisited vertex with the smallest tentative distance
It picks the cheapest edge anywhere