Usually, the first sort algorithm many developers learn is the Bubble sort. That’s because it’s the easiest sort algorithm to implement. The performance is not good but it does the job. The basic idea of the bubble sort is to iterate...
The Selection sort is not the most performant but it’s an easy one to implement. Simply put, the selection sort will have two subarrays. The sorted part in the left, and the unsorted part is on the right. The selection sort will select the...
The insertion sort is one of the simplest sorting algorithms available. It’s also one of the least efficient in terms of performance. The insertion algorithm will go through the whole array with the index i starting with 1 and then sort...
The Breadth-First search algorithm is a way to traverse through graphs or trees so that the nodes are visited level by level. The depth-first search algorithm, on the other hand, will traverse nodes to the depth-first as its name suggests, in other...
The depth-first-search algorithm is used a lot in algorithms where it’s necessary to traverse through nodes. In day-to-day work, this algorithm is very likely to not be used though. However, LinkedList uses the concepts of graphs. But before...
The tree data structure is a type of graph. A tree has a root node (top node) that will have a relationship with its child nodes. The path that connects the root node to the child nodes is called a branch. The leaf node is the node that...
The graph data structure is a composition of nodes connected by edges. Graphs are vastly used in the real world. One very simple example is Facebook where a person is a friend of another person and so on. Graphs can also represent routes from one...
Recursion is a programming fundamental that is highly used in algorithms. Simply put, recursion is the ability of a method to call itself. When a method calls itself it stacks up and uses the LIFO (Last-in First-out) approach. It’s the same...
Malta is an impressive country to visit in Europe. It’s small but there is a lot of history, beautiful views, and great food, also the people are welcoming there. I will also show you how my experience will help YOU to go to the next level in...
Knowing how constructors work in Java will help you to design a code structure that is flexible and maintainable. In this Java code challenge, you will learn how a constructor behaves when we use inheritance. Do you know what happens when one class...