Algorithms Archives • IT Blog
IT Blog
Boris IT Expert

Dequeue Java implementation example. Simple solution

November 30, 2020

Dequeue Java implementation example. Simple solution

How to remove an element (dequeue) from the queue in Java? In the past article, I have described how to perform the enqueue in Java. In this chapter, we will go through the dequeue process. As you remember, in the queue type data structure, we have to remove the first element from the head. Detailed […]

November 30, 2020

Enqueue Java implementation example. Simple solution

How to add an element (enqueue) in the queue Java? In the previous article, I have explained how to implement the queue in Java. In this article, we will go through the adding elements process. As you remember, in the queue type data structure, we have to attach the new element to the queue’s last […]

November 30, 2020

Queue implementation simple example. How to implement in Java.

Queue implementation example in Java. How to implement a queue data structure in Java? First, you should know the queue works. It works the same principles as the real-life queue. If you come to the doctor, you should wait in line. For instance, three people before you and you cam at 8.30. The first person […]

November 24, 2020

How to implement Stack in Java. Simple solution.

How to implement a stack data structure in Java? First of all, you should understand the main idea of the stack. Try to imagine an empty box for books. And you can put only one book at once. If you put another book, it will go on top of the previous one. What will you […]

November 20, 2020

Search an element in a binary tree. Simple Java example.

How to search an element in a binary tree in Java? This problem is one of the fundamental issues in any technical interview. Here, the basic logic is almost the same as inserting the element in the binary tree. To find an element that value less than the root value, we are going on the […]

November 20, 2020

Insert element in a binary tree. Simple Java example.

How to insert an element in a binary tree in Java? That is one of the common questions in any technical interview. The basic logic here is to put elements that value less than the root on the binary tree’s left side. And put the elements that value more than the root element on the […]

November 18, 2020

Post order traversal binary tree. Simple Java example.

The most simplistic approach to implement post-order traversal. The design of traversing a binary tree in an in-order way. There are three kinds of binary tree traversal: post-order, in-order, pre-order. It is a typical task in any professional interview. Therefore you should learn all variations and details. The initial and primary fact is that you […]

November 18, 2020

In order traversal binary tree. Simple Java example.

The simplest way to implement pre-order traversal. The pattern of traversing a binary tree in an in-order way. There are three varieties of binary tree traversal: in-order, pre-order, post-order. It is a common task in any technical interview. Thus you should understand all variations and details. The primary and central fact is that you need […]

November 17, 2020

Pre-order traversal binary tree. Simple Java example.

How to implement pre-order traversal? Example of traversing a binary tree in a pre-order way. There are three types of binary tree traversal: pre-order, in-order, post-order. It is a widespread question on any technical interview. So you should know all differences and details. The first and main point is that you need to keep in […]

November 17, 2020

Binary tree Java implementation. Simple example.

How to implement a binary tree in Java? That question is one of the most popular in any technical interview. A binary tree is one of the fundamental data structures. That’s why you should learn how to create it. In this lesson, I will show the most straightforward way of implementation. Example of the binary […]