← Samsung questions

Topological sorting of graph

Filed under Samsung

Given a Directed Acyclic Graph (DAG) with V vertices and E edges, return a linear ordering of vertices such that for every directed edge (u, v), vertex u comes before v in the ordering. If there are…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.