Data Structures: 36 flashcards

All 36 flashcards from this kit, free and with no sign-up.

1. What is a data structure?

Show the answer

A method of organizing and storing data so it can be used efficiently for processing, retrieval, updating, and deletion.

2. Name the four components every data structure carries.

Show the answer

Data, storage representation, operations, and access methods.

3. What are primitive data structures? Give examples.

Show the answer

Atomic single-value types provided by the language: int, char, float, bool, pointer.

4. What are non-primitive data structures? Give examples.

Show the answer

Structures that organize collections of values: array, stack, queue, linked list, tree, graph, heap, trie.

5. Is an array primitive or non-primitive? Why?

Show the answer

Non-primitive — it stores primitive values but organizes multiple items into a collection.

6. Define a linear data structure.

Show the answer

A structure where elements are arranged sequentially, each having one predecessor and one successor (except first and last).

7. Give four examples of linear data structures.

Show the answer

Array, Stack, Queue, Linked List.

8. Define a non-linear data structure.

Show the answer

A structure where one element can connect to many others, forming hierarchies or networks.

9. Give three examples of non-linear data structures.

Show the answer

Tree, Graph, Trie (also Heap).

10. What is a static data structure?

Show the answer

A structure that allocates memory at compile time and has a fixed size, e.g., int arr[100].

11. What is a dynamic data structure?

Show the answer

A structure that allocates memory at runtime using pointers and functions like malloc() and calloc().

12. What is the formula for the address of arr[i]?

Show the answer

$$\text{Address of } arr[i] = \text{base address} + (i \times \text{element size})$$

13. What is the time complexity of accessing an element in an array vs a linked list?

Show the answer

Array: $O(1)$ — direct address calculation. Linked list: $O(n)$ — must follow the chain.

14. What is the time complexity of inserting at the front of an array vs a linked list?

Show the answer

Array: $O(n)$ — all elements shift. Linked list: $O(1)$ — create a node and update two pointers.

15. What does LIFO stand for and which structure uses it?

Show the answer

Last In, First Out — used by the Stack.

16. What does FIFO stand for and which structure uses it?

Show the answer

First In, First Out — used by the Queue.

17. What is an Abstract Data Type (ADT)?

Show the answer

A logical description of what operations a data type supports and how they behave, without specifying implementation.

18. How does an ADT differ from a data structure?

Show the answer

ADT is the logical interface (what operations do); a data structure is the physical implementation (how they work).

19. Can the Stack ADT be implemented using different data structures?

Show the answer

Yes — it can be implemented using either an array or a linked list.

20. Which data structure maps to the undo button?

Show the answer

Stack (LIFO).

21. Which data structure maps to a railway counter line?

Show the answer

Queue (FIFO).

22. Which data structure maps to Google Maps navigation?

Show the answer

Graph — locations as nodes, roads as edges.

23. Which data structure maps to a folder system?

Show the answer

Tree — hierarchical parent-child relationships.

24. Which data structure maps to phone keypad autocomplete?

Show the answer

Trie — a prefix tree.

25. Which data structure maps to CPU task scheduling?

Show the answer

Priority Queue.

26. Which data structure maps to phone contact search?

Show the answer

Hash Table or Binary Search Tree.

27. Why are data structures the foundation of algorithms?

Show the answer

Sorting uses arrays/lists, recursion uses the stack, pathfinding uses graphs — the structure determines algorithmic efficiency.

28. What are the three independent lenses for classifying a data structure?

Show the answer

Primitive/non-primitive, linear/non-linear, static/dynamic.

29. Classify an array using all three lenses.

Show the answer

Non-primitive, linear, static.

30. Classify a linked list using all three lenses.

Show the answer

Non-primitive, linear, dynamic.

31. Classify a tree using all three lenses.

Show the answer

Non-primitive, non-linear, dynamic.

32. What happens if you forget to free() dynamically allocated memory?

Show the answer

A memory leak occurs — memory stays reserved but unusable.

33. Why can static data structures overflow?

Show the answer

Their size is fixed at compile time, so they cannot hold more elements than allocated.

34. What is the main advantage of contiguous storage in arrays?

Show the answer

Direct address calculation enables $O(1)$ random access.

35. What is the main disadvantage of scattered storage in linked lists?

Show the answer

Access is $O(n)$ because you must follow pointers from node to node.

36. Why does choosing the right data structure matter?

Show the answer

It can dramatically reduce execution time and memory usage — or make a correct algorithm unusably slow.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages