← Samsung questions

Cycle detection and topological sort

Filed under Samsung

Given a directed graph, implement cycle detection and a topological sort. Topological sorting is a linear ordering of vertices such that for every directed edge u -> v from vertex u to vertex v, u…

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.