Skip to content

exarus/CycledListQuestion

Repository files navigation

Interview Question: Is it a cycled list

Question

Write an algorithm that checks if the the following structure is a cycled list? A structure is composed of nodes with 2 properties: id, id of the next node. If id of the next node is null then the node is the last one.

Solution

My first idea had complexity of O(n²). The repository contains the code.

The story

The code is a solution to a question asked on my first inteview ever (2014).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published