Data structure Flashcards

1
Q

name data structures

A

any type of array, such as arrays, arrays of records, 2D/3D arrays

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

Algorithms

A

procedure to solve a problem, any code that does something is an algorithm

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

priming read

A

setting the initial condition using a read statement

such as having the value determined outside of a loop by having user enter value and if stays the same unless its incorrect/needs to be changed

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

binary search

A

has to be in numbered order (ascending)
divides the data set by 2 and checks if the value is greater than or lower than the middle value
continues doing that until number is found

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

linear search

A

doesnt have to be in numerical order
is usually slower than binary for large data sets
just does through the data linearly to find out answer

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

bubble sort

A

Repeatedly steps through the input list element by element, comparing the current element with the one after it, swapping their values if needed.

basically compares elements with the one next to it and swaps if they need to be depending on the sort (ascending descending)

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

insertion sort

A

has a complete side and an incomplete side.
builds the final sorted array one item at a time by comparisons. It is much less efficient on large lists

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

selection sort

A

an effective and efficient sort algorithm based on comparison operations. It adds one element in each iteration. You need to select the smallest element in the array and move it to the beginning of the array by swapping with the front element.

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

multidimensional arrays, 2d/3d

A

2d array is an array that has 2 variables and is like a table, you give coordinates to find a value e.g. array(2,3)

3d array is the same as 2d array but there is another additional dimension so there will be 3 coordinates to give to find a value e.g. array(2,3,5)

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

array of records

A

array of records is an array that has multiple different arrays that can have diff data types as a normal array cannot have different data types. e.g. you can store customer birth date, firstname, phone number in the same array by using a record

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

sequential file

A

one in which the individual records can only be accessed sequentially, that is, in the same order as they were originally written to the file. New records are always added to the end of the file.

sequential file has be be accessed in a certain order

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

relative file

A

a file in which each record is identified by its ordinal position in the file (record 1, record 2 and so on). This means that records can be accessed randomly as well as sequentially: For sequential access, simply execute a READ or WRITE statement to access the next record in the file.

relative file can be accessed in any order, can edit anything in file

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

local variable

A

a variable that only gets effected locally and doesn’t have a value outside the loop/module also declared within the loop/module

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

global variable

A

value is declared outside loop/module and gets effected throughout the program so that the whole system can use that value

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

ebnf
()
|
{}
value shown without <>

<variable>
</variable>

A

() - groups terms
{} - loop 0 or more repetitions

<variable> - the terms that go with the variable are defined elsewhere
without <> - literal, write value as seen
| - OR

| - OR
</variable>

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

railroad
circle
rectangle

A

circle -literal, should be presented as it is seen
rectangle - use value from the areas it is declared