# Data Structures Flashcards
Table of Contents
- Data Structures Flashcards
Data Structures Flashcards
Array drill data_structures
Front
What is an array in data structures?
Back
An array is a collection of elements stored at contiguous memory locations, each identified by an index or a key.
Linked List drill data_structures
Front
What is a linked list?
Back
A linked list is a linear data structure where elements are stored in nodes, and each node points to the next node in the sequence.
Stack drill data_structures
Front
Describe a stack and its primary operations.
Back
A stack is a Last-In-First-Out (LIFO) data structure. Primary operations are:
- Push: Add an element to the top
- Pop: Remove the top element
- Peek: View the top element without removing it
Queue drill data_structures
Front
What is a queue and its main operations?
Back
A queue is a First-In-First-Out (FIFO) data structure. Main operations include:
- Enqueue: Add an element to the rear
- Dequeue: Remove an element from the front
- Front: View the front element without removing it
Tree drill data_structures
Front
What is a tree in data structures?
Back
A tree is a hierarchical data structure consisting of nodes connected by edges. It has a root node and subtrees of children with a parent node.
Binary Search Tree (BST) drill data_structures
Front
What are the key properties of a Binary Search Tree?
Back
- Each node has at most two children
- The left subtree of a node contains only nodes with keys less than the node's key
- The right subtree of a node contains only nodes with keys greater than the node's key
- Both left and right subtrees must also be binary search trees
Hash Table drill data_structures
Front
What is a hash table and its primary benefit?
Back
A hash table is a data structure that implements an associative array abstract data type, a structure that can map keys to values. Its primary benefit is providing fast (O(1) average case) insertion, deletion, and lookup operations.
Graph drill data_structures
Front
What is a graph in data structures?
Back
A graph is a non-linear data structure consisting of vertices (or nodes) and edges that connect these vertices. It is used to represent networks, relationships, and connections between objects.
Heap drill data_structures
Front
What is a heap and its types?
Back
A heap is a specialized tree-based data structure that satisfies the heap property. Two types are:
- Max Heap: Parent nodes are always greater than or equal to their children
- Min Heap: Parent nodes are always less than or equal to their children