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