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 10 people
... ago
5.0(1)
note Note
studied byStudied by 12 people
... ago
4.0(1)
note Note
studied byStudied by 5 people
... ago
4.0(1)
note Note
studied byStudied by 18 people
... ago
5.0(1)
note Note
studied byStudied by 13 people
... ago
5.0(1)
note Note
studied byStudied by 10 people
... ago
4.0(1)
note Note
studied byStudied by 23 people
... ago
5.0(1)
note Note
studied byStudied by 40070 people
... ago
4.8(312)

Explore top flashcards

flashcards Flashcard (201)
studied byStudied by 32 people
... ago
5.0(1)
flashcards Flashcard (64)
studied byStudied by 8 people
... ago
5.0(1)
flashcards Flashcard (22)
studied byStudied by 6 people
... ago
4.0(2)
flashcards Flashcard (42)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (91)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (35)
studied byStudied by 19 people
... ago
5.0(1)
flashcards Flashcard (32)
studied byStudied by 18 people
... ago
4.0(1)
flashcards Flashcard (45)
studied byStudied by 4 people
... ago
5.0(1)
robot