IT101-1L (1-3 Lessons) :( Flashcards

1
Q

step-by-step procedure or set of rules for solving a specific problem.

A

Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can be algorithms be expressed? (4)

A

Natural Language
Pseudocode
Flowchart
Actual Programming code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Algorithms must have a ‘precisely’ defined set of instructions that leave no ambiguity or room for interpretation.

A

Well-defined:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

: Algorithms must terminate after a finite number of steps. They should not enter an infinite loop or continue indefinitely.

A

Finite

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Algorithms take zero or more inputs, which are the initial data or values on which they operate to produce the desired output.

A

Input:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Algorithms produce one or more outputs, which are the results or solutions obtained after executing the instructions.

A

Output:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

meaning that for a given input, they will always produce the same output.

A

Deterministic:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

It is the foundation of computer science and plays a crucial role in problem-solving and software development.

A

Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Algorithms should be practical and efficient, capable of solving the problem within a reasonable amount of time and resources.

A

Feasible:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Each step should be clear and unambiguous.

A

Well-defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

There should be no randomness or uncertainty involved in their execution.

A

Deterministic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

_____________ involves careful planning, analysis, and consideration of various factors.

A

Designing effective algorithms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Clarify the requirements, constraints, and expected outcomes. Break down the problem into smaller subproblems, if necessary.

A

Understand the Problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Identify the input required to solve the problem. Determine the format, data types, and possible range of input values. Similarly, define the expected output and its format.

A

Determine the Input and Output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Break the problem into smaller subproblems, solve them independently, and combine the solutions to obtain the final result.

A

Divide and Conquer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Make locally optimal choices at each step, hoping to reach the global optimum.

A

Greedy:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

is a well-defined set of instructions that precisely describes how to perform a particular task or solve a problem.

A

algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

: Break the problem into overlapping subproblems, solve them once, and store the results to avoid redundant computations.

A

Dynamic Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Systematically explore all possible solutions by trying out different choices and undoing them if they do not lead to a valid solution.

A

Backtracking:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Enumerate all possible solutions in a systematic manner, pruning branches that are guaranteed to be suboptimal.

A

Branch and Bound:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Use randomness or probability to find a solution or improve the efficiency of the algorithm.

A

Randomized:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

_________ provide a systematic approach to breaking down complex tasks into smaller, more manageable steps.

A

Algorithms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the algorithmic paradigms? (6)

A

Divide and Conquer
Greedy
Dynamic Programming
Backtracking
Branch and Bound
Randomized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Select an ____________ or approach that suits the problem at hand

A

Choose an Algorithmic Paradigm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Create a high-level description of the algorithm using pseudocode, a language-independent representation of the solution

A

Develop a High-Level Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Focus on the logic and steps required to solve the problem, without getting into the specifics of programming syntax.

A

Develop a High-Level Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Review and refine the algorithm for correctness, efficiency, and readability

A

Refine the Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Optimize it by reducing unnecessary steps, improving time or space complexity, and eliminating redundancy.

A

Refine the Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Consider edge cases and handle exceptions appropriately.

A

Refine the Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Translate the refined algorithm into your programming language of choice

A

Implement the Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Write the code, following the syntax and conventions of the language.

A

Implement the Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Make sure to incorporate the necessary input/output operations and any auxiliary data structures required.

A

Implement the Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Thoroughly test the implemented algorithm using different inputs, including typical cases, boundary values, and exceptional scenarios.

A

Test and Debug

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Verify that the algorithm produces the expected output and handles various scenarios correctly. Debug any issues or errors encountered during testing.

A

Test and Debug

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Analyze the algorithm’s performance in terms of time complexity and space complexity.

A

Analyze and Optimize

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Identify potential bottlenecks and inefficiencies. Consider alternative approaches or optimizations to improve the algorithm’s efficiency, if necessary.

A

Analyze and Optimize

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

how its execution time grows as the input size increases

A

time complexity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

how much memory it requires

A

space complexity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

are the building blocks of problem-solving and software development.

A

Algorithms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

They provide a systematic approach to breaking down complex problems into manageable steps, ensuring consistent and predictable results

A

Algorithms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What is the purpose of testing and debugging an implemented algorithm?

A

To verify the correctness and handle exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What does it mean for an algorithm to be feasible

A

it produces consistent and predictable results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

Steps for Designing Algorithms for Problem-Solving 8

A

Understand the Problem
Determine the Input and Output
Choose an Algorithmic Paradigm
Develop a High-Level Algorithm
Refine the Algorithm
Implement the Algorithm
Test and Debug
Analyze and Optimize

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

are graphical representations of a process or algorithm that use various symbols and arrows to depict the sequence of steps.

A

Flowcharts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Flowcharts visually represent the steps and flow of a process, making it easier to understand and analyze.

A

Process Visualization:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Flowcharts provide a common visual language that can be easily understood by different stakeholders involved in a process, facilitating effective communication.

A

Communication:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

Flowcharts help identify bottlenecks, inefficiencies, and areas of improvement within a process, enabling process optimization.

A

Process Analysis:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Flowcharts serve as a useful tool for analyzing and solving problems by breaking them down into manageable steps and visualizing the decision-making process.

A

Problem-Solving:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

Flowcharts serve as documentation for processes, algorithms, and systems, making it easier to maintain and update them over time.

A

Documentation:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

start or end point of a flowchart

A

Terminator Symbol:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

represents an action or operation within the flowchart

A

Process symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

represent a condition or decision point in a flowchart

A

Decision Symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

input or output of data in the flowchart

A

input/output symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

used to connect different parts of a flowchart

A

Connector Symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

Flow of control or direction whithin the flowchart

A

Arrow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

_______________is a high-level, structured language used to describe algorithms in a human-readable and language-independent manner.

A

Pseudocode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

Pseudocode is not tied to any specific programming language. It can be easily understood and translated into any programming language, making it a universal language for algorithm design.

A

Language Independence:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

Pseudocode uses a simplified syntax and natural language constructs, making it easier to read, understand, and communicate algorithmic concepts

A

Simplicity and Readability:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

Pseudocode allows algorithm designers to express algorithmic ideas and concepts without the constraints of a specific programming language.

A

Flexibility:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

Pseudocode can be easily understood by both technical and non-technical stakeholders, enabling effective collaboration and communication during the algorithm design process.

A

Accessibility:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

Assigning a value to a variable is typically represented using an arrow (←) or an equal sign (=).

A

Assignment:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

Pseudocode represents input and output operations using appropriate keywords, such as input and output.

A

Input and Output:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

Pseudocode includes various control structures to represent decision-making and looping.

A

Control Structures:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

allows the definition and calling of functions or procedures to encapsulate reusable code blocks.

A

Pseudocode

65
Q

in pseudocode are used to provide additional explanations, clarifications, or to annotate the code

A

Comments

66
Q

The flowchart begins with a “Start” symbol, representing the start of the algorithm, and ends with an “End” symbol, indicating the completion of the algorithm.

A

Start/End:

67
Q

Use rectangles or rectangles with rounded corners to represent process steps.

A

Process:

68
Q

Use diamonds to represent decision points or conditions. The flow branches based on the outcome of the decision. T

A

Decision:

69
Q

Use arrows to connect symbols and indicate the flow of control between steps.

A

Connector/Arrow:

70
Q

: Use parallelograms to represent input or output operations.

A

Input/Output

71
Q

is a versatile and widely used programming language known for its simplicity, readability, and flexibility.

A

Python

72
Q

Who developed pyhton

A

Guido van Rossum

73
Q

_______ is a general-purpose, high-level programming language that supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

A

Python

74
Q

Python’s simple and clear syntax allows programmers to express their ideas with less code compared to other languages.

A

Easy to read and write

75
Q

Python abstracts away low-level details, making it easier to focus on problem-solving rather than managing system resources.

A

High level language

76
Q

allows variables to hold different data types during the program’s execution, making Python code concise and adaptable.

A

Dynamically typed

77
Q

Python code is highly portable and can be executed on different platforms, including Windows, macOS, Linux, and more, without modification.

A

Portability and Cross-platform Compatibility

78
Q

are used to include external libraries and functionality into the Python program.

A

Module imports

79
Q

are placed at the top level of the program and are accessible throughout the entire program.

A

Global variable declarations

80
Q

contain the implementation of custom functions used in the program.

A

Function definitions

81
Q

play a crucial role in Python programming as they provide essential functionality and organization to the code.

A

Modules

82
Q

provides mathematical functions, including trigonometric, logarithmic, exponential, and rounding functions.

A

math module

83
Q

offers functions to generate random numbers, shuffle sequences, and select random elements.

A

random module

84
Q

provides functions to interact with the operating system, allowing you to perform tasks like file and directory operations, environment variable access, and process management.

A

os module

85
Q

provides classes and functions for working with dates, times, and intervals.

A

datetime module

86
Q

provides functions for encoding and decoding data in JSON format. Common functions include json.dumps(), json.loads(), and json.dump().

A

json module

87
Q

are fundamental guidelines that govern the structure and composition of programs in the Python programming language

A

Syntax rules

88
Q

are terminated with a newline,

A

statements

89
Q

is used to define blocks of code.

A

indentation

90
Q

are defined using the def keyword, followed by the function name and parameters.

A

Functions

91
Q

a wide range of operators for arithmetic, assignment, comparison, logical operations, and more.

A

Operators

92
Q

_______ statements, such as if, for, while, and try…except, are used to control the execution flow of a program.

A

Control flow

93
Q

significantly enhance code readability in Python.

A

Proper formatting and indentation

94
Q

occur when the code violates the rules of the Python programming language.

A

Syntax errors

95
Q

, also known as exceptions, occur when the code is syntactically correct, but something goes wrong during program execution.

A

Runtime errors

96
Q

occur when the code is syntactically and semantically correct, but it does not produce the intended output or behavior.

A

Logical errors

97
Q

Debugging is a systematic process of identifying and fixing errors in the code

A

Debugging

98
Q

Inserting print statements at strategic points in the code can help trace the program’s execution and identify potential errors.

A

Print Statements:

99
Q

Utilizing a debugger allows you to step through the code line by line, inspect variables, and analyze the program’s behavior during runtime.

A

Debugger:

100
Q

: Engaging in code review with peers or experienced programmers can provide fresh perspectives and uncover errors that might have been overlooked

A

Code Review

101
Q

Creating comprehensive ___________ and providing a range of inputs to the program can help identify errors and verify the correctness of the code.

A

Test Cases and Test Inputs

102
Q

When faced with complex issues, divide the problem into smaller parts and test each part individually.

A

Divide and Conquer

103
Q

are named storage locations that hold values during program execution.

A

Variables

104
Q

are fixed values that do not change during program execution.

A

Constants

105
Q

are blocks of code that perform specific tasks.

A

Functions

106
Q

They provide additional context, explanations, and instructions within the code, aiding both developers and future maintainers.

A

Comments

107
Q

Comments act as a form of communication within the code, helping developers understand the purpose, functionality, and logic of different sections of code.

A

Enhancing Code Readability and Understanding

108
Q

Comments also foster collaboration among team members by facilitating code sharing and maintenance.

A

Facilitating Collaboration and Maintenance

109
Q

During the debugging process, comments can be invaluable in identifying and isolating problematic code sections.

A

Assisting Debugging and Troubleshooting

110
Q

comments are used to add explanations or comments on a single line.

A

Single-line

111
Q

also known as block comments, allow for longer explanations or comments spanning multiple lines.

A

Multi-line comments,

112
Q

in programming define the kind of data that variables can hold.

A

Data types

113
Q

The ___________ is used to represent integers, which are whole numbers without a fractional part.

A

int data type

114
Q

type is used to represent floating-point numbers, which are numbers with decimal points.

A

The float data

115
Q

is used to represent complex numbers in the form of real + imag * j, where j represents the square root of -1.

A

The complex data type

116
Q

is used to represent strings, which are sequences of characters.

A

The str data type

117
Q

is used to represent Boolean values, which can be either True or False.

A

The bool data type

118
Q

is used to represent ordered collections of items.

A

The list data type

119
Q

is used to represent ordered collections of items, similar to lists.

A

The tuple data type

120
Q

is used to represent unordered collections of unique items.

A

The set data type

121
Q

is used to represent dictionaries, which store key-value pairs.

A

The dict data type

122
Q

represents the absence of a value

A

The None data type

123
Q

in Python are similar to other programming languages and can be integers or floating-point numbers.

A

Numeric constants

124
Q

String constants in Python are defined using single or double quotes.

A

String constants

125
Q

also known as keywords, are predefined words in a programming language that have special meanings and are reserved for specific purposes

A

Reserved words,

126
Q

Represents the Boolean value for false.

A

False:

127
Q

: Represents a special object that signifies the absence of a value.

A

None

128
Q

: Represents the Boolean value for true.

A

True

129
Q

Creates an alias for a module or import.

A

as:

130
Q

: Tests if a condition is true; otherwise, raises an exception.

A

assert

131
Q

Terminates the execution of a loop.

A

break:

132
Q

: Defines a class, which is a blueprint for creating objects.

A

class

133
Q

Skips the current iteration of a loop and proceeds to the next iteration.

A

continue:

134
Q

: Defines a function.

A

def

135
Q

Deletes a variable or an element from a list or dictionary.

A

del:

136
Q

Short for “else if,” defines an alternative branch in an if statement.

A

elif:

137
Q

Defines the default branch in an if statement.

A

else:

138
Q

Catches an exception in a try-except block.

A

except:

139
Q

Defines a block of code to be executed regardless of whether there was an exception.

A

finally:

140
Q

Defines a loop that iterates over a sequence.

A

for:

141
Q

Imports specific attributes or submodules from a module.

A

from:

142
Q

Declares a global variable inside a function.

A

global:

143
Q

Evaluates a condition and executes a block of code if the condition is true.

A

if:

144
Q

Imports a module.

A

import:

145
Q

Checks if a value is present in a sequence.

A

in:

146
Q

Checks if two variables refer to the same object.

A

is:

147
Q

Creates an anonymous (inline) function.

A

lambda:

148
Q

: Declares a non-local variable inside a nested function.

A

nonlocal

149
Q

: Performs a logical NOT operation.

A

not

150
Q

Performs a logical OR operation.

A

or:

151
Q

Represents a null operation (a placeholder for future code).

A

pass:

152
Q

Raises an exception.

A

raise:

153
Q

: Exits a function and returns a value

A

return

154
Q

Defines a block of code with potential exceptions.

A

try:

155
Q

: Defines a loop that repeats a set of statements while a condition is true.

A

while

156
Q

Creates a context manager for resource management.

A

with:

157
Q

Yields a value from a generator function.

A

yield:

158
Q
A