Algorithms and Pseudocode

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

1/50

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.

51 Terms

1
New cards

Array

a collection of items stored at contiguous memory locations; each item can be accessed using an index

2
New cards

Binary Search

a search algorithm that finds the position of a target value within a sorted array by repeatedly dividing the search interval in half

3
New cards

Bubble Sort

a simple sorting algorithm that repeatedly steps through a list, compares adjacent elements, and swaps them if they are in the wrong order

4
New cards

Concrete Step

a detailed action in an algorithm that specifies exactly how to perform a task

5
New cards

count-controlled loop

a loop that repeats a specific number of times; controlled by a counter variable (e.g., "for" loop)

6
New cards

desk checking

a manual method of reviewing the logic of a program or algorithm using a pencil and paper instead of a computer

7
New cards

event-controlled loop

a loop that continues to execute until a specific condition or event occurs, such as user input or a sensor reading

8
New cards

heterogeneous

a term describing a collection of items that are of different types

9
New cards

homogenous

a term describing a collection of items that are all of the same type

10
New cards

index

a numerical representation of an element's position within an array or list

11
New cards

insertion sort

a sorting algorithm that builds the final sorted array one item at a time by inserting each new item into its correct position

12
New cards

processing

the act of performing operations on data according to a set of instructions to achieve a desired result

13
New cards

record

a composite variable that can store multiple fields of different data types, usually related to a single entity

14
New cards

searching

the process of finding a specific item or value within a collection of data

15
New cards

selection sort

a simple sorting algorithm that repeatedly finds the minimum element from the unsorted part of a list and moves it to the beginning

16
New cards

sequential search (linear search)

a search algorithm that checks each element in a list one by one until the desired element is found or the list ends

17
New cards

sorting

the process of arranging data in a particular order, such as ascending or descending

18
New cards

string

a sequence of characters treated as a single data item; commonly used to represent text

19
New cards

Which statement describes an array?

A collection of elements of the same type stored at contiguous memory locations

20
New cards

Which statement describes a record in programming?

A data structure that holds multiple values of different data types

21
New cards

Which data structure is best suited for storing a collection of different data types?

Record, which are designed to store multiple values of different data types

22
New cards

What is a common characteristic of both arrays and records?

Both can store multiple values

23
New cards

What is the primary advantage of binary search over sequential (linear) search?

It is faster for large datasets because it divides the search interval in half each time it searches

24
New cards

Which search algorithm would you use on an unsorted list?

Sequential (linear) search, which can be used on unsorted lists

25
New cards

Which sorting algorithm repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order?

Bubble sort, which compares and swaps adjacent elements

26
New cards

Which statement describes linear search?

It checks each element one by one

27
New cards

Which statement is true about binary search?

It requires the list to be sorted

28
New cards

Which type of sorting algorithm repeatedly finds the minimum element and moves it to the beginning of the list?

Selection sort

29
New cards

end-structure statement

a statement that marks the end of a block of code, such as the end of a loop or an if statement

30
New cards

block

a group of statements that are executed together, typically enclosed in curly braces or defined by indentation

31
New cards

dual-alternative if

an if statement that provides two paths: one for when the condition is true and another for when it is false (also known as if-else)

32
New cards

loop structure

a way to repeat a block of code multiple times based on a condition, such as for loops or while loops

33
New cards

loop body

the set of statements inside a loop that are executed each time the loop runs

34
New cards

nesting structures

placing one control structure, such as a loop or an if statement, inside another

35
New cards

null case

a situation in which no action is taken, often used as the default case in a switch statement or when no conditions in an if statement are met

36
New cards

selection structure

a control structure that chooses different paths of execution based on conditions, such as if statements or switch cases

37
New cards

sequence structure

the simplest control structure where actions are performed one after another in order

38
New cards

single-alternative if

an if statement that provides only one path of execution if the condition is true; no action is taken if the condition is false

39
New cards

stacking structures

placing one control structure after another in sequence

40
New cards

structure

an organized way to control the flow of a program, such as sequences, selections, and loops

41
New cards

while loop

a loop that repeats a block of code as long as a specified condition is true

42
New cards

Which statement describes a sequence structure in pseudocode?

Executing actions one after another in order

43
New cards

What is the purpose of a selection structure in pseudocode?

To choose different paths based on conditions

44
New cards

Which statement is an example of a dual-alternative if statement?

if (condition) then . . . else, a dual-alternative if statement provides two paths: one if the condition is true and another if it is false.

45
New cards

Which keyword is typically used to represent the end of a selection structure in pseudocode?

End if, is commonly used to denote the end of a selection structure.

46
New cards

Which statement best describes a loop structure in pseudocode?

Repeating a set of actions until a condition is met

47
New cards

What is the primary purpose of a loop body in pseudocode?

To contain the statements repeated in a loop

48
New cards

Which keyword is typically used to start a while loop in pseudocode?

While

49
New cards

Which statement describes a nested structure?

Contains another structure within it

50
New cards

What is the main advantage of using a nesting structure in pseudocode?

It allows for more complex decision-making and iterations.

51
New cards

Which pseudocode statement is an example of a single-alternative if statement?

if (condition) then, a single-alternative if statement provides one path of execution if the condition is true