2.3.1 Analysis, Design and Comparison of Algorithms

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

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

27 Terms

1
New cards

When developing an algorithm, what are the 2 things to check?

  • Time complexity

  • Space complexity

2
New cards

What is time complexity?

How much time is required to solve a particular problem

3
New cards

What is the Big O notation?

Shows the effectiveness of an algorithm

4
New cards

What is time complexity measured in?

Big O notation

5
New cards

What are the 6 different Big O notations?

  • 0(1)

  • 0(n)

  • 0(n²)

  • 0(nⁿ)

  • 0(2ⁿ)

  • 0(log n)

6
New cards

What is 0(1)?

Constant time complexity

7
New cards

What is constant time complexity?

The amount of time taken to complete an algorithm. It is independent from the number of elements inputted

8
New cards

What is 0(n)

Linear time complexity

9
New cards

What is linear time complexity?

The time taken to complete an algorithm is directly proportional to the number of elements inputted

10
New cards

What is 0(n²)

Polynomial time complexity

11
New cards

What is polynomial time complexity?

The amount of time taken to complete an algorithm is directly proportional to the elements inputted to the power of n

12
New cards

What is 0(nⁿ)

Polynomial time complexity

13
New cards

What is 0(2ⁿ)

Exponential time complexity

14
New cards

What is exponential time complexity?

The amount of time taken to complete an algorithm will double with every additional item

15
New cards

What is 0(log n)

Logarithmic time complexity

16
New cards

What is logarithmic time complexity?

The time taken to complete an algorithm will increase at a smaller rate as the number of elements inputted increase

17
New cards

What is space complexity?

The amount of storage an algorithm takes

18
New cards

How is space complexity expressed?

Big O (O(n)) notation

19
New cards

What happens when an algorithm makes a copy?

It stores extra data

20
New cards

What is an algorithm?

Series of steps that complete a task

21
New cards

How to reduce space complexity?

Make sure to perform all changes on the original pieces of data

22
New cards

How to reduce time complexity?

  • Try to reduce the number of embedded loops

  • Try to reduce the number of items you have to complete the operations on

23
New cards

What is a linear search algorithm?

An algorithm which traverses through (accesses) every item one at a time until it finds the item it is searching for

24
New cards

What is the Big O notation for a linear search algorithm?

0(n)

25
New cards

What is a binary search algorithm?

A divide and conquer algorithm; splits the list into smaller lists until it finds the item it is searching for

26
New cards

What is the Big O notation of a binary search algorithm?

0(log(n))

27
New cards

What is the Big O notation of a bubble sort algorithm?

0(n²)