โ† Oracle questions
CodingReported in a candidate post, Jul 2025

Find a loop in a tree and write DFS and BFS pseudo code

Filed under Oracle

Given an undirected graph described as a set of edges, detect whether it contains a loop (cycle), which means the structure is not a valid tree. Then write pseudo code for DFS and BFS traversal.

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 Oracle questions

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