IB Computer Science HL Paper 1 Topic 5

studied byStudied by 4 people
0.0(0)
Get a hint
Hint

Recursion

1 / 14

15 Terms

1

Recursion

  • A method that calls itself

  • Involves the use of stacks to store data that will be returned at end

  • Can be memory intensive if many recursive calls are made

New cards
2

Characteristics of a stack

  • A data structure

  • LIFO

  • dynamic

New cards
3

Stack access methods

  • push()

  • pop()

  • isEmpty()

New cards
4

Characteristics of a queue

  • FIFO

  • dynamic

New cards
5

Queue access methods

  • enqueue()

  • dequeue()

  • isEmpty()

New cards
6

Real world examples of queues

  • Printer queues

  • Computer modelling of real-life queues (like in supermarkets)

New cards
7

Linked lists

  • Linear collection of nodes, which are self-referential

  • Nodes connected by pointer links

New cards
8

Features of a doubly linked list

  • Single head, single tail

  • Each node has two pointers - one to next, one to previous

<ul><li><p>Single head, single tail</p></li><li><p>Each node has two pointers - one to next, one to previous</p></li></ul>
New cards
9

Features of a circular linked list

  • Single head

  • One pointer for each element

  • Last element’s pointer points to head

New cards
10

Binary trees

knowt flashcard image
New cards
11

Parent

  • A node in a tree that has children (left, right or both)

New cards
12

Root

  • The top node in a tree

New cards
13

Subtree

  • A parent with children within another parent-child relationship

New cards
14

Dynamic data structures pros and cons

Pros

  • Can change size while program is running

  • Makes efficient use of memory

  • Storage no longer required can be returned to the system for other use

Cons

  • Difficult to program

  • Can be slow / complex to implement

  • A linked list only allows serial (in order) search

New cards
15

Static data structures pros and cons

Pros

  • Easy to program

  • Easy to check for overflow

  • An array allows random access

  • Does not change in size while program is running

Cons

  • Can waste space

  • Programmer has to estimate space needed, could be wrong

New cards

Explore top notes

note Note
studied byStudied by 9 people
... ago
5.0(1)
note Note
studied byStudied by 275 people
... ago
5.0(6)
note Note
studied byStudied by 5 people
... ago
5.0(1)
note Note
studied byStudied by 202 people
... ago
5.0(1)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 20 people
... ago
5.0(2)

Explore top flashcards

flashcards Flashcard (175)
studied byStudied by 6 people
... ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 6 people
... ago
5.0(1)
flashcards Flashcard (100)
studied byStudied by 20 people
... ago
5.0(1)
flashcards Flashcard (73)
studied byStudied by 22 people
... ago
5.0(1)
flashcards Flashcard (28)
studied byStudied by 16 people
... ago
4.0(1)
flashcards Flashcard (60)
studied byStudied by 14 people
... ago
5.0(1)
flashcards Flashcard (101)
studied byStudied by 13 people
... ago
5.0(1)
flashcards Flashcard (116)
studied byStudied by 7 people
... ago
5.0(1)
robot