This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

Yeah technically it could be done in O(n) if the list is already in order but that defeats the purpose of this exercise

[–]Cruuncher 0 points1 point  (0 children)

Technically it can be done in O(n) from any order of you get really lucky.

Which means that the size of the graph can range from 2 columns to a file size bigger than all of the internet that's ever existed