What is an algorithm

An algorithm is a step-by-step procedure to solve a problem or complete a task in computer science.

ChloeOtter·19 fiszki·15 pytania·3 wyświetleń
high schoolcomputer_scienceprogramming
0
Umiem
1 / 19
0
Uczę się
Przód

What is an algorithm?

Kliknij, aby odwrócić
Tył

A sequence of steps to solve a specific problem or perform a task.

Kliknij, aby odwrócić
Umiem
Uczę się

Quiz(15 pytania)

Pytanie 1 z 15

1. What is the main purpose of an algorithm?

Pojęcia w tym zestawie(19)

What is an algorithm?

A sequence of steps to solve a specific problem or perform a task.

Example of an algorithm.

Recipe for cooking, sorting a list, or finding the shortest path.

True or false: All algorithms are computer programs.

False, because not all algorithms are implemented in code.

Difference between algorithm and program.

An algorithm is a plan; a program is its implementation in code.

Fill in the blank: An algorithm must have a ___ and ___.

clear input and output.

What is a flowchart?

A visual representation of an algorithm using shapes and arrows.

What is pseudocode?

A way to describe algorithms using plain language and structured syntax.

True or false: Algorithms can only process numbers.

False, because algorithms can handle data types like strings and lists.

What is a sorting algorithm?

An algorithm designed to arrange elements in a list in a specific order.

Examples of sorting algorithms.

Bubble sort, quicksort, merge sort.

Which is NOT a characteristic of an algorithm?

Vagueness; it must be clear and unambiguous.

What does 'efficiency' mean in algorithms?

How fast an algorithm completes a task with minimal resources.

Performance comparison in algorithms.

Evaluated by time complexity and space complexity.

True or false: Algorithms can be recursive.

True, because recursion is a common technique in algorithm design.

What is time complexity?

A measure of the time an algorithm takes to run as a function of input size.

What is space complexity?

A measure of the amount of memory an algorithm uses relative to input size.

Difference between linear and binary search.

Linear search checks each element; binary search divides the list.

Fill in the blank: An algorithm must finish in a ___ time.

finite time.

What is a greedy algorithm?

An algorithm that makes the best choice at each step without backtracking.

Pytania w tym zestawie(15)

1. What is the main purpose of an algorithm?

A.To solve a problem
B.To create a website
C.To store data
D.To design hardware

2. Which of the following is an example of a sorting algorithm?

A.Linear search
B.Bubble sort
C.Data encryption
D.Algorithm design

3. What is the time complexity of a binary search?

A.O(n)
B.O(log n)
C.O(n log n)
D.O(1)

4. Which is NOT a characteristic of a good algorithm?

A.Efficiency
B.Clarity
C.Vagueness
D.Finiteness

5. What is a recursive algorithm?

A.Uses iteration
B.Calls itself
C.Requires no input
D.Is always faster

6. Which algorithm is best for searching an unsorted list?

A.Bubble sort
B.Binary search
C.Linear search
D.Merge sort

7. What does space complexity measure?

A.Time taken by an algorithm
B.Memory used by an algorithm
C.Code length
D.User input size

8. What type of algorithm makes the best choice at each step?

A.Dynamic programming
B.Greedy algorithm
C.Brute force
D.Recursion

9. Which scenario requires a sorting algorithm?

A.Finding a minimum value
B.Arranging student grades
C.Searching for a number
D.Counting items

10. What is pseudocode mainly used for?

A.Actual programming
B.Visualizing algorithms
C.Describing algorithms in plain language
D.Running tests

11. Fill in the blank: An algorithm must have a clear ___ and ___ for inputs.

A.start, end
B.input, output
C.goal, steps
D.structure, logic

12. What does 'efficiency' refer to in an algorithm?

A.Clarity of code
B.Speed and resource usage
C.Complexity of steps
D.Length of algorithm

13. Which algorithm is known for dividing the problem in half?

A.Bubble sort
B.Merge sort
C.Binary search
D.Linear search

14. True or false: Algorithms can only be used in computer science.

A.True
B.False
C.Depends on context
D.Only in programming

15. What defines the efficiency of an algorithm?

A.Input size
B.Output complexity
C.Code length
D.Execution time

Powiązane zestawy

Stwórz własny zestaw

Wgraj PDF, wklej notatki lub opisz temat – AI wygeneruje fiszki, quizy i więcej w kilka sekund.