Computer Science - 1 Fundamentals of Algorithms

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

Algorithm

a set of instructions for solving a problem or completing a task

2
New cards

Decomposition

breaking a problem down into smaller, more manageable pieces

3
New cards

Abstraction

removes unnecessary details from a problem so that you can focus on the essentials

4
New cards

Python exponent

**

5
New cards

Python modulo

%

6
New cards

Python integer division

//

7
New cards

modulo

returns the remainder from a division

8
New cards

integer division

returns the result of a division truncated to the nearest integer

9
New cards

Variable

a location in memory in which you can temporarily store text or numbers

10
New cards

The name of a variable is called:

'identifier' or 'variable identifier'

11
New cards

Assigning a value in Python:

=

12
New cards

Pseudocode

a detailed yet readable description of what a computer program or algorithm should do

13
New cards

Flowchart: round-edged rectangle

start and end

14
New cards

Flowchart: rectangle

calculation or assignment

15
New cards

Flowchart: parallelogram

input or output

16
New cards

Flowchart: rhombus

decision

17
New cards

Three basic programming structures:

- sequence
- selection
- iteration

18
New cards

INTEGER

whole number

19
New cards

REAL or FLOAT

numbers that have a decimal part

20
New cards

BOOLEAN

a single value of either TRUE or FALSE

21
New cards

CHARACTER

a single alphabetic or numeric character

22
New cards

STRING

a sequence of characters

23
New cards

sequence

statements are executed in the order they are written in

24
New cards

selection

the next statement to be executed depends on whether the condition being tested is true or false (e.g. IF)

25
New cards

iteration

repetition of code

26
New cards

iterative statements [3]:

- FOR...ENDFOR
- WHILE...ENDWHILE
- REPEAT...UNTIL

27
New cards

Pseudocode assignment

28
New cards

Pseudocode output

OUTPUT("[text]")

29
New cards

Pseudocode input

[var] ← USERINPUT

30
New cards

Pseudocode for loop

FOR [var] ← [no.] TO [no.]
...
ENDFOR

31
New cards

Pseudocode while loop

WHILE [condition]
...
ENDWHILE

32
New cards

Pseudocode if statement

IF [condition] THEN
...
ELSE IF [condition] THEN
...
ELSE
...
ENDIF

33
New cards

Boolean operator

comparative symbols like < and >

34
New cards

Boolean expression

a comparative statement such as '15 > [var]'

35
New cards

Pseudocode repeat until statement

REPEAT
...
UNTIL [condition]

36
New cards

What is 'searching' in computing?

using a program to look through a list to find a value

37
New cards

What search would you use for a sorted list?

binary search

38
New cards

What search would you use for an unsorted list?

linear search

39
New cards

Binary search [3]

- look at middle value (if even set, use before midpoint)
- discard half without item
- repeat with kept half until item found or not found (not in set)

40
New cards

Linear search

an algorithm that iterates through each item in a list until it finds the target value.

41
New cards

In a sorted list of 2ⁿ items the maximum number of items you need to search is equal to:

n + 1

42
New cards

If the length of the sequence does not fit exactly into 2ⁿ:

use the lower exponent (e.g. 15 is 2³ rather than 2⁴)