Tag: Java

Hash Table Java

Hash Table Data Structure with Java

The Hash Table data structure stores keys and values into a variable in Java and other programming languages. It’s also a very common data structure vastly used in day-to-day projects and algorithms. Let’s see a simple example of how...

string data structure

String Data Structure Java

The String data structure in Java and in other programming languages behind the scenes is an array of bytes. Bytes behind the scenes are numbers that can be translated into bits or binary numbers. Those numbers correspond to a character in an...

logarithm time complexity

Logarithm Time Complexity

The logarithm time complexity is present in many algorithms and it’s very effective. Therefore, it’s important to understand how it works so we can know how performant the algorithm that has this time complexity is. In simple words, a...

big o notation

Big (O) Notation Explanation

The Big(O) Notation is a fundamental concept to help us measure the time complexity and space complexity of the algorithm. In other words, it helps us measure how performant and how much storage and computer resources an algorithm uses. Also, in any...

array data structure

Array Data Structure with Java

The array data structure is probably the most used in every application. If not directly used it’s indirectly used with ArrayList, ArrayDeque, Vector, and other classes. Simply put, an array is a data structure that stores multiple variables...

stack data structure

Stack Data Structure with Java

The stack data structure is used in many important algorithms such as depth-first search and recursive methods. A stack also uses the LIFO (Last-in Last-out) strategy which means that the last element in will be the last out. This data structure can...

queue data structure

Queue Data Structure with Java

The Queue data structure is very useful in algorithms. It’s very used when traversing graphs for example. It’s also very efficient in terms of performance to insert and remove the first or last elements. What is Queue? We can use an...

bubble sort

Bubble Sort with Java

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

selection sort

Selection Sort with Java

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

Insertion sort Java

Insertion Sort with Java

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