Tag: Java

breadth-first search graph

Breadth-First Search Algorithm with Java

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...

Depth First Search

Depth-First-Search with Java

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...

Tree Data Structure

Tree Data Structure with Java

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...

Graph data structure

Graph Data Structure with Java

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...

Mastering Programming Recursion with Java

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...

dragon warrior reference challenge

Dragon Warrior Reference Java Challenge

Did you know that every variable in Java is passed by value and not by reference? However, what happens when we pass an object to a method? Do we manipulate the value or the reference? This is exactly what you will explore in the following Java...

joker lambda challenge

Joker Lambda Challenge

Functional interfaces in Java are crucial to master. In this Java code challenge, we will explore the Supplier and Consumer functional interfaces. Do you know how a lambda behaves in Java? Try to solve this Java code challenge and make sure you know...

Lambda Composition Challenge Code

Jedi Dark Side Lambda Fight Challenge

Composing functions with lambda might come in handy when you need to execute multiple functions. In the following Java code challenge, we will explore the UnaryOperator, Function, and BiFunction functional interfaces working in a composed way. Can...