Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Data Structures Overview

25

Flashcards

0/25

Still learning
StarStarStarStar

Stack

StarStarStarStar

A LIFO (last in, first out) data structure. Complexity: Access - O(n), Search - O(n), Insertion - O(1), Deletion - O(1)

StarStarStarStar

Linked List

StarStarStarStar

A linear collection of data elements, whose order is not given by their physical placement in memory. Complexity: Access - O(n), Search - O(n), Insertion - O(1), Deletion - O(1)

StarStarStarStar

Binary Search Tree (BST)

StarStarStarStar

A binary tree where each node follows the left child is lesser and the right child is greater rule. Complexity: Access - O(log n), Search - O(log n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

AVL Tree

StarStarStarStar

A self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than one for all nodes. Complexity: Access - O(log n), Search - O(log n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Binary Tree

StarStarStarStar

A tree data structure in which each node has at most two children. Complexity: Access - O(n), Search - O(n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Heap

StarStarStarStar

A specialized tree-based data structure which is essentially an almost complete tree that satisfies the heap property. Complexity: Access (Max/Min) - O(1), Search - O(n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Hash Table

StarStarStarStar

A data structure which implements an associative array, a structure that can map keys to values. Complexity: Access - N/A, Search (average case) - O(1), Insertion (average case) - O(1), Deletion (average case) - O(1)

StarStarStarStar

Array

StarStarStarStar

A collection of items stored at contiguous memory locations. Complexity: Access - O(1), Search - O(n), Insertion - O(n), Deletion - O(n)

StarStarStarStar

Queue

StarStarStarStar

A FIFO (first in, first out) data structure. Complexity: Access - O(n), Search - O(n), Insertion - O(1), Deletion - O(1)

StarStarStarStar

Tree

StarStarStarStar

A hierarchical data structure with a root value and subtrees of children with a parent node. Complexity: Access - O(n), Search - O(n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Segment Tree

StarStarStarStar

A tree data structure for storing intervals or segments. It allows querying which of the stored segments contain a given point. Complexity: Access - N/A, Search - O(log n), Update - O(log n), Range Query - O(log n)

StarStarStarStar

Sparse Table

StarStarStarStar

A data structure that allows answering range queries. It can answer range min/max queries in O(1) time with O(n log n) preprocessing time. Complexity: Preprocessing - O(n log n), Range Query - O(1)

StarStarStarStar

Disjoint Set (Union-Find)

StarStarStarStar

A data structure that keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets. Complexity: Union - O(log n), Find - O(log n), but with path compression and union by rank or size, these operations can work nearly in O(1)

StarStarStarStar

Graph

StarStarStarStar

A collection of nodes or vertices connected by edges. Complexity for Adjacency List: Access - O(1), Search - O(V+E), Insertion - O(1), Deletion - O(1). Complexity for Adjacency Matrix: Access - O(1), Search - O(V^2), Insertion - O(1), Deletion - O(1). Here V is the number of vertices and E is the number of edges.

StarStarStarStar

Deque

StarStarStarStar

A double-ended queue that allows insertions and deletions from both ends. Complexity: Access - O(n), Search - O(n), Insertion - O(1), Deletion - O(1)

StarStarStarStar

Priority Queue

StarStarStarStar

An abstract data type where each element has a priority and the element with the highest priority is served before other elements. Complexity: Access (Max/Min) - O(1), Search - O(n), Insertion - O(log n), Deletion (Max/Min) - O(log n)

StarStarStarStar

Cartesian Tree

StarStarStarStar

A binary tree derived from a sequence of numbers; it can be used to create a static range minimum query structure. Complexity: Access - N/A, Search - N/A, Insertion - O(n), Deletion - N/A

StarStarStarStar

K-d Tree

StarStarStarStar

A space-partitioning data structure for organizing points in a k-dimensional space. K-d trees are useful for applications such as searches involving a multidimensional search key. Complexity: Construction - O(n log n), Search - O(log n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Double Linked List

StarStarStarStar

Similar to Linked List, but each node contains an additional pointer to the previous node. Complexity: Access - O(n), Search - O(n), Insertion - O(1), Deletion - O(1)

StarStarStarStar

Red-Black Tree

StarStarStarStar

A self-balancing binary search tree where each node contains an extra bit for denoting the color of the node, red or black. Complexity: Access - O(log n), Search - O(log n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Suffix Tree

StarStarStarStar

A compressed trie containing all the suffixes of the given text as their keys and positions in the text as their values. Complexity: Access - Not applicable, Search - O(length of search string), Insertion - O(n), Deletion - Not generally supported

StarStarStarStar

B-Tree

StarStarStarStar

A self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. Complexity: Access - O(log n), Search - O(log n), Insertion - O(log n), Deletion - O(log n)

StarStarStarStar

Suffix Array

StarStarStarStar

A sorted array of all suffixes of a string. Complexity: Building - O(n log n), Search - O(m log n) where m is the size of the pattern to be searched

StarStarStarStar

Fenwick Tree (Binary Indexed Tree)

StarStarStarStar

A data structure that provides efficient methods for calculation and manipulation of the prefix sums of a table of values. Complexity: Access - O(log n), Search - N/A, Update - O(log n), Range Sum Query - O(log n)

StarStarStarStar

Trie

StarStarStarStar

A tree-like data structure used to store a dynamic set or associative array where the keys are usually strings. Complexity: Access - O(length of key), Search - O(length of key), Insertion - O(length of key), Deletion - O(length of key)

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.