2.1 Algorithms - CT, Searching + Sorting Algorithms Flashcards
What is computational thinking?
Solving problems that can be implemented by a computer system
What type of list does a bubble sort sort?
An unordered list of items.
How does a bubble sort work? (2 marks)
Largest item “bubbles” up to the end of the list in successive passes (one-by-one).
When does a bubble sort finish?
When there are no more swaps that need to be made.
How does a bubble sort work in simple terms?
Bubble sort = items move right
What is a disadvantage of bubble sort?
Most inefficient sorting algorithm.
What is an advantage of bubble sort?
Very easy to implement.
Is bubble sort good for small or large data sets?
Small data sets
Is insertion sort good for small or large data sets?
Small data sets
Is a bubble sort or insertion sort more efficient and why?
Insertion sort because it has less swaps.
How does an insertion sort work?
Compare each item to value on the left.
How does an insertion sort work in simple terms?
Insertion sort = items move left