Unit 5 test Flashcards
What is the most efficent algorithm
binary, sequential,bubble,selection
What is Big o notation
it is the measure of the efficency of an algorithm, it describes the relationship of the runtime and how it will scale with certain input variables
What does efficency mean?
efficency is the amount of computer resources required to perform its function, minimizing the amount of computer resources used such as the cpu is important
what is correctness
correctness is the extent of which the algorithm satisfies its specification free from fault and fulfills its objectives determined during the design of the algorithm
what is reliability
reliability is the capability of the algorithm to maintain a predefined performance level
what is flexibility
the effort required to modify the algorithm for a different purpose
explain bubble sort
bubble sort is a sorting algorithm thats purpose is to sort values in different orders such as ascending, descending, and alphabetical, it does so by comparing adjacent values and exchanging them if they are not in the correct order
explain selection sort
selection sort is another type of sort that sorts numbers by creating two sections, one being a sorted section and the other being an unsorted section, in doing so , the algorithm loops and finds the lowest or highest number in the array depending on how the array is going to be sorted and replaces it with the leftmost value in the unsorted section and does so till all the values in the array are sorted
explain binary search
binary search is an algorithm that searches for a certain value by narrowing down the possible values by dividing, if a value is greater than the middle value all values less than that will be ignored and will keep doing so till the middle value is the target value
explain sequential search
sequential search is an algorithm that iterates through each value in an array till the target value is found
outline the difference between sequential search and binary search
the difference between sequential search and binary search is that sequential search does not require the array to be sorted.
outline the difference between bubble sort and selection sort
the difference between bubble sort and selection sort is that buble sort compares adjacent values and exchanges them while selection sort searches for the minimum or maximum value and replaces it with the leftmost value in the unsorted section.