4.2.1 FoDS (Data strutures and abstract data types) Flashcards

1
Q

What is meant by the term data structure

A

A way of organising and storing data in a computer so that it can be accessed and modified

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is meant by an abstract data type

A

a conceptual model that describes how data is organised and which operations can be carried out on the data (e.g. insert, delete) from the perspective of an end user who does not need to know how this is implemented.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by a static data structure

A

A data structure that reserves memory for a set amount of data established by the programmer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the features of static data structures

A
  • Fixed in size making them memory inefficient
  • They can only contain one type of data
  • The contents can be changed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is meant by a dynamic data structure

A
  • A data structure that can increase or decrease in capacity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the features of dynamic data structures

A
  • Changeable capacity
  • No indexing so elements cannot easily be accessed (only through a sequential pass through the list)
  • Capacity is reliant on the memor allocated to the program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is meant by an array

A

A static data structure that represents a collection of the same type of data under a shared common name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are 1, 2, and 3D array useful for

A

1- A vector
2- Matrix
3+ - A set of elements that are indexed by a tuple of n intergers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a record

A

A grouped collection of related data containing fields under a single identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are binary files

A

Files that store data in binary, and follow a known format that can be read by a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are binary files used for and why

A
  • Image and videos
  • Music
  • programs
    As it is more compact and efficient for storage and speed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are text files used for and why

A
  • Human readable documents
    Because they are easy to understand and share
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What abstract data structures can be implemented using arrays and linked lists

A
  • Queues
  • Stacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What methods can be used to implement graphs

A
  • Arrays that are implemented as matrices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What methods can be used to implement trees

A
  • OOP, that objectifies nodess which has pointers to its children
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What methods can be used to implement Hash Tables and Dictionaries

A
  • array of linked lists
17
Q

What methods can be used to implement Vectors

A
  • An Arraylist
18
Q

What are the advantages of static data structures

A
  • Makes efficient use of memory as data structure only uses as much memory as it needs
19
Q

What are the disadvantages of static data structures

A
  • It runs the risk of overflow when the memory used exeeds the allowed limit
  • Harder to program with as you need to monitor the size and location of the data structure at all times
20
Q

What are the advantages of dynamic data structures

A

-Easier to program with as there is no requirement to check on the size of the data structure at any point before access
-Memory allocation is fixed which means there will be no modifying issues (overflow or underflow)

21
Q

What are the disadvantages of dynamic data structures

A
  • Can be very inefficient as memory for the data structure is set aside at the start of the program but might not be utilised