Algorithms Flashcards
What is an algorithm?
A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer
What do searching algorithms prevent you having to do
Search algorithms prevent you from having to look through lots of data to find the information you are serving for
What are the 2 main types of searching algorithms?
Serial search and binary search
What is serial search?
The most basic kind of search is serial search. The search starts with the first item and then moves to each item in turn, until either a match is found or it reaches the end of the data with no match found
What is binary search?
Binary search is a father method of searching for an item that is in an ordered list. Binary search takes the data and keeps dividing it in half until it finds the item itโs looking for.
What is an advantage of serial search?
It is very simple which makes it easy to write a computer program to carry out.
What is an advantage of binary search
It is much quicker that serial search.
What is a disadvantage of serial search?
It is very slow.
What is a disadvantage of binary search?
You can only use binary search if the data is sorted into an order.
Why do we need sorting algorithms?
A sorting algorithm will put items in a list in order.
Name the 2 main types of sorting algorithms
Bubble sort and bucket sort
What is bubble sort?
A bubble sort algorithm goes through a list of data a number of times, comparing two items that are side by side to see which is out of order.
What is bucket sort?
A bucket sort algorithm separates a list of data into different collections of data called โbucketsโ. Each bucket is sorted and the final data put back together again!
What is an advantage of bubble sort?
It is very simple as there is only one task to perform.
What is an advantage of bucket sort?
It is quicker to run and reduces the number of comparisons that need to be carried out.