As you know, LinkedIn is a social network, and users are connected to one another through first- or second-degree connections. In order to better understand this concept, use the following diagram as a reference:
![](https://static.packt-cdn.com/products/9781789611151/graphics/assets/a9d1c864-52d8-40ab-9b41-b62fa17a5c7d.png)
Figure 1
Suppose that I want to find an acquaintance named Jill and connect with her. When I go to her profile, I find that she is a second-degree connection, which means that we have a mutual colleague. Let's look at how this degree is computed. To do so, we will create a connection tree:
- We start with the profile node, Dev, and add it to the connection tree:
![](https://static.packt-cdn.com/products/9781789611151/graphics/assets/05a0cb02-1efe-4b1c-a906-0561b07010d8.png)
Figure 2
- Now, I will find my colleagues and add them beneath my node. So, I add Ali and Tom beneath the Dev node:
![](https://static.packt-cdn.com/products/9781789611151/graphics/assets/7a569634-9366-42e6-aa28-95a997a6c16f.png)
Figure 3
- Now, for both Ali and Tom, I find their colleagues and add them beneath their nodes. So, under Ali, I add Dev, Seth, and Ram, and under...