Category: Data Structures & Algorithms

Java SE 8 Optional Class 0

Short Java 8 Optional Tutorial

If you’ve been programming with Java for some time, I am quite sure that you’ve heard of or first-hand experienced the NullPointerException.A NullPointerException occurs when the programmer (you..) try to perform some operation on a variable that hasn’t been assigned any value – hence, it is null. The Java 8...

Visualization of a tree data structure 0

Inorder, preorder and postorder traversal

If you have been working with linear data structures like stacks and queues, you know that it is a pretty easy job to traverse them. They are linear, which tells us that they are also traversed linearly. One simply goes through one element at a time, in a linear fashion....

enqueue-in-priority-queue 0

The Priority Queue

The priority queue is a somewhat similar data structure to the queue. The difference lies in how the elements are being processed: A standard queue strictly follows the FIFO (First In Last Out) principle. A priority queue does not follow the FIFO principle. In a priority queue, the elements are...

Visualization of a queue data structure in java 0

What is a Queue?

Today I’ll cover the queue, which is a linear data structure. The workings of the queue are very intuitive and easy to understand, as it works just as a regular queue (i.e. in the grocery store). Unlike stacks,which follow the LIFO principle (Last In First Out), a queue follows the...

Singly Linked List and Doubly Linked List 0

Doubly Linked List in Java

In this article we’ll have a look at a data structure known as a Doubly Linked List. If you’re unfamiliar with Linked Lists, I highly recommend that you check out this tutorial on Linked Lists before proceeding. A Doubly Linked Lists (often abbreviated as DLL), is very much alike a...

What is recursion? Recursion is a powerful programming technique 0

What is Recursion?

In this article we will explain some of the key concepts of recursion, which is a widely used and extremely powerful programming technique. If you’re serious about your programming career, or just want to expand your programming knowledge, you should definitely get at least a basic understanding of recursion. So, let’s...

infix postfix conversion and infix prefix conversion 0

Infix, Prefix and Postfix notation

If you have been dealing with mathematical expressions, you might have heard of infix, prefix and postfix notation. If you have never heard of these kind of ways to write mathematical expressions, don’t be afraid. You already use one of them on a day-to-day basis. We’ll come back to which...

The stack is one of the most basic data structures in computer science 0

What is a stack?

In this article we give you a description of what a stack is, and when this type of data structure is used. At the end of the article, we implement a custom stack in Java. Let’s start this one of with an analogy: Assume you have a stack of bills,...

Introduction to algorithm analysis 0

Introduction to Algorithm Analysis

Before we dive into the subject of Algorithm Analysis, let’s get a clear understanding of what an algorithm actually is. Whenever we want to solve a problem with a computer, we process large amounts of data. To actually make sense of this data, we need some set of rules on...