Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Data Structures Basics

10

Flashcards

0/10

Still learning
StarStarStarStar

Stack

StarStarStarStar

Definition: A collection of elements with two principal operations: push and pop, which follow last in, first out (LIFO) principle. Operations possible: Push, Pop, Peek. Complexity of operations: Push - O(1), Pop - O(1), Peek - O(1).

StarStarStarStar

Queue

StarStarStarStar

Definition: A collection of elements that supports first in, first out (FIFO) principle. Operations possible: Enqueue, Dequeue, Peek. Complexity of operations: Enqueue - O(1), Dequeue - O(1), Peek - O(1).

StarStarStarStar

Trie

StarStarStarStar

Definition: A tree-like data structure that stores a dynamic set of strings in which each node represents a common part of one or more strings. Operations possible: Insertion, Search, Deletion. Complexity of operations: Insertion - O(m), Search - O(m), Deletion - O(m), where m is the length of the string.

StarStarStarStar

Array

StarStarStarStar

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

StarStarStarStar

Hash Table

StarStarStarStar

Definition: A data structure that implements an associative array, a structure that can map keys to values. Operations possible: Insert, Search, Delete. Complexity of operations: Insert - O(1), Search - O(1), Delete - O(1) on average.

StarStarStarStar

Linked List

StarStarStarStar

Definition: A sequence of nodes where each node is linked to the next node. Operations possible: Access, Insertion, Deletion. Complexity of operations: Access - O(n), Insertion - O(1), Deletion - O(1).

StarStarStarStar

Graph

StarStarStarStar

Definition: A collection of nodes (vertices) and the connections between them (edges). Operations possible: Add Vertex, Add Edge, Remove Vertex, Remove Edge. Complexity of operations: Depends on the representation (Adjacency matrix or adjacency list).

StarStarStarStar

Binary Search Tree

StarStarStarStar

Definition: A binary tree in which each node has two children at most and the left child's key is less than the parent's key, and the right child's key is greater. Operations possible: Search, Insertion, Deletion. Complexity of operations: Search - O(log n), Insertion - O(log n), Deletion - O(log n).

StarStarStarStar

Heap

StarStarStarStar

Definition: A specialized tree-based data structure that satisfies the heap property; either the parent is greater than or equal to the children (max heap) or lesser (min heap). Operations possible: Insertion, Deletion, Peek. Complexity of operations: Insertion - O(log n), Deletion - O(log n), Peek - O(1).

StarStarStarStar

Red-Black Tree

StarStarStarStar

Definition: A balanced binary search tree with each node colored red or black, following specific balance rules to ensure the tree remains approximately balanced. Operations possible: Search, Insertion, Deletion. Complexity of operations: Search - O(log n), Insertion - O(log n), Deletion - O(log n).

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.