Article of the week

Traversing trees in pre-order recursively in PHP

Traversing trees in pre-order recursively in PHP

03 Jul 2017 13:58:12


Article on traversing tree data structure depth-first in pre-order recursively with examples in PHP programming language.


Like in the real world, trees are ubiquitous in computer programming today. Frequently tree data structure turns out to be a perfect choice for modelling a naturally occurring phenomena and not only them these days. The bad news is, unlike one-dimensional arrays or other data ...

Read full article »

Recent articles

Find total of a column of numbers with BASH

28 Nov 2016 20:53:05

Find total of a column of numbers with BASH

Suppose you have a file with a long list of items followed or perhaps preceded by whole numbers and you are asked to find the total of those numbers. The file might look like this (case 1): aaa:23 bb:2 ccc:98 . . . or perhaps like this (case ...

Read more »