Recursion | Base case |
Recursive case | Iteration |
Factorial | Fibonacci sequence |
Binary search | Recursive backtracking |
The condition that stops the recursion; the simplest possible solution to a particular problem. | A programming technique in which a function calls itself directly or indirectly in order to solve a problem. |
A repetitive process that repeats a series of steps over and over again until a certain condition is met. | The condition that continues the recursion; the condition in which the function calls itself. |
A infinite sequence of numbers where each number is the sum of the two preceding ones, starting from 0 and 1. | The product of all positive integers from 1 up to a given number. |
An algorithm that solves a problem by choosing options at each step, and backtracking when a chosen option does not lead to a solution. | A searching algorithm that divides the search interval in half at every step. |
Fractal | Tree traversal |
Maze solving | Tower of Hanoi |
Recursive thinking | Recursion |
Base case | Recursive algorithm |
The process of visiting all the nodes in a tree in a specific order. | A geometric shape whose parts resemble the whole, even when magnified. |
A puzzle in which a tower of discs of different sizes is moved from one peg to another, with the constraint that only one disc can be moved at a time, and a larger disc cannot be placed on top of a smaller one. | An application of recursive thinking that involves finding a path from the start to the finish of a maze. |
A problem-solving technique that involves solving a problem by calling a function within the same function. | A problem-solving approach that involves breaking down a problem into smaller, more manageable sub-problems that can be solved using the same solution. This is done repeatedly until the sub-problems become simple enough to be solved easily. |
An algorithm that uses recursion as its main problem-solving technique. | A condition where the function stops calling itself and returns a value. |
Inductive reasoning | Iteration |
Tail recursion | Stack overflow |
Memoization | Binary recursion |
Linear recursion | Iteration vs. recursion |
The repeating of a process or set of instructions until a specific condition is met. | A reasoning process that involves using specific observations and examples to make a generalization or prediction. |
An error that occurs when the stack size exceeds the memory limit set by the operating system. | A recursion technique where the recursive call is the last statement in a function. This allows the compiler to optimize the code and reduce the amount of memory used. |
A recursion technique where the problem is divided into two sub-problems. Each sub-problem is solved recursively, and the results are combined to solve the original problem. | A technique where the results of a function call are stored in memory to avoid redundant calculations. |
Two problem-solving approaches that are used to solve problems. Iteration involves using loops to repeat a set of instructions, while recursion involves calling a function within the same function. | A recursion technique where the problem is divided into one sub-problem. The sub-problem is solved recursively and the result is combined with the original problem. |
Recursive algorithm | Base case |
Recursive case | Recursion depth |
Factorial | Fibonacci sequence |
Binary search | Merge sort |
An initial condition that determines when the recursion should stop. | A function or subroutine that calls itself within its own code to solve a problem. |
The number of times a function calls itself during the recursive process. | The condition that the function calls itself. |
A series of numbers in which each number is the sum of the two preceding ones. | The product of all positive integers less than or equal to a given positive integer. |
A sorting algorithm that works by dividing an array into smaller sections, sorting those sections, and then merging them back together. | A search algorithm that finds the position of a target value within a sorted array. |
Quicksort | Tower of Hanoi |
Backtracking | Depth-first search |
Stack | Push |
Pop | Peek |
A mathematical puzzle that involves moving a stack of disks from one pole to another, using a third pole as an intermediate. | A sorting algorithm that works by partitioning an array into smaller sections, sorting those sections, and then recursively sorting the subarrays. |
A graph traversal algorithm that explores as far as possible along each branch before backtracking. | A recursive algorithmic technique that involves trying out different solutions to a problem, and abandoning a solution as soon as it is determined to be invalid. |
The operation of adding an element to the top of a stack. | A data structure consisting of a collection of elements, each identified by an index or a key, where the order of elements follows a last-in, first-out (LIFO) principle. |
The operation of accessing the top element of a stack without removing it. | The operation of removing the top element from a stack. |
Empty Stack | Full Stack |
Stack Pointer | Application |
Expression Evaluation | Function Call |
Backtracking | Compiler |
A stack that contains the maximum number of elements it can hold. | A stack that contains no elements. |
A program or a part of a program that uses a stack to accomplish a specific task, such as implementing expression evaluation, function call, or backtracking. | A variable that points to the top element of a stack. |
A process of invoking a function by pushing its arguments and return address onto a stack, executing the function code, and returning the result by popping the stack. | A process of computing the value of an arithmetic expression, such as 2 + 3 * 4, using a stack to store operands and operators according to their precedence and associativity. |
A program that translates source code into machine code and usually uses a stack to implement control flow constructs, such as if, while, and for, and to allocate and deallocate memory for local variables and function parameters. | A technique for exploring all possible solutions to a problem by maintaining a stack of choices and undoing them when they lead to a dead-end, until a valid solution is found. |
Stack | Push |
Pop | Peek |
Empty stack | Full stack |
Stack access methods | Algorithm |
A method of adding an item to the top of the stack. | A data structure that operates in a last-in first-out (LIFO) manner. |
A method of accessing the item at the top of the stack without removing it. | A method of removing the item at the top of the stack. |
A stack with the maximum number of elements it can hold. | A stack with no elements. |
A finite sequence of steps for solving a problem. | Methods of accessing the elements in a stack, including push, pop, and peek. |
Constructing algorithms with stacks | LIFO |
Dynamic memory allocation | Memory leak |
Queue | FIFO |
Enqueue | Dequeue |
Last-In, First-Out, the order in which elements are removed from a stack. | Developing algorithms that use stack access methods to solve a problem. |
A situation in which a program fails to release memory that is no longer needed, leading to a reduced amount of available memory and potential program crashes. | Allocating memory as needed during program execution. |
An acronym for 'first in, first out,' which describes the order in which elements are added to and removed from a queue. | A collection of elements that supports adding elements to the end of the collection and removing elements from the front of the collection. |
The operation of removing an element from the front of a queue. | The operation of adding an element to the end of a queue. |
Circular Queue | Priority Queue |
Buffer | Job Queue |
Print Queue | Linked List |
Array | Array-based Queue |
A queue in which elements are assigned a priority and removed according to their priority level. | A queue in which the last element is connected to the first element to form a circular structure. |
A queue used to manage the execution of multiple processes or tasks in a computer system. | A queue used to temporarily store data or commands before they are processed or executed. |
A data structure composed of nodes that are linked together by pointers or references. | A queue used to manage and prioritize print jobs sent to a printer or print server. |
A queue implemented using an array to store the elements. | A data structure that stores a fixed-size sequence of elements of the same data type in contiguous memory locations. |
Queue | Enqueue |
Dequeue | Peek |
Front | Rear |
Circular Queue | Priority Queue |
The operation of adding an element to the rear (tail) of the queue. | A data structure in which elements are inserted at one end and removed from the other end, following a First-In-First-Out (FIFO) order. |
The operation of retrieving the element at the front (head) of the queue without removing it. | The operation of removing an element from the front (head) of the queue. |
The element at the rear (tail) of the queue. | The element at the front (head) of the queue. |
A specialized type of queue in which each element is associated with a priority and is served according to its priority. | A variation of the regular queue in which the last element points back to the first element in the queue. |
Simple Queue | Linked Queue |
Queue ADT | Bounded Queue |
Static Stack | Static Queue |
Array | Data Structure |
A queue implementation that uses a linked list data structure to store elements, with each element pointing to the next one in the list. | A basic queue implementation in which elements are inserted at the rear and removed from the front in a linear order. |
A queue implementation that has a maximum size limit and can only hold a fixed number of elements at any given time. | The Abstract Data Type (ADT) that defines the behavior and properties of a queue data structure. |
A queue is a data structure that follows the First-In-First-Out (FIFO) principle and where the elements are added at the back and removed from the front of the queue. In a static queue, the size of the queue is fixed at creation time. | A stack is a data structure that follows the Last-In-First-Out (LIFO) principle and where the elements are added and removed from the top of the stack. In a static stack, the size of the stack is fixed at creation time. |
A data structure is a way of organizing and storing data in a computer program so that it can be accessed and used efficiently. | An array is a collection of elements of the same data type ordered sequentially in memory and identified by a common name. |
Implementation | Push |
Pop | Enqueue |
Dequeue | Time Complexity |
Big O Notation | Space Complexity |
The operation to add an element to the top of a stack. | The process of putting a decision or plan into effect by performing specific actions and operations. |
The operation to add an element to the back of a queue. | The operation to remove and return the top element from a stack. |
The amount of time required by an algorithm to complete its execution as a function of the size of the input data. | The operation to remove and return the front element from a queue. |
The amount of memory required by an algorithm to complete its execution as a function of the size of the input data. | A mathematical notation that describes the upper bound of the time complexity of an algorithm in terms of the size of the input data. It is used to compare the performance of different algorithms. |
Linked list | Node |
Singly linked list | Doubly linked list |
Circular linked list | Traversal |
Insertion | Deletion |
An object that contains data and a reference to the next node in the sequence. | A data structure consisting of a group of nodes in which each node has a reference to the next node in the sequence. |
A linked list in which each node has a reference to both the next and previous nodes in the sequence. | A linked list in which each node only has a reference to the next node in the sequence. |
The process of visiting each node in a linked list in order. | A linked list in which the last node has a reference to the first node in the sequence, forming a loop. |
The process of removing a node from a linked list. | The process of adding a new node to a linked list. |
Head | Tail |
Memory allocation | Real-life application |
Linked List | Node |
Pointer | Singly Linked List |
The last node in a linked list. | The first node in a linked list. |
A practical use or example of linked lists, such as representing playlists in a music player or bookkeeping in accounting software. | The process of reserving memory for nodes in a linked list. |
An element in a linked list that stores a value and a pointer to the next (and/or previous) node. | A data structure in which elements are linked using pointers to form a sequence of nodes. |
A linked list in which each node contains only one pointer to the next node in the sequence. | A variable that stores the memory address of another variable or object. |
Doubly Linked List | Circular Linked List |
Head | Tail |
Traversal | Insertion |
Deletion | Notation |
A linked list in which the last node points back to the first node in the sequence, forming a circular loop. | A linked list in which each node contains two pointers, one to the next node and one to the previous node in the sequence. |
The last node in a linked list. | The first node in a linked list. |
The process of adding a new node to a linked list at a specific position. | The process of visiting each node in a linked list in a specific order. |
A system for representing information, often in a symbolic or diagrammatic form. | The process of removing a node from a linked list at a specific position. |
parent | left-child |
right-child | subtree |
root | leaf |
binary tree | height |
The child node in a binary tree that is positioned to the left of its parent node. | A node in a tree structure that has one or more child nodes attached to it. |
A portion of a tree that can be viewed as a smaller tree in itself, as it contains its own root and descendants. | The child node in a binary tree that is positioned to the right of its parent node. |
A node in a tree structure that does not have any child nodes attached to it. | The top node of a tree structure from which all other nodes descend. |
The number of edges on the longest path from a node to a descendant leaf node. | A tree structure in which each node has at most two child nodes. |
depth | ancestors |
descendants | level |
Tree traversal | Inorder traversal |
Postorder traversal | Preorder traversal |
Nodes on the path from the root node to a given node. | The number of edges on the path from the root node to a given node. |
The distance from the root node to a node, where the root node is level 0. | Nodes that are reachable from a given node by following descending edges. |
A method of traversing a binary tree such that the left subtree is visited, then the root, then the right subtree. | The process of visiting each node in a tree data structure exactly once, in a systematic order. |
A method of traversing a binary tree such that the root is visited, then the left subtree, then the right subtree. | A method of traversing a binary tree such that the left subtree is visited, then the right subtree, then the root. |
Depth-first traversal | Breadth-first traversal |
Traversal order | Inorder result |
Postorder result | Preorder result |
Traversal algorithm | Recursive traversal |
A method of traversing a tree data structure where all nodes at a given depth are visited before moving on to nodes at the next depth. | A method of traversing a tree data structure where each branch is visited as far as possible before backtracking. |
The sequence of nodes visited during an inorder traversal of a binary tree. | The sequence in which the nodes of a tree data structure are visited during a traversal. |
The sequence of nodes visited during a preorder traversal of a binary tree. | The sequence of nodes visited during a postorder traversal of a binary tree. |
A traversal algorithm that uses recursion to visit nodes in a tree data structure. | A specific method for traversing a tree data structure, such as inorder, postorder, or preorder traversal. |
Binary tree | Node |
Root | Parent |
Child | Leaf |
Binary search tree | Complete binary tree |
A basic unit of a tree that contains data and one or more references to other nodes. | A tree data structure in which each node has at most two children, referred to as the left child and the right child. |
A node that has one or more child nodes. | The topmost node of a tree, from which all other nodes are descended. |
A node with no children. | A node directly connected to another node when moving towards the root. |
A binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. | A binary tree where the left child of a node contains items that are less than the node's item and the right child contains items that are greater than the node's item. |
Perfect binary tree | Balanced binary tree |
Sketch | Identify |
Dynamic data structure | Advantages |
Disadvantages | Array |
A binary tree where the height of the two subtrees of every node differ by no more than one. | A binary tree where all interior nodes have two children and all leaves have the same depth. |
To recognize or distinguish something from others by features or characteristics. | To draw a rough or unfinished version of something. |
Benefits gained from using dynamic data structures, such as flexibility and efficiency of memory allocation. | A data structure in which the size can be modified during the execution of a program. |
A dynamic data structure that represents a collection of elements in contiguous memory locations. | Drawbacks of dynamic data structures, such as extra programming complexity and potential memory leaks. |
List | Stack |
Queue | Linked list |
Dynamic memory allocation | Pointer |
Memory management | Garbage collection |
A dynamic data structure that implements the Last-In-First-Out (LIFO) principle for adding and removing elements. | A dynamic data structure that represents a collection of elements that are not necessarily stored in contiguous memory locations. |
A dynamic data structure in which each element contains a reference to the next element in the list. | A dynamic data structure that implements the First-In-First-Out (FIFO) principle for adding and removing elements. |
A variable that stores the memory address of another variable. | A process of allocating memory dynamically at runtime, as opposed to static memory allocation at compile time. |
A technique for automatic memory management that automatically identifies and frees unused memory. | The process of allocating and deallocating memory in a program. |
Static Data Structure | Dynamic Data Structure |
Array | Linked List |
Stack | Queue |
Static Memory Allocation | Dynamic Memory Allocation |
A data structure that can change its size dynamically during program execution. | A data structure that has a fixed size, and its size cannot be changed at runtime. |
A collection of elements that are not stored at contiguous memory locations. Each element points to the next element by means of a pointer. | A collection of elements of similar data type stored in contiguous memory locations. |
A linear data structure in which elements can be added at one end and removed from the other end. | A linear data structure in which elements can be added and removed only from one end, called the top. |
The process of allocating memory to a variable at runtime using functions such as malloc and calloc. | The process of allocating a fixed amount of memory to a variable at compile time. |
Advantages of Static Data Structures | Advantages of Dynamic Data Structures |
Disadvantages of Static Data Structures | Disadvantages of Dynamic Data Structures |
Flexible, can change size at runtime, can save memory space. | Fast access, efficient memory usage, better cache performance. |
May require more time to access elements, risk of memory leaks if memory not released properly. | Limited size, wastage of memory space if the structure is not fully utilized. |