B2.2 Data structures - IB Diploma Class 11 Computer Science Notes, Diagrams and Solved Questions

Storing many values under one name in Python and Java: static arrays and dynamic lists, ArrayList, two-dimensional arrays, and the stack (LIFO) and queue (FIFO) with their operations, plus how to pick the right structure for an algorithm.

In this chapter

  • Static vs dynamic data structures and when to use each
  • Creating, accessing, updating, iterating and searching 1D arrays
  • Python lists and Java ArrayList operations
  • Two-dimensional arrays processed with nested loops
  • Stacks: push, pop, peek, isEmpty and LIFO
  • Queues: enqueue, dequeue, front, isEmpty and FIFO
  • Using a stack to check brackets, and choosing a structure for a task
  • Iteration 3: array-based stacks, circular queues and grid processing