Skip to content

EPW80/Data-Structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures

A data structure is a storage used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

Data Structures explored in this folder

Binary Search Tree Structure: A Binary Search Tree (BST) is a data structure in computer science that organizes data for efficient insertion, deletion, and searching. Operations like insertion, deletion, and search can be performed in O(log n) time complexity in a binary search tree, where n is the number of nodes. This is assuming that the tree is balanced. In the worst-case scenario, where the tree becomes skewed (more like a linked list), the time complexity of these operations could degrade to O(n).

Doubly Linked Lists: A doubly linked list is a type of linked list in which each node contains a data element and two links pointing to the next and the previous node in the sequence, respectively. This allows for more O(1) time complexity operations, such as insertions or deletions from both ends of the list or the ability to iterate the list in both directions.

Singly Linked Lists: A singly linked list is a data structure consisting of nodes representing a sequence together. Each node contains data and a reference (or link) to the next node in the sequence. The linked list structure uses dynamic memory but not dynamic arrays.

Stacks: A stack is a linear data structure that follows the Last In First Out (LIFO) principle. This means that the last element added to the stack will be the first element to be removed. There are mainly two principal operations allowed on a stack: Push: Adds an item to the top of the stack. Pop: Removes the top item from the stack.

Queues:

Vectors: A vector is a dynamic array that adjusts its size automatically. While traditional arrays have a fixed size that needs to be defined upon declaration, vectors are designed to remove this constraint. When elements are added to a vector and run out of allocated memory, it typically reserves more space than is immediately necessary. This is a deliberate design choice to avoid frequent memory reallocations. When the vector grows beyond this reserved space, a new chunk of memory is allocated, the elements are moved to this new space, and the old memory is released. Access: Constant time (O(1)). Direct access to any element using its index.

Contributor

Erik Williams

About

Code for different data structures

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages