3. Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What does the binary search look like?

A

array myIntegers[5] = [12, 16, 19, 22, 25]
start = 0
end = 4
found = false
input searchItem(“Please enter search item”)
midPoint = 0
while (found == false AND start <= end)
midPoint = (start + end) DIV 2
if (myIntegers[midPoint] == searchItem) then
found = true
elseif (myIntegers[midPoint] > searchItem)
end = midPoint - 1
else
start = midPoint +1
endif
endwhile

if (found == true) then
print(“Item found at “ + midPoint)
endif

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

What does a bubble sort look like?

A

temp = 0
for i = 0 to arr.length-1
swapped = false
for j = 1 to arr.length - 1 - i
if (arr[j-1] > arr[j]) then
temp = arr[j-1]
arr[j-1] = arr[j]
arr[j] = temp
swapped = true
endif
next j
if (swapped == false) then
break
endif
next i

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

What does a insertion sort look like?

A

array myNumbers[4]

for (i = 1 to myNumbers.length – 1)
key = myNumbers[i]
j = i - 1
while (j >= 0 AND myNumbers[j] > key)
myNumbers[j + 1] = myNumbers[j]
j–
endwhile
myNumbers[j + 1] = key
next i

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

Pros of insertion sort?

A

Easy to implement
Good for small data sets that are almost sorted
Insertion sort generally performs quicker than bubble sort and is therefore preferable.

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

Cons of insertion sort?

A

Does not scale well so is not good for large data sets.

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

What is caching?

A

The process of storing previously used data in a location (cache) so that it can be quickly accessed to speed up retrieval if it is needed in future.

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

What is a library?

A

A collection of reusable subroutines that a programmer can “call” when writing code so that the programmer doesn’t have to write this code.

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

What are reusable components?

A

The use of existing assets in some form within the software product development process including code eg subroutines, designs and documentation.

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

What is pre-fetching?

A

Data is fetched and stored in a cache or buffer before it is needed. For example when streaming a video file, successive seconds/minutes of stream data are buffered. Algorithms must be able to correctly predict what will be needed.

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

Explain CPU cache?

A

Cache on CPU is faster to access frequently used data/instructions. This is because it’s physically located on the chip, cache uses SRAM not DRAM which is used for main memory.

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

Pros of CPU cache?

A

faster response time.

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

Cons of CPU cache?

A

small size
SRAM is expensive and fixed size.

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

What is the HDD cache (HDC)?

A

When requesting data, the HDD checks the HDC first before moving the slower mechanical parts for main memory, so is faster.

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

Pros of HDC?

A

faster response time

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

Cons of HDC?

A

small and fixed size

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

Pros of reusable components?

A

Saves time and resources, as every programmer doesn’t need to recode it.
Can sell code to a 3rd party, developer gets money, user knows it’s going to work.
Increased dependability, it has been tried and tested.
A particular element can be written by a specialist.
Update one library and every program that uses it is updated.

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

Cons of reusable components?

A

Must be available in the required language.
Some programmers will prefer to write their own code.
The reusable components have to be stored somewhere accessible.
You have to find, understand and possibly adapt the reusable component.

18
Q

LAN?

A

Small geographical area, equipment owned by the company that uses it, used in unis, schools, hospitals, a building.

19
Q

WAN?

A

Large geographical area, across a country, usually owned by companies such as BT.

20
Q

What are protocols?

A

They are a set of rules that allow transmission between devices.

21
Q

Examples of protocols?

A

TCP, IP, DNS, HTTP/S

22
Q

What are standards?

A

they form the fundamental building blocks for product development by establishing consistent protocols that can be universally understood and adopted.
Without standards only hardware and software of the same company could be used.

23
Q

Examples of standards?

A

HTML, Bluetooth.

24
Q

What are all the LMC codes?

A

LDA
INP
OUT
STA
ADD
SUB
BRA
BRZ
BRP
HLT

DAT

25
Q

What is the difference between BRA, BRP, BRZ?

A

BRA always branches.
BRP if positive or zero branches.
BRZ if zero.

26
Q

What does DAT do?

A

Data location stored.

Indirect mode - memory location that points to another memory location.
Indexed mode - A memory location with an index value added to it, like an array.
Direct mode - Use memory locations.
Immediate mode - Uses literal numbers.

27
Q

What is internet Censorship?

A

The deliberate control, suppression or banning of what can be accessed or published on the internet.

28
Q

What is an integrated development environment (IDE)?

A

A software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger.

29
Q

What is a translator, found in IDEs?

A

A program that converts code written in one programming language into functionally equivalent code in another language. Assemblers, compilers and interpreters are all translators.

30
Q

What are the common features of IDEs?

A

Code editing.
Integrations.
Extension and Plugins.
Debugging.

31
Q

What is data mining?

A

Collecting huge amounts of data and analysing it to find trends relationships between things.

32
Q

What is a system software?

A

Software that is needed to run the computer’s hardware and applications programs.

33
Q

What is application software?

A

Software that is a program designed for users rather than the computer.

34
Q

What are device drivers?

A

Software that allows communication with and control hardware, eg a mouse.

35
Q

What is an open source software?

A

Means anyone can see and edit the code, legally code.

36
Q

Pros of open source?

A

Free.
Large community, more collaboration.
Increased development.

37
Q

Cons of open source?

A

No warrants or guarantees.
small projects don’t get many updates.
Official customer support may not be available.

38
Q

What is an closed/prepiatry software?

A

Source code isn’t available outside the organisation. Have to have a licence to access it. Modifying, copying or redirecting the software is illegal.

39
Q

Pros of closed source?

A

Warrantee or guarantee.
Customer support.
Tested and reliable.
Easier to install and use for the average user.

40
Q

Cons of closed source?

A

Source cannot be accessed or modified by users.
Expensive.
Not exactly what you want it to do.
Older versions may not be supported.