Logo/

Data Structures and Algorithms Quick Flashcards

Log in

Made with ScholarlyMake flashcards like these from your own notes

Data Structures and Algorithms Quick Flashcards

Questions and answers

49 cards
  1. Question:How are array elements stored in memory?

    Answer:Contiguously

  2. Question:Which of the following is not a linear data structure?

    Answer:Tree

  3. Question:Which notation describes the upper bound of an algorithm?

    Answer:Big O

  4. Question:Which of the following information holds true for an abstract data type?

    Answer:The ADT implementation is hidden

  5. Question:Which traversal of BST prints data in sorted order?

    Answer:Inorder

  6. Question:Inserting sorted elements into a BST results in?

    Answer:Skewed tree

  7. Question:The topmost node of a tree is called?

    Answer:Root

  8. Question:In a singly linked list, each node contains?

    Answer:Data and pointer to next node

  9. Question:The last node in a circular linked list points to?

    Answer:First node

  10. Question:A tree with a maximum of two children is a?

    Answer:Binary Tree

  11. Question:Which is a real-world example of a stack?

    Answer:Stack of plates

  12. Question:What does space complexity measure?

    Answer:Memory required during execution

  13. Question:If an algorithm takes constant time, what is its complexity?

    Answer:O(1)

  14. Question:Which of the following is an example of divide and conquer algorithm?

    Answer:Binary Search

  15. Question:Adding an element to a stack is called?

    Answer:Push

  16. Question:The number of edges from root to node is called?

    Answer:Depth

  17. Question:What is the main disadvantage of arrays?

    Answer:Fixed size

  18. Question:A stack follows which order?

    Answer:LIFO

  19. Question:What is a data structure?

    Answer:A way of organizing data for efficient use

  20. Question:What is the time complexity for accessing an element in an array?

    Answer:O(1)

  21. Question:How is time complexity measured?

    Answer:By counting the number of primitive operations performed by the algorithm on a given input size.

  22. Question:In inorder traversal, nodes are visited in which order?

    Answer:Left-Root-Right

  23. Question:Which of the following best describes an Abstract Data Type (ADT)?

    Answer:Logical description of operations

  24. Question:Which of the following operations has the best time complexity on an array?

    Answer:Accessing an element by index

  25. Question:Removing an element from a queue is called?

    Answer:Dequeue

  26. Question:Which data structure is best suited for implementing recursion?

    Answer:Stack

  27. Question:In a BST, the right subtree contains?

    Answer:Larger elements

  28. Question:A queue follows which order?

    Answer:FIFO

  29. Question:A doubly linked list has?

    Answer:Two pointers per node

  30. Question:A full binary tree has?

    Answer:Every node with 0 or 2 children

  31. Question:In a binary search tree, which traversal yields nodes in descending order?

    Answer:Inorder (Right-Root-Left)

  32. Question:In preorder traversal, nodes are visited in which order?

    Answer:Root-Left-Right

  33. Question:A circular queue helps to?

    Answer:Reuse memory slots

  34. Question:Removing an element from a stack is called?

    Answer:Pop

  35. Question:What defines an algorithm?

    Answer:A step-by-step method to solve a problem

  36. Question:Why are data structures important?

    Answer:They help organize and manage data efficiently

  37. Question:Which of the following operations is inefficient in linked lists?

    Answer:Random access

  38. Question:The number of children of a node is called its?

    Answer:Degree

  39. Question:Which is a good example of a queue?

    Answer:Waiting line in a bank

  40. Question:Adding an element to a queue is called?

    Answer:Enqueue

  41. Question:What is the main advantage of linked lists over arrays?

    Answer:Dynamic size

  42. Question:In postorder traversal, nodes are visited in which order?

    Answer:Left-Right-Root

  43. Question:In a BST, the left subtree contains?

    Answer:Smaller elements

  44. Question:A two-dimensional array is also called?

    Answer:Matrix

  45. Question:What does time complexity measure?

    Answer:Execution time based on input size

  46. Question:What is the index of the first element in an array?

    Answer:0

  47. Question:What happens when you pop from an empty stack?

    Answer:Stack underflow

  48. Question:Nodes with no children are called?

    Answer:Leaves

  49. Question:Which of the following best describes the useful criterion for comparing the efficiency of algorithms?

    Answer:Both time and memory