Algorithm design and problem solving

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

1/24

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

What is the program development life cycle?

Analysis, Design, Coding, Testing and maintenance

2
New cards

What is the purpose of the analysis stage in the program development lifecycle?

To clearly define the problem and create a requirements specification.

3
New cards

What is abstraction in algorithm design?

Abstraction involves keeping the key elements required for the solution and discarding unnecessary details.

4
New cards

What does decomposition mean in problem-solving?

Decomposition breaks down a complex problem into smaller, more manageable parts.

5
New cards

What is the output of a successful linear search when looking for a name that exists in a list?

The name found and its position in the list.

6
New cards

What is the bubble sort algorithm used for?

To sort a list of items by repeatedly comparing adjacent elements and swapping them if they are in the wrong order until the entire list is sorted.

7
New cards

What is the difference between validation and verification in data handling?

Validation ensures that only reasonable data is accepted, while verification checks that data has not changed during entry.

8
New cards

What is pseudocode?

A method of describing an algorithm using simple English-like terms, not bound by strict syntax rules.

9
New cards

How do you keep a running total of values in pseudocode?

By initializing a total variable and incrementing it within a loop as values are processed.

10
New cards

What type of loop structure is used for a known number of iterations in pseudocode?

FOR...TO...NEXT loop.

11
New cards

In pseudocode, how do you represent an INPUT statement?

INPUT variable_name.

12
New cards

What are normal, abnormal, and boundary data in test scenarios?

Normal data is expected input, abnormal data is unexpected or erroneous input, and boundary data tests the limits of acceptable values.

13
New cards

What is the structure of a flowchart?

A diagram that represents the steps of an algorithm using various symbols for actions, decisions, and the flow of control.

14
New cards

What do validation checks aim to prevent?

They aim to prevent unreasonable or incorrect data from being accepted into a system.

15
New cards

What is a trace table used for?

To document the changes in variables and outputs during a dry run of an algorithm.

16
New cards

What is the key principle of algorithm design?

Efficiency in terms of time and space complexity.

17
New cards

What is a greedy algorithm?

An algorithm that makes the best choice at each step, aiming for a global optimum.

18
New cards

What are the two main types of algorithms?

Iterative and recursive algorithms.

19
New cards

What does big O notation represent?

An upper bound on the time or space complexity of an algorithm.

20
New cards

What is recursion in programming?

A method where a function calls itself in order to solve a problem.

21
New cards

What is the difference between a linear search and a binary search?

Linear search checks each element one by one, while binary search divides the list in half each time.

22
New cards

What is dynamic programming?

A method for solving complex problems by breaking them down into simpler subproblems.

23
New cards

What is an algorithm's runtime complexity?

A measure of the time taken by an algorithm to run, as a function of the length of the input.

24
New cards

What role does debugging play in algorithm design?

Debugging is used to identify and fix errors to ensure the algorithm works correctly.

25
New cards

What is an algorithmic flow?

The sequence in which the steps of an algorithm are executed.