Fundamentals of data structures

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/47

flashcard set

Earn XP

Description and Tags

topic two on paper one aqa a level computer science

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

48 Terms

1
New cards

how is data stored/ organised on a computer

as a series of files that contain records that contain fields

2
New cards

what type of data structures are queues

a fifo data structure

3
New cards

what are the three types of queues

linear, circular and priority

4
New cards

what is a linear queue

a queue where items are added to the end and removed from the front

5
New cards

what is a circular queue

a fixed capacity queue where the position of front and back pointers change depending on when items are added or removed to the queue

6
New cards

what is a priority queue

essentially two linear queues, where one of the two queues is the priority queue, and items will only be removed from the ‘normal’ queue if the priority queue is empty

7
New cards

how does adding to a queue work?

increase the back pointer by one and add the new item to the position it now specifies, this changes slightly for circular and priority

8
New cards

how does removing from a linear or priority queue work?

obtain item from the front pointer and increment accordingly

9
New cards

how does removing from a circular queue work?

remove item at front pointer and move front pointer along (this may not always be (+1) since if front pointer reaches position 8 and the next position is 0 it will become position 0.

10
New cards

how to know If a queue is empty

if the front pointer is equal to the back pointer

11
New cards

how to know if a linear or priority queue is full

if the back pointer is equal to the massive - 1

12
New cards

how to determine If a circular queue is full?

if the back pointer + 1, mod the size = 0

13
New cards

what type of data structures are stacks

a FILO data structure

14
New cards

what does pop, peek and push do in terms of stacks?

pop - removes the top value of the stack, peek views the top value without removal, push adds a new value onto the top of the stack

15
New cards

how to determine if a stack is full?

use isFull

16
New cards

what type of data structure are graphs

an abstract data structure

17
New cards

what does abstract data structure mean

makes use of other data structures to make a better designed way of storing data

18
New cards

what doe graphs consist of

nodes and edges, with weighted or unweighted edges that can be directed or undirected

19
New cards

what are the two ways graphs can be represented

as an adjacency list or adjacency matrix,

20
New cards

what is an adjacency matrix

a table in which a 1 (or the weight of that particular edge) is used to indicate two nodes are connected, and zero or infinity shows a lack of connection

21
New cards

what is an adjacency list

where the node, followed by the nodes it is connected to and their respected weights are stored as a list

22
New cards

what is the advantage of an adjacency list as opposed to an adjacency matrix

can use up less memory as only edges are stored, whereas this is not the case for an adjacency list

23
New cards

what is the advantage of an adjacency matrix

can be easier to query as not all nodes have to be sorted through whereas a list has to be stored sequentially

24
New cards

what is a tree

a connected undirected graph with no cycles

25
New cards

what is a binary tree

a tree where the maximum number of child nodes is two

26
New cards

what is a rooted tree

where the parent node is called the root, the nodes, stemming off of the the parent node are called child nodes, and child nodes with no nodes stemming off of them are called leaf nodes

27
New cards

what is a hash table

a table that stores key pair values, where the input is the key and the resulting hash is the value

28
New cards

what is a hashing algorithm

an algorithm that takes an input and returns a hash value that cannot be reversed

29
New cards

what is an example of a use of hashing algorithms

in passwords so that they cannot be retrieved

30
New cards

what is a collsiion in terms of a hash table

when two inputs result in the same hash, resulting in data being overwritten as they would be stored in the same locatio

31
New cards

what is the solution to a collision in hashing

rehashing

32
New cards

how does rehashing work?

by finding an available position in the table to store this hash according to an agreed procedure

33
New cards

what is an example of a rehashing procedure

moving along the table to find the next available location

34
New cards

what is a dictionary

a collection of key pair values, where the value is accessed by its key

35
New cards

what is dictionary based compression

where frequently used words are stored in a dictionary, and displayed as a series of keys.

36
New cards

how are vectors represented (definition version)

as a list of numbers, a function, or a geometric point in space

37
New cards

what are vectors used for

to reprisent spacial information and movement

38
New cards

how can vectors be represented?

as a list of numbers, as a dictionary, as a function or as a one dimensional array

39
New cards

what are the two methods of vector representation that are referred t as 4 vector over R

  • lists

  • dictionaries

40
New cards

what is translation in terms of vectors

vector addition

41
New cards

what is scalar vector multiplication

changing the magnitude of a vector based on a scalar value

42
New cards

what is convex combination in terms of vectors

where two vectors a and b are presented in the way ax + by, where both a and b are non zero values that add to make 1

43
New cards

what is convex combination used for

to produce the linear combination of two vectors

44
New cards

what is dot/ scalar product, in terms of vectors

multiplying the contents of each vector and adding them together, this is used to determine the angle between them

45
New cards

what is a static data structure

a fixed size data structure where data is stored sequentially

46
New cards

what is a dynamic data structure

a data structure that grows or shrinks to accommodate demands

47
New cards

what are the disadvantages static data structures

overflow error, potentially wasted memory allocation

48
New cards

what are the disadvantages of dynamic data structures

could potentially require more memory as position where data is stored needs to also be stored