News for hackers. Stuff that matters.
Re:Data Structure Visualizations (2011) by tzs on Tuesday February 05, 2019 @01:22PM (#19088057)
Are you sure about that?

I've seen people not realize they are implementing a linked list when they are working in a language like PHP or Python, have an array of objects, and those objects contain indexes or keys to other objects in the array.

Similarly, I've seen people not realize they have trees. For instance, suppose a program generates some kind of report. The report has multiple sections. Somewhere in there you might have a

  report = [section1, section2, ..., sectionN]
to represent the report. But section can have subsections, so that section1 could actually be

  section1 = [section1_1, section1_2, ...]
and so one with subsubsections and more.

That final 'report' variable references a tree, but a lot of people wouldn't notice because they didn't have to make a node structure with child and parent pointers and maintain those pointers manually.

There are no comments on this comment yet.