|
|
|
|
|
by brudgers
3399 days ago
|
|
The example input in the article is: [1,[2,3], [4, [5,6]]]
It happens to be representable as a binary tree. Indeterminacy regarding whether or not that is accidental or intentional is due to underspecification of the interview problem. The first time I read a description of Linkedin using logs as the fundamental data structure (for what turns out to be Kafka I later learned) I had an epiphany that there is no such thing as a generic simple data structure living in the wild because data is data because it has semantics, without semantics it is just noise.To me, it looks like the root node is |1|. |
|
But maybe I've just been poisoned by Lisp, which tries to use lists as the elusive generic simple data structure.
(OT: https://en.wikipedia.org/wiki/List_of_lists_of_lists)