Arrays, Searching & Processing features Flashcards

1
Q

What is an Array?

A

Arrays are storage structures for computers that store variables.

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

What is a 1 dimensional array?

A

A storage structure with many storage locations addressable by index number.

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

Characteristics of a Binary search.

A

A search that can only be carried out on a sorted list.

Extremely fast, however if list is not sorted it does mean an additional overhead.

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

How does a Binary search work?

A

A Binary search works by dividing a sorted list in half each time a comparison is made. It will rarely require more that 4 or 5 comparisons regardless of items searched.

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

When is Binary search necessary?

A

Binary search is necessary when going through large data sets, however it can be very hard to program.

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

Characteristics of a Linear search.

A

Only way to search unsorted data.
Slow but simple, very easy to implement.
If data set is small can be just as acceptable as a binary search.
Requires N comparisons to search N data items.

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

How does a Linear search work?

A

Start with item 1: Is this what we’re looking for? No? Let’s try the next item. R peat until item is found or data is finished.

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

The four processing features of a programming language?

A

Instructions, Procedures, Methods and Functions.

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

What is an Instruction?

A

An instruction is a statement that describes and action that a program should carry out.

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

What is a Procedure?

A

A Procedure is a self-contained group of instructions that together, carry out a specific task. Also may be known as subroutine or modular.

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

Benefits of Modular programming?

A

Debugging is easier since areas can be more easily located.
Avoids duplication.
Useful procedures can be re-used.

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

What is an important feature of Procedures?

A

An important feature of Procedures is that variables are completely local and have no effect on similarly named variables in the main program or other procedures.

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

What is a Method?

A

A Method is an action that can be carried out on an object of a given class. Objects have pre-defined methods, and custom methods can be added to classes.

E.g show, bring to front, refresh.

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

What is a Function?

A

A Function is a procedure that calculates and returns a value.

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

What are the three Control Structures?

A

Selection Structure, Iteration Structure and Sequence Structure.

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

What is a Selection Structure?

A

Selection Structure is structure which decides wether to execute code, based on a defined condition.

The most obvious examples of this are IF, THEN, ENDIF.

17
Q

What is an Iteration Structure?

A

Iteration Structure is any looping structure such as, FOR, NEXT, DO, WHILE, REPEAT, UNTIL.

18
Q

What is a Sequence Structure?

A

Sequence Structure simply means that lines are executed in the order they appear. GOTO, EXIT.