The mammalian brain, one of the most fascinating systems in nature, is a complex biological structure that has kept scientists busy for over a century. Many of the brain's mysteries have been unraveled due to the enormous efforts of the scientific community, but yet many questions remain unsolved. The detailed drawings of Ramon y Cajal revealed the hidden structure of the brain, identifying the neurons as its fundamental structural and functional units. Although a significant amount of experimental reconstructions have been gathered over the past years, neuronal morphologies still remain one of the unsolved riddles of the brain. Why is neuronal diversity important for the functionality of the brain and how do neuronal morphologies ''shape'' our thoughts? To address these questions one needs to characterize the various shapes of neuronal morphologies. Traditionally, this task has been performed by using a set of morphological features, such as total length, branch orders and asymmetry. However, these features focus on a specific morphological aspect thereby causing a significant information loss from the original structure. Inspired by algebraic topology, I have conceived a topological descriptor of neuronal trees that couples the topology of a tree with the geometric features of its structure, retaining more details of the original morphology than traditional morphometrics. This descriptor has proved to be very powerful in discriminating several neuronal types into concrete groups based on morphological grounds, and has lead to the discovery of two distinct classes of pyramidal cells in the human cortex. In addition, the Topological Morphology Descriptor is important for the generation of artificial cells whose morphologies remain faithful to the biological ones. Neurons of the same morphological type have similar topological and geometric characteristics, therefore appearing to be highly structured. However, it is still unknown to what extent the complex neuronal morphology is shaped by the genetic information of an organism and to what extent it arises from stochastic processes. To study the impact of randomness and structure of neuronal morphologies on the connectivity of the network they form, I compared the properties of networks that arise from different artificially generated morphologies, ranging from random walks to constrained branching structures, against those of biological networks and computational reconstructions built from biological morphologies. Surprisingly, networks that are generated from almost random morphologies share a lot of common properties with biological networks, such as the spatial clustering of connections and the common neighbor effect, indicating that stochastic processes that take place during development, contribute significantly to the observed neuronal shapes. This thesis resolves a number of the mysteries of neuronal morphologies and questions our beliefs about the role of randomness in the formation of the brain. Thus, it brings us closer to understanding the fundamental differences among morphologies, and how randomness and structure are combined together to generate one of the most complex biological systems.