SHS Computing · Year 2

Main Memory, Trees, Graphs and Hash Tables practice questions

Features of RAM (capacity, speed and volatility) and the types DDR4, DDR5 and SDRAM, data types including characters and pointers, sequential, tree-based and graph-based data structures, binary trees and binary search trees, undirected, directed and weighted graphs, hash functions, hash tables, collisions with chaining and open addressing, and maps (dictionaries).

25 questions in this topic: 2 recall, 10 applying skills and concepts, 10 strategic thinking and 3 extended thinking. Every one carries a written explanation.

Sample questions

5 of 25 questions in this topic. Sign up to answer them and see the explanations.

  1. Question 1Strategic thinking

    A navigation app must find the shortest route between towns, where roads have different lengths. Which structure fits best?

    • aAn unweighted tree with the capital city at the root and every town as a leaf
    • bA weighted graph with towns as nodes and road lengths on the edges
    • cA queue of town names in the order the driver would like to visit them
    • dA stack of road names that is popped each time the driver reaches a junction
  2. Question 2Strategic thinking

    What does this Python code output? phone = {"0244": "Daniel", "0200": "Raphael"}; print(phone["0200"])

    • aDaniel
    • b0200
    • c{"0200": "Raphael"}
    • dRaphael
  3. Question 3Strategic thinking

    What does this Python code output? ages = {"Ama": 16, "Kofi": 17}; ages["Esi"] = 15; ages["Ama"] = 18; print(len(ages), ages["Ama"])

    • a3 18
    • b4 18
    • c3 16
    • d2 18
  4. Question 4Recall

    In a tree data structure, the topmost node is called the

    • aleaf
    • bedge
    • cchild
    • droot
  5. Question 5Strategic thinking

    The values 50, 30, 70, 20 and 40 are inserted in that order into an empty binary search tree. Which value is the left child of 30?

    • a40
    • b20
    • c50
    • d70

Answer these and 20 more on Main Memory, Trees, Graphs and Hash Tables

Free account. Instant marking, a written explanation for every question.

Start practising free

More Computing Year 2 topics

All Computing topics