concept structure in category kotlin

appears as: structures, structure, structure, The structure
The Joy of Kotlin

This is an excerpt from Manning's book The Joy of Kotlin.

Control structures are elements controlling the program flow. These are the basis of imperative programming: where a program expresses how a computation is to be done. As you’ll see in the next chapters, control structures are a major source of bugs in computer programs, so you should avoid them as much as possible. You’ll see that it’s possible to write much safer programs by totally avoiding the use of control structures.

Primarily, you can ignore the notion of control flow. You replace control structures with expressions and functions. Unlike some languages specifically designed to promote safe programming, Kotlin has both control structures (like Java) and functions that can be used to replace those structures. But some of these control structures are, in fact, different from their Java versions.

10.7 Insertion order and the structure of trees

The structure of a tree (meaning how well balanced it is) depends on the insertion order of its elements. Insertion is done in the same way as searching: