Term | Definition | ||
---|---|---|---|
Length | The total number of elements currently in the array. | ||
Capacity | The maximum number of elements an array can hold. | ||
Index | The number, usually starting with 0, pointing to an element's position within an array. | ||
Array | A linear data structure consisting of a collection of elements, each identified by at least one index or key. |
Term | Time Complexity | ||
---|---|---|---|
Insertion | |||
Deletion | |||
Resize | |||
Element Access |
Term | Definition | ||
---|---|---|---|
Head | The first node in the linked list. | ||
Node | An element in a linked list that typically holds data and at least one reference to one other node. | ||
Previous Node | A reference to the previous node in the linked list. | ||
Next Node | A reference to the next node in the list. | ||
Singly-Linked List | A linked list implementation where each node only has a reference to the next node in the list. | ||
Doubly-Linked List | A linked list implementation where each node has a reference to the next and previous node in the list. | ||
Circular Linked List | A linked list implementation where the head's "previous" reference points to the last node in the linked list, and last node's "next" reference points to the first node in the linked list. | ||
Sentinel Node | A node that points to the first and last elements of the linked list and contains no data. | ||
Tail Pointer | A reference to the last element in a linked list, used to make removing from the end of a linked list more efficient. |
Term | Time Complexity | ||
---|---|---|---|
Insertion | |||
Deletion | |||
Element Access |
Term | Definition | ||
---|---|---|---|
Front | The first element in the queue. | ||
Rear | The last element in the queue. | ||
FIFO First In First Out | A key property of queues that maintains that elements are removed in the order that they are added. |
Term | Time Complexity | Definition | |||
---|---|---|---|---|---|
Enqueue | Insert an element at the front of the queue. | ||||
Dequeue | Remove the element at the front of the queue. |
Term | Definition | ||
---|---|---|---|
Top | The first element of the stack. | ||
LIFO Last in First Out | A key property of stacks that maintains that elements added last are removed first. |
Term | Time Complexity | Description | |||
---|---|---|---|---|---|
Pop | Remove and return an element from the top of the stack. | ||||
Push | Place an element at the top of the stack. | ||||
Peek | Return the element at the top of the stack. |
Term | Definition | ||
---|---|---|---|
Root | The topmost node in the tree hierarchy. It has no parent node. | ||
Leaf | A node in a tree that has no children. | ||
Height | The length of the longest path from the root node to a leaf node. | ||
Depth | A property of individual nodes. The length of the path from the root node to a given node. | ||
Child | A node that has a parent node. | ||
Sibling | Nodes that share the same parent node. | ||
Descendant | Any node that can be reached by traversing down the tree from a particular node. | ||
Internal Node | A node in a tree that has at least one child. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Binary Tree | A tree in which each node has at most two children, referred to as the left child and the right child. These children are typically ordered, with one designated as the left child and the other as the right child. | ||||
Insertion | | ||||
Deletion | | ||||
Access Element | | ||||
Finding Max/Min | |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
AVL Tree | A self-balancing binary search tree in which the heights of the two child subtrees of any node differ by at most one. They maintain a balance factor for each node to ensure that the tree remains balanced after insertions and deletions. This balance property ensures that the height of the tree remains logarithmic. | ||||
Insertion | Insert a new node into an (already balanced) tree. | ||||
Deletion | Remove a node from a balanced tree. | ||||
Access Element | Access a node in a balanced tree. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Red and Black Trees | A type of self-balancing binary search tree. They maintain balance using a set of properties, including color coding of nodes and rotations to enforce balance during insertions and deletions. Red-black trees are designed to ensure that the longest path from the root to any leaf is no more than twice as long as the shortest path. | ||||
Insertion | Insert a new node into an (already balanced) tree. | ||||
Deletion | Remove a node from a balanced tree. | ||||
Access Element | Access a node in a balanced tree. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
B Tree | A self-balancing search tree where each node can have multiple keys and children, designed for efficient searching, insertion, and deletion operations in large datasets, commonly used in databases and file systems. | ||||
B+ Tree | An extension of a B-tree where all keys are present in the leaf nodes, and leaf nodes are linked in a linked list, optimized for range queries, sequential access, and efficient storage systems like databases. | ||||
Insertion | Insert a node into a balanced B/B+ tree. | ||||
Deletion | Delete a node from a balanced B/B+ tree. | ||||
Element Access | Access a node in a B/B+ tree. |
Term | Definition | ||
---|---|---|---|
Heap | A binary tree or array-based data structure where each node has a value greater than or equal to (max-heap) or less than or equal to (min-heap) its children. It ensures that the root node contains either the maximum or minimum value of all elements. | ||
Min-Heap | An implementation of a heap where the value of each parent node is less than or equal to the value of its children nodes. | ||
Max-Heap | An implementation of a heap where the value of each parent node is greater than or equal to the value of its children nodes. |
Term | Time Complexity | ||
---|---|---|---|
Insertion | |||
Deletion | |||
Build Heap | |||
Heapify | |||
Find Minimum/Maximum |
Term | Definition | ||
---|---|---|---|
Hash Table | A data structure that uses a hashing algorithm to map keys to indices in an array, allowing for efficient storage and retrieval of values associated with those keys, with the goal of minimizing collisions and optimizing access times. | ||
Hashing Algorithm | In the context of hash tables, a function that takes an input and produces a valid integer index. The goal of a hashing algorithm is to distribute keys evenly across the available space, minimizing collisions and maximizing efficiency. | ||
Collision | Occurs when two different keys hash to the same index in the underlying array or bucket. | ||
Load Factor | The load factor of a hash table is a measure of how full the hash table is, expressed as the ratio of the number of stored elements | ||
Open Addressing | Resolves collisions by finding alternative slots within the table, often using methods like linear probing or quadratic probing. | ||
Chaining | Resolves collisions by storing multiple key-value pairs hashing to the same index in linked lists or other data structures associated with each slot in the hash table. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Insertion | |||||
Deletion | |||||
Resizing |
Term | Definition | ||
---|---|---|---|
Graph | A non-linear data structure consisting of a set of vertices (or nodes) and a set of edges that connect pairs of vertices. Graphs are widely used to model relationships between objects or entities in various domains, such as computer networks, social networks, transportation systems, and more. | ||
Vertex | A distinct point or object in a graph. | ||
Edge | A connection or relationship between two nodes or vertices. It defines the link or interaction between the entities represented by the connected nodes. | ||
Path | A sequence of vertices connected by edges. | ||
Cycle | A path in the graph that starts and ends at the same vertex, without traversing any edge more than once. | ||
Degree | The number of edges incident to a vertex. | ||
Weight | A property of an edge that represents some numerical value associated with traversing it. | ||
Fully-Connected Graph | A type of graph in which each pair of distinct vertices is connected by a unique edge. | ||
Directed Graph | A type of graph where edges have a direction from one vertex to another. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Djikstra's Algorithm | Used to find the shortest paths from a single source vertex to all other vertices in a weighted graph with non-negative edge weights. It works by maintaining a set of vertices whose shortest distance from the source vertex is known. At each step, it selects the vertex with the smallest tentative distance (shortest distance from the source) from the set of vertices not yet processed, updates the distances of its neighboring vertices, and adds them to the set. This process continues until all vertices have been processed or the destination vertex is reached. Dijkstra's algorithm guarantees the shortest path from the source vertex to any other vertex as long as the graph doesn't contain negative edge weights. | ||||
Bellman-Ford Algorithm | Used to find the shortest paths from a single source vertex to all other vertices in a weighted graph, even when some edge weights are negative. It works by iteratively relaxing the edges of the graph, i.e., updating the distance estimates of vertices by considering all possible paths of increasing lengths. It repeats this process for a maximum of |V| - 1 iterations, where |V| is the number of vertices in the graph. After the iterations, if there are no negative cycles in the graph, the algorithm guarantees the shortest paths from the source vertex to all other vertices. If a negative cycle is detected during the iterations, the algorithm reports it as unreachable. | ||||
Prim's Algorithm | Used to find the minimum spanning tree (MST) of a connected, undirected graph. It starts with an arbitrary vertex and grows the MST one edge at a time by always selecting the shortest edge that connects a vertex in the MST to a vertex outside the MST. It maintains two sets of vertices: one in the MST and one outside the MST. At each step, it chooses the edge with the minimum weight that connects a vertex in the MST to a vertex outside the MST, adding the newly connected vertex to the MST. This process continues until all vertices are included in the MST. | ||||
Kruskal's Algorithm | Used to find the minimum spanning tree (MST) of a connected, undirected graph. It uses a greedy approach and edge sorting to build the MST. Initially, all edges of the graph are sorted by their weights. Then, starting with the smallest edge, the algorithm iteratively adds edges to the MST as long as they don't form cycles. It maintains a data structure (e.g., disjoint-set) to efficiently detect and avoid cycles. This process continues until all vertices are included in the MST. | ||||
Topological Sort | Used to linearly order the vertices of a directed acyclic graph (DAG) such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering. The algorithm works by repeatedly removing vertices with no incoming edges and adding them to the sorted list. It continues this process until all vertices have been removed. If the graph contains cycles, topological sorting is not possible because there is no valid ordering of the vertices. |
Term | Definition | ||
---|---|---|---|
Memoization | A technique used to store the results of expensive function calls and reuse them when the same inputs occur again. | ||
Optimal Substructure | A problem exhibits optimal substructure if an optimal solution to the problem contains optimal solutions to its subproblems: problems exhibiting this property are good candidates for a dynamic programming approach. | ||
Overlapping Subproblems | A property of a problem where answers to the same subproblem are necessary to solve the main problem. | ||
Bottom-Up Approach | Involves solving a problem iteratively by building the solution from the smallest subproblems up to the largest problem. This approach avoids recursion. | ||
Top-Down Approach | Involves solving a problem recursively by breaking it down into smaller subproblems and using memoization to store the results of subproblems to avoid redundant calculations. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Merge Sort | A comparison-based sorting algorithm that follows the divide-and-conquer strategy. It divides the array into smaller subarrays, recursively sorts them, and then merges the sorted subarrays to produce the final sorted array. | ||||
Insertion Sort | A simple comparison-based sorting algorithm that builds the final sorted array one element at a time by repeatedly moving elements that are out of order into their correct position. | ||||
Selection Sort | A simple comparison-based sorting algorithm that divides the array into sorted and unsorted regions. It repeatedly selects the smallest (or largest) element from the unsorted region and swaps it with the first element of the unsorted region. | ||||
Bubble Sort | A simple comparison-based sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The process is repeated until the list is sorted. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Linear Search Sequential Search | Iterates through each element in a list or array sequentially until the target element is found or the end of the list is reached. | ||||
Binary Search | A more efficient search algorithm for sorted arrays. It works by repeatedly dividing the search interval in half until the target element is found or the interval is empty. | ||||
Depth-First Search | A graph traversal algorithm that explores as far as possible along each branch before backtracking. It is often implemented using recursion or a stack data structure. | ||||
Breadth-First Search | A graph traversal algorithm that explores all the neighbor nodes at the present depth before moving on to the nodes at the next depth level. It is often implemented using a queue data structure. |
Term | Definition | Time Complexity | |||
---|---|---|---|---|---|
Pre-Order Traversal | A depth-first tree traversal algorithm where each node is visited before its children. In a binary tree, the order of traversal is: root, left subtree, right subtree. | ||||
Post-Order Traversal | A depth-first tree traversal algorithm where each node is visited after its children. In a binary tree, the order of traversal is: left subtree, right subtree, root. | ||||
In-Order Traversal | A depth-first tree traversal algorithm where each node is visited between its left and right subtrees. In a binary tree, the order of traversal is: left subtree, root, right subtree. |
AI Study Tools for STEM Students Worldwide.
© 2025 CompSciLib™, LLC. All rights reserved.
info@compscilib.comContact Us