← Computer Studies / 3 Software development

3.5 Data Structures

Computer Studies · Grade 10 · 14 lessons in the design

What this covers

  • The meaning of a data structure (container)
  • Lists and arrays, one- and two-dimensional
  • Tuples, sets and dictionaries
  • The syntax of data structures
  • Searching: sequential and binary search
  • Sorting: bubble, selection, insertion and quick sort

What you will be able to do

  • describe the types of container used in programming
  • use containers in programming
  • apply sorting and searching techniques in data structures
  • embrace the use of containers in programming

Key questions

“Why are containers used in programming?”

Lessons

The titles are open to everyone. Reading a lesson needs an account — sign in or create one.

  1. Containers: lists, tuples, sets and dictionaries
    40 min · 1 practice tasks · quiz
    What a data structure is, why containers are needed, and the four common ones - list, tuple, set and dictionary - with what each is for.
  2. Searching and sorting
    40 min · 1 practice tasks · quiz
    Finding an item with sequential and binary search, and arranging data with bubble, selection, insertion and quick sort - and why the two go together.
  3. List indexing and length
    40 min · 1 practice tasks · quiz
    Read items by index, find the last cell with len minus 1, and stop IndexError before it happens.
  4. Changing and growing a list
    40 min · 1 practice tasks · quiz
    Append, insert, overwrite, pop and remove - a class register that actually changes during the term.
  5. Strings as sequences of characters
    40 min · 1 practice tasks · quiz
    A string is a container of letters: index it, slice it, loop it - but do not try to overwrite a character.
  6. Arrays and one-dimensional lists
    40 min · 1 practice tasks · quiz
    An array is a fixed-size, same-type row; a Python list can grow and mix types. Declare, initialise, and choose.
  7. Two-dimensional lists: tables
    40 min · 1 practice tasks · quiz
    A list of lists is a grid. Two indices pick row then column; nested loops visit every cell of a marks table.
  8. Tuples: ordered and fixed
    40 min · 1 practice tasks · quiz
    A tuple keeps a short ordered group that must not change: a GPS pair, an RGB colour, or a date.
  9. Sets: unique items, no order
    40 min · 1 practice tasks · quiz
    A set drops duplicates and answers "is this in the collection?" quickly - a class of unique admission numbers.
  10. Dictionaries as records
    40 min · 1 practice tasks · quiz
    Look up a value by a name, not a position: a learner record, a kiosk price list, a phone book.
  11. Syntax of data structures
    40 min · 1 practice tasks · quiz
    The brackets are the type: [ ] list, ( ) tuple, { } set, { : } dictionary. Nested syntax and the empty-set trap.
  12. Sequential search in code
    40 min · 1 practice tasks · quiz
    Write a linear search that finds a name in a register, reports its index, and honestly says when it is not there.
  13. Binary search step by step
    40 min · 1 practice tasks · quiz
    Halve a sorted list of admission numbers until the target is the middle item - faster, but only after sorting.
  14. Sorting in practice
    40 min · 1 practice tasks · quiz
    Walk selection and insertion by hand, recall bubble and quick, then let sorted() do the job - and know why the method still matters.