Paper 2 extra Flashcards

1
Q

Describe how a leaf node is deleted from a binary search tree

A

Search/traverse tree until the required node is found
* Set the parent node pointer to the leaf node to null
* Add the deleted node to the free storage list // leave for garbage clear up

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

What is problem recognition

A

Problem recognition is identifying that there is a
problem to be solved, to determine exactly what the
problem is from a description/scenario and to
determine if the problem can be solved with
computational methods

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

What does problem recognition DO

A

Identify things

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

What does free list pointer do

A

Represents the next available space in the linked list

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

How is a value added to a linked list

A

Check to make sure freelist pointer is not null, add new data item to index (freelist pointer) , update free list pointer to location that new data item pointer is pointer at, update pointer from new data to null, update head pointer to indx of new data item (it depends basically if appending or prepending )

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

Final feature of recursive algo

A

Each recursive call will create a new copy of the values in the function….
* ….and add all of the values of the copy the call is being made from to a stack

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

What does big o measure

A

Number of steps and memory usage change according to amount of data as it increases

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

Linear

A

Grows in proportion to amount of data

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

Exponential

A

Rate of increase is at the rate k^n

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

Logarithmic

A

– means the rate of
increase gets smaller as the
amount of data increases time /
time increases at a rate of logkn
as n increases.

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

Advantages of concurrent processing (do not say allows more processes to be completed)

A

More efficient processor use // Less idle time for processor // Greater
throughput
* Long running tasks do not delay short running tasks
* Tasks requiring preconditions can wait and then resume execution
* User is able to interact with the computer while other tasks are running

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

Describe merge sort

A

The data list is split into two lists
* These sublists continue to be (recursively) split…
* …until each sublist is one item
* The first element in two different sublists is compared…
* …the smaller item is then selected…
* …and written to a new list
* …until both sublists fully merged
* Repeated until all sorted sublists are recombined

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

Benefits of merge sorts to bubble

A

More efficient time complexity (for large data sets) // takes fewer steps to sort
the data
* Time complexity O(n log n), rather than O(n2
)

  • Uses divide and conquer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What can merge sort do that buble sort cant

A

Can apply concurrent processing to reduce sorting time

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

Drawbacks of merge compared to bubble

A

More difficult to implement // needs more complex code
* Less efficient space complexity // uses more memory with more data items
* Space complexity of O(n)/linear, rather than O(1) / constant
* Merge sort is always O(nlog2n) whereas the best case for bubble sort is O(n)

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

IDE (what are error diagnostics)

A

Locate and fix errors

17
Q

IDE (Breakpoitns)

A

Stop a program running at a point to check variables

18
Q

What is syntax highlighting (IDE)

A

To identify kew words, variables and help identify syntax errors

19
Q

Stepping

A

… run the program line by line to check variable values at each stage

20
Q

Variable watch window

A

…view how variables change while the program executes

21
Q

Benefits of abstraction

A

Simplifies problem so easier to solve and allows progremamers to focus on core aspects

22
Q

Benefits of OOP

A
  • …inheritance can be to extend upon existing
    classes
  • …as a class can be based on an existing class
  • Better for coding as part of a team…
  • …as classes can be distributed between team
    members.
23
Q

Why is OOP easier to debug

A
  • …debugging can be easier as encapsulation
    limits how attibutes are changed.
24
Q

Why is OOP easier to maintain

A

as classes can be modified or extended

25
Q

When does dijstras not work

A

For edges with a negative weight value

26
Q

For next i and next j should it go on same indent as when you define it or further along

A

Same indent

27
Q

What is a stakc underflow

A

An error condition that occurs when an item is called for from the stack, but the stack is empty.

28
Q
A