what is inheritance?
child class takes attributes/methods from parent class
what is abstraction?
removing unnecessary details to focus on key part of problem.
what is concurrent processing?
multiple process executed at same time (independent of each other)
each give a slice of processor time
advantages of using a modular approach?
work easier to divide in a team
saves time -> work can be done in parallel
people can work in areas of expertise
break down problems into smaller sub problems
code can be reused in futur
easier to test before integrating and identify errors
what is meant by concurrent processing?
multiple processes being executed at same time. Which appear to happen simultaneously
Gives processes each a slice of processor time
Multiple processors each carrying out different processes
Differences between global and local variables
Local:
can be used as a parameter
data lost at end of module
same name used in other modules and no collisions
overwrite global variables
Global:
defined at start of program
exists though out the program
Recursion VS Iteration?
Recursion uses more memory
Recursion can run out of memory
Recursion can use less lines of code and call itself
Iteration harder to understand
Iteration doesn’t run out of memory
Merge sort vs Bubble sort?
Merge sort:
splits data into individual data.
sorts data as it is put back together
only goes through once -> faster
Bubble Sort:
moves through data in linear way
can go through multiple times
less efficient
stack (LIFO) commands
push -> add
pop -> remove
peek -> show top but dont remove
how do you add an item onto a stack?
check if stack is full (stack overflow) if so report error
incrament stack pointer
insert new item at location pointed to by pointer
how do you add an item onto a queue?
check if queue is full (queue overflow) if so report error
incrament back/tail pointer
insert new item at location pointed to by tail pointer
how do you remove an item from a stack?
check if stack is empty (stack underflow) if so output error
output data pointed at by pointer
decrement the pointer
how do you remove an item from a queue?
output data pointed at by front/head pointer
incrament the head pointer
Zuletzt geändertvor 8 Monaten