Data Structure - Binary heap

Introduction This article is part of the data structure category A binary heap is a heap data structure that uses a binary tree to store items. To use a binary tree as a binary heap, it needs to sort the items it stores. The binary heap can store the items in descending order, as a max heap, or in ascending order, as a min heap. To implement a binary tree as a max heap, every parent node must be greater than or equal to its children....

April 3, 2021 · 12 min · Damiano Petrungaro

Data Structure - Queue

Introduction This article is part of the data structure category A queue is an abstract and dynamic data structure. Abstract because its behavior determines it, not by the implementation details, and dynamic, because it can adjust its size once created. A queue implements a method of handling elements named FIFO, first-in first-out, where the first inserted element in the queue is going to be the first one to be picked up; this design makes this data structure excellent for use cases where the order in which the elements must be processed is important....

March 23, 2021 · 5 min · Damiano Petrungaro

Data Structure - Stack

Introduction This article is part of the data structure category A stack is an abstract data structure defined by its behavior rather than its implementation details. It’s also dynamic, meaning it can adjust its size once created. A stack implements a method of handling elements named LIFO, last-in first-out, where the last inserted element in the stack is going to be the first one to be picked up; this design makes the usage of this data structure excellent for use cases, for example, as “undo/redo” (AKA ctrl+z/ctrl+y)....

March 12, 2021 · 6 min · Damiano Petrungaro

Data Structure - Circular buffer

Introduction This article is part of the data structure category A circular buffer (also known as ring buffers, circular queue, or cyclic buffer) is a data structure that uses a fixed-size buffer to store data. The buffer is connected end-to-end, which usually leads to visualizing this data structure as a circle. This detail makes the circular buffer a static data structure, which means its size cannot be adjusted once created....

March 11, 2021 · 5 min · Damiano Petrungaro

Data Structure - Doubly Linked List

Introduction This article is part of the data structure category A linked list is a collection of sequential elements forming a linear data structure. In the linked list, each element of the collection is a node storing a value and, depending on the implementation, one or more links to its neighbouring nodes. This detail makes the linked list a dynamic data structure, which means it can grow or shrink its size....

February 26, 2021 · 11 min · Damiano Petrungaro

Data Structure - Singly Linked List

Introduction This article is part of the data structure category A linked list is a linear data structure formed by a collection of sequential elements. In the linked list, an element is a node that stores a value and, depending on the implementation, one or more link to the next elements. This detail makes the linked list a dynamic data structure, which means it can grow or shrink its size....

February 23, 2021 · 9 min · Damiano Petrungaro