computer science programming paper Flashcards
what is a register
a temporary memory location located inside the CPU which is used for a single purpose
compare the efficiency of using a binary tree to a linked list when searching
the binary tree is more efficient as it removes half of the values at a time where a a linked list has to go through every single value
Compare the efficiency of a binary search tree to a hash table when searching for data.
binary tree is less efficient than a hash table, a hash table can find data immediately without having to look at other values
what is an object
an instantiated class
recursion
this a programming construct where the subroutine calls it self during execution
heuristics
a non-optimal way of solving a problem this finds an approximate solution TO A PROBLEM WHICH IS TIME CONSUMING
performance testing
eliminates the need for true performance testing by providing mathematical methods to test on a variety of load son different operating systems
what is the MAIN difference between functions and procedures
a function RETURNS a value
what is the difference between branching and iteration
branching decides which code is run and only runs the code once
how to remove form a tree
find the node
replace the content of node with null
add to empty list
similarities between trees and graphs
both made of nodes
both are connected by links
differences between tree and graphs
trees are one directional
trees will not be weighted(edges)
differences between recursion and iteration
recursion uses more memory iteration uses less
recursion can run out of memory while iteration cannot run out of memory
what are preconditions
requirements which must be met before a program can be executed
what is caching
storing instruction which have been used as they may be used again
what are the limitations of caching
larger cache takes longer to search so cache size limits how much data can be stored
reusable components (advantages)
subroutines- arguments can be changed to obtain a different output
saves money time and resources
what is thinking procedurally
writing a program a lot simpler by breaking down each component of the problem into smaller parts(subroutines)
what is the ultimate aim of thinking procedurally
breaking down a problem until each subproblem can be represented by a single task
what is concurrent thinking
the process of completing related tasks at the same time
what is concurrent processing used by
multicore processors
what are the benefits of concurrent processing
number of tasks completed in a given time is increased
less time wasted waiting for an input or user interaction
what are the drawbacks of concurrent processing
switching between tasks reduces programming throughput
when a large sample is dealt with it will take longer to complete as it cannot be completed at once
there are some scenarios where this type of thinking will not be suited as some problems cannot be broken down into concurrent tasks
what are the three features of IDE
stepping - this allows to monitor the effect of each individual line of code
debugging - provides run-time detection of errors which can show where in the code it occurred
breakpoint- this allows programmers to choose points where the program stops, this can help pinpoint logical errors