Computer Science: Data Structures
Arrays, linked lists, stacks, queues, trees, and hash tables — the building blocks of efficient programs.
Study these flashcards with spaced repetition
Track your progress, master difficult cards, and export to Anki. Free to start.
Start Studying — FreeFlashcards in This Deck
What is the time complexity of accessing an element by its index in an array?
O(1) or constant time, because the memory address can be calculated directly using the base address and the index.
Explain the LIFO principle as it relates to the Stack data structure.
LIFO stands for Last-In, First-Out, meaning the most recently added element is the first one to be removed.
What is the primary difference between a Queue and a Stack in terms of data access?
A Queue follows FIFO (First-In, First-Out), while a Stack follows LIFO (Last-In, First-Out).
What property must every node in a Binary Search Tree (BST) satisfy?
For any node, the value of all nodes in its left subtree must be less than its value, and all nodes in its right subtree must be greater.
How does memory allocation differ between Arrays and Linked Lists?
Arrays use contiguous memory blocks, whereas Linked Lists use non-contiguous nodes connected via pointers.
What is the time complexity of inserting a new node at the head of a Singly Linked List?
O(1) or constant time, as it only requires updating the new node's next pointer and the head pointer.
Describe the 'Chaining' method for resolving collisions in a Hash Table.
Chaining involves storing all elements that hash to the same index in a secondary data structure, typically a linked list, at that bucket.
What is the Max-Heap property in a binary heap?
The value of each parent node must be greater than or equal to the values of its children, ensuring the maximum element is at the root.
What is the space complexity of representing a graph with V vertices and E edges using an Adjacency Matrix?
O(V^2), because it requires a 2D array of size V x V regardless of the number of edges.
How can a Stack be utilized to reverse the characters in a string?
Push every character of the string onto the stack, then pop them off one by one to form the reversed string.
+10 more cards — sign up to see all
Frequently Asked Questions
How many flashcards are in this Computer Science: Data Structures deck?
This deck contains 20 flashcards with a mix of difficulty levels: 6 easy, 10 medium, and 4 hard cards.
Is this flashcard deck free to use?
Yes! You can study these flashcards for free with our spaced repetition system. Create a free account to track your progress and save your study history.
Can I export these flashcards to Anki?
Pro users can export any deck to Anki (.apkg format) with one click. Free users can export to CSV. Start studying for free and upgrade when you need Anki export.
What is spaced repetition?
Spaced repetition is a study technique that shows you cards at increasing intervals based on how well you know them. Cards you struggle with appear more often, while mastered cards are shown less frequently. This is proven to be one of the most effective ways to memorize information.
Related Flashcard Decks
Ready to study?
Create a free account and start studying these flashcards with spaced repetition.
Get Started — Free