2.1 algorithms

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:22 PM on 1/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

30 Terms

1
New cards

What are the 3 concepts of computational thinking?

  1. Abstraction

  2. Decomposition

  3. Algorithmic thinking

2
New cards

What is abstraction?

The process of only focusing on the relevant and important details, while ignoring the unnecessary ones.

3
New cards

What is decomposition?

The process of breaking down a complex problem into smaller, more manageable subproblems.

4
New cards

What is algorithmic thinking?

The process of creating a step by step solution to a problem.

5
New cards

What is an algorithm?

6
New cards

What is the Input-Process-Output Model?

<p></p>
7
New cards

What is the input in an algorithm?

The data that is entered into the algorithm.

8
New cards

What is the process in an algorithm?

The steps/operations performed on the input data.

9
New cards

What is the output in an algorithm?

The result produced

10
New cards

What is a structure diagram?

A visual representation showing how a problem is broken down into subsections, and how they relate to each other

<p><span><span>A visual representation showing how a problem is broken down into subsections, and how they relate to each other</span></span></p>
11
New cards

What are the 3 ways of representing algorithms?

  • Flowcharts

  • Psuedocode

  • High level programming language

12
New cards

What are the meaning of the flowchart symbols?

knowt flashcard image
13
New cards

What is a syntax error?

An error that occurs when code violates the grammatical rules of a programming language.

14
New cards

What is a logic error?

An error that occurs when a program runs successfully but produces incorrect results.

15
New cards

What is a trace table?

A table used to track the value of variables line by line as a program is run.

<p>A table used to track the value of variables line by line as a program is run.</p>
16
New cards

What do trace tables help find?

Logic errors.

17
New cards

What are the 2 types of search algorithm?

  • Linear search

  • Binary search

18
New cards

What are the steps for a linear search?

  1. Compare first item in the list with the item you are searching for.

  2. If it isn’t the item you are searching for, then compare with the next item in the list.

  3. This is repeated until the item is found or until the end of the list is reached.

19
New cards

What are the steps for a binary search?

  1. Find the midpoint of the list

    • (n + 1) / 2

  2. Compare the item at the midpoint with the item you are searching for.

  3. If the item you are searching for is greater, ignore the lower part of the list.

  4. If the item you are searching for is lesser, ignore the upper part of the list.

  5. This is repeated until the item at the midpoint is the item being searched for.

20
New cards

What is the pre-requisite of a binary search?

The list must be in order.

21
New cards

What are the 3 types of sort algorithm?

  • Bubble sort

  • Merge sort

  • Insertion sort

22
New cards

What are the steps for a bubble sort?

  1. Compare first two adjacent elements.

  2. If they are in the wrong order, swap them.

  3. Otherwise, move onto the next two adjacent elements and compare.

  4. Repeat until the whole list is in the correct order.

23
New cards

How is bubble sort applied to a data set?

EX: [6, 7, 3, 4]

[6, 3, 7, 4]

[6, 3, 4, 7]

[3, 6, 4, 7]

[3, 4, 6, 7]

24
New cards

What is an example of a bubble sort algorithm?

knowt flashcard image
25
New cards

What are the steps for a merge sort?

  1. Divide the list by 2 until each data element is separate and an individual list.

  2. Then, combine adjacent individual lists into multiple sorted lists.

  3. Repeat until they combine to form one sorted list.

26
New cards

How is a merge sort applied to a data set?

EX: [6, 7, 3, 4]

[6, 7] [3, 4]

[6] [7] [3] [4]

[6, 7] [3, 4]

[3, 4, 6, 7]

27
New cards

What is an example of a merge sort algorithm?

knowt flashcard image
28
New cards

What are the steps for an insertion sort?

  1. The first value is separated from the rest of the list and is sorted, while the rest of the array is unsorted.

  2. Compare the next value in the list, in the unsorted portion, with the value(s) stored in the sorted portion of the list.

  3. Insert it into its correct position in the sorted list.

  4. Repeat until the whole list is in the correct order.

29
New cards

How is an insertion sort applied to a data set?

EX: [6, 7, 3, 4]

[6] [7, 3, 4]

[6, 7] [3, 4]

[3, 6, 7] [4]

[3, 4, 6, 7]

30
New cards

What is an example of an insertion sort algorithm?

<p></p>