Algorithms Flashcards
What is an Algorithm
A set of Instructions that solves a problem
What is Decompostion
The process Of breaking down a problem into smaller more manageable parts of problems
What is Abstraction
The Process of Removing/Ignoring unnecessary data of a problem
What is Pattern Recognition
When Decomposition is Executed This helps examine the smaller parts for similarities this makes the problem solving more efficient
What is meant by the Term Algorithmic thinking
A way of finding the solution of a problem through a clear definition of the steps needed
What can Algorithmic Thinking be used for
To create a fully automated process
To Remove the need of human intervention
What is a Linear Search
A linear search is a sequential search. It starts from the begging of the list moving through the the items one by one until the information needed/item needed is found. Or it ends without finding the desired item
Explain what is a Binary search
A binary search is and efficient algorithm that searches items in a sorted list. They work by splitting the list into to and if the item is from the upper half the 2nd half is discarded If the item is in the 1st half the 2nd half is discarded. This then repeated until the Item is found.
explain how a merge sort works
The list is divided into two. Then the two lists are continuously halved into sub lists to the point there is one item in each sub list. The individual lists are then merged
How to complete a bubble sort
The first number is looked at and compared to the next number
If the 1st number is bigger then you swap the numbers around if not you do not swap them round
Move the to the next number with the current number you may have or not swapped.
Repeat the 2nd step until the last number has been reached.
The 1st pass is completed
if the list is still not sorted repeat once it is fully sorted you can stop
Give an advantage of Merge sort and Disadvantage
A:More efficient than bubble and Insertion sort.
D:It is difficult to code
What is an insertion sort algorithm
An insertion examens items in a list and inserts them into the correct position in the list
What are the Disadvantages and Advantages of Linear Search
Advantages - List does not have to be sorted
Disadvantages - Inefficient can take a while
What are the advantages Disadvantages of a Binary search
Advantages: Very Efficient
Disadvantages - Requires List to be sorted
What are Advantages and Disadvantages of Bubble sort
Pro-Very easy to implement and execute/do
Cons - Inefficient for large lists