Data Structures- S7 Flashcards

1
Q

Array

A

A finite, ordered set of elements of the same type.

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

In a 1-dimensional array how would you write the pseudocode, when you want the fourth item in the array called Family

A

Family[4]

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

Tuples

A

a dynamic data structure where the elements do not have to be the same type, and the number of elements in tuple can increase or decrease.

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

What is a Record

A

A data type that allow you to store data permanently so you can read and update it at future dates. Often a database.

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

What does a file consist of?

A

A file consists of records and a record holds a number of fields.

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

What is Abstract data types?

A

data type created by the programmer rather than defined in a programming language. E.g queues, stacks

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

What is Static Data Structure?

A

a collection of data in memory that is fixed in size and cannot increase or decrease in size while the program is running.

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

What is a Dynamic Data Structure?

A

a collection of data in memory that has the ability to increase or decrease in size while a program is running.

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

What is a Queue?

A

An ordered collection of items where new elements are added at the end of a queue and removed from the front of the queue.

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

What are queues used for in Computing?

A

Queues are used for waiting to print (queue on disk), characters typed at a keyboard (keyboard buffer).

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

How do you push an item in a queue?

A

Check if full. If not then add one to the rear pointer, add item to rear and increase size of array

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

How do you pop an item?

A

Check if empty. If not return item at front pointer. Add one to the front pointer and decrease size of array by one.

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

How can you over come limitations on data size ?

A

Have a dynamic data structure, or do circular queue

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

What’s a list?

A

An abstract data type consisting of a number of items which may occur more than once.

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

What does array.index(3) do?

A

returns what position 3 is in

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

What does array.append(33) do?

A

will insert 33 at the end of the list

17
Q

What does array.insert(2,7) do?

A

inserts 7 in the second position and the rest shift

18
Q

What does array.pop() do?

A

remove and return the last item in the list

19
Q

What does array.remove(2) do?

A

will remove the first 2 to come up

20
Q

What is a Stacks?

A

Items are added to the top of the stack and removed from the front.

21
Q

When are stacks used?

A

Used to hold return addresses when subroutines are called, when you press back in browser and undo in word processing.

22
Q

What would you do to pop in a stack?

A

top=top-1

23
Q

What would you do to push in a stack?

A

top=top+1

24
Q

What is overflow?

A

What you try to push an item but it has already reached its maximum size

25
Q

What is underflow?

A

When you try to pop but there are not items

26
Q

2-dimensional array

A

A collection of data items of the same data type Under one identifier but uses two index numbers. The array has a name and a table that has co-ordinate points.