3.1 Fundamentals of algorithms

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/10

flashcard set

Earn XP

Description and Tags

Contains: 3.1.1 Representing algorithms 3.1.2 Efficiency of algorithms 3.1.3 Searching algorithms 3.1.4 Sorting algorithms

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

11 Terms

1
New cards

Explain the term algorithm.

An algorithm is a sequence of steps that can be followed to complete a task.

(be aware that a computer program is an implementation of an algorithm and that an algorithm is not a computer program)

2
New cards

Explain the term decomposition.

Decomposition means breaking a problem into a number of sub-problems, so that each subproblem accomplishes an identifiable task, which might itself be further subdivided.

3
New cards

Explain the term abstraction.

Abstraction is the process of removing unnecessary detail from a problem.

4
New cards

Understand that more than one algorithm can be used to solve the same problem.

-

5
New cards

Compare the efficiency of algorithms.

Some algorithms are more efficient than others in solving the same problem because they are faster (time efficiency).

e.g code being shorter/variables are already declared in the code ← the simpler the algorithm, the less efficient the search/sort will be on very large numbers of records

Space efficiency looks at how much storage a code needs.

6
New cards

Understand and explain how the linear search algorithm works.

A linear search searches a list or other collection of data one item at a time until the desired search object is located.

7
New cards

Understand and explain how the binary search algorithm works.

Binary search uses DIVIDE AND CONQUER - a method for searching data that splits datasets into 2 components repeatedly until the search term is located.

8
New cards

Compare and contrast linear and binary search algorithms.

  • Binary search is more efficient than linear search, especially for large data sets

  • A binary search only works with an ordered list (whereas a linear search works with an unordered list)

  • A binary search also needs to know the size of the list to identify the middle of it.

  • A linear search has an algorithm that is easier to understand, whereas the binary search algorithm is more complex

9
New cards

Understand and explain how the merge sort algorithm works.

Merge sort is a sorting algorithm based on DIVIDE AND CONQUER

  • it divides a list into half repeatedly until each data item is seperate

  • the data items are combined in the same way they were divided, but in the correct order

  • multiple individual lists are eventually all merged into one list and the algorithm ends.

10
New cards

Understand and explain how the bubble sort algorithm works.

  • Bubble sort compares adjacent data elements (starting from the first value).

  • Data elements are swapped if they are not in the correct order.

11
New cards

Compare and contrast merge sort and bubble sort algorithms.

  • Merge sort is faster and therefore more efficient (1) for large lists (1) because it uses divide and conquer

  • Has a consistent running time (1) so doesn’t depend on how ordered original list is (1)