Trees – definitions with pictures

This article depicts fundamental definitions of trees. It is an introduction to a series of articles dedicated to trees and their definitions in a simple and understood approach. Some people, like me, understand better with picture, they tend to draw a lot when explaining to others or themselves. Also, they tend to do a lot of hand motions when explaining something. The following summarized definitions are fundamental to understand trees.  

A Tree is a collection of nodes

 

Tree
Tree

One is called root, and zero or more nonempty children.

 

 

Each child or group of children can be considered a tree or a sub-tree of the main tree, thus each child of the main tree can be seen as a root.

   

A link between a root and its child is called edge If a tree has N nodes then it has N-1 edges, the red numbers on the images show edges nodes :

edge
Tree Edges

Leaves: nodes with no children

.  

Siblings: Nodes with the same root.  

siblings
Siblings

A path from node n 1 to n k is defined as a sequence of nodes n 1 , n 2 , . . . , n k such that n (i) is the parent of n (i+1) for 1 ≤ i < k The length of this path is the number of edges on the path, namely k − 1  

path
Length of a path

The depth of n i is the length of the unique path from the root to n i . Thus, the root is at depth 0

depth
Depth

 The height of n i is the length of the longest path from n i to a leaf. The height of a tree is equal to the height of the root.  

height
Height

If there is a path from n 1 to n 2 , then n 1 is an ancestor of n 2 and n 2 is a descendant of n 1 . If n 1 = n 2 , then n 1 is a proper ancestor of n 2 and n 2 is a proper descendant of n 1 .      

Do you play ? Don’t do this mistake !

do you play enough ?

Do you play enough ? I didn’t ! and it was a mistake. Few months ago the company I am working at setup another gaming room on my floor, previously I had to go upstairs to play, but for some reason I didn’t. After setting up the new gaming room, most of the guys started playing video games. The company brought us a brand new Play Station 4. My first thoughts were “Oh my God everyone will start playing, productivity’s will go down and most of our projects will suffer a delay, what a waste of time!” I am a video games fan, I used to play a lot in my school days, especially mmorpg games like Cabal, MU, runescape,and others like Mortal Kombat, Street Fighter, Counter Strike, and many others. The sad story is that I stopped playing at some point, I grew up right ? I had to start studying for high school exams then enroll in University where I had to study hard and build my career there by attending presentations, planning projects, working for some local companies -in other words- always tried not to “waste” my time. Well, it was extremely bad idea ! Not the fact that I cared about my career and self-development but that I didn’t give myself time to play, I was selfish to myself and always considered playing a time wasting !. But what happened ? Ok, the guys at the office got the new Mortal Kombat X game and challenged me. I am that type of guy that if you want me to do something – tell me I can’t do it ! I got into the game and for some reason I allowed myself to dive in and guess what ? I felt fresh again my motivation, productivity and focus factor all went up, currently I am able to concentrate and finish in one hour what I wasn’t able to for two or three hours. It feels like my mind needed its time for pleasure and joy just like my body needs its portion of sugar, protein and carbs everyday !     If you are the type of guy that always wants to keep up, not “wasting” his time, and always strive to be on the top, not bad but give yourself some time to please your mind. Start playing and enjoy your time. Here is a very interesting presentation by Steve Keil talking about play and how important playing is .

IDEA Intellij JDBC Driver support for IBM Informix

IDEA Intellij 

Probably the best IDE on the market so far that boosts your productivity to its maximum. The first time I was introduced to IDEA Intellij I felt in love with it.  I do not understand some developers that has like 3 to 4 separate programs and ten opened command line terminals (CLT) when develop. It goes something like this one IDE for source code one Database viewer, one CLT for building the project, one for deployment and another for starting local dev server and god knows what else. IDEA Intellij has them all in one windows maybe two at most.

IBM informix

Read moreIDEA Intellij JDBC Driver support for IBM Informix

Spring MVC HTTP Status 405 – Request method ‘POST’ not supported

Recently I’ve started developing a new website utilizing Spring Technologies, Spring MVC and Spring Security. This is best way to learn something new, rather than reading and reading I decided to implement a website with SpringMVC, Spring Security.
As I haven’t done any website with Spring MVC before I struggled a little bit with it.
One of the problems I’ve faced was, the title of this post, Spring MVC HTTP Status 405 – Request method ‘POST’ not supported.

Read moreSpring MVC HTTP Status 405 – Request method ‘POST’ not supported