Algorithms Flashcards
What is NP HARD and NP complete
NP complete will not be solved in polynominal time and there is no current solution example of this is TRAVELLING SALESMAN
What is exhaustive search
Testing each possibility sequentially this is done in both NP hard and NP complete
What is polynomiaml time
This is a reasonable amount of time
What is faster oLogn or O(n)
O(LOGn)
What is faster O(n^2) or O(2n)
O(2n)
What is asymptotic notation
This is the notation that will allow us to measure the running time of an algorithm as the input increase
What is binary search
This is a search method that will break an array in half each time when looking for a key value the array that is presented must be in order.
This has a running time of O(LogN)
What is quick sort
This uses the pivoting algorithm that will split the arrays and sort them then place them back together
What is the fastest sorting and searching algorithm
Binary Search and Radix Sort
What is the time for bubble sort
O(n^2)
What is the time for binary search
O(logn)
What is the time for linear search
O(n)
what is LIFO and where is it used
STACKS
What is FIFO and where is it used
QUEUES
What is a hash table and where is it used ?
This is used to identify objects that are similar that are grouped toghether but need to be uniquley identified
What is a graph
A collection of nodes and edges that are relarted
What are the uses for a graph
Satellite navigation, developing networks, developing routes, tube station maps and times
What are the graph traversal algorithms ?
Breadth first search, Best first search, A*, Depth First search
What is the worst case scenario for exhaustive search
O((n-1)!)
What is depth first search ?
This is the process of exploring and back tracking until all nodes and paths on a graph have been visited
What is a heuristic and why would we use them ?
This is a generic guideline that we need to follow that will increase our performance when exploring the solution space
What is the fitness function >?
This is how good the current solution is within the solution space
What is a maximization problem ?
This is a problem where the higher the fitness the better
What are example of heuristics ?
Random mutation hill climbing