CIT 108 Summary Kjbniu
CIT 108 Summary Kjbniu
CIT 108 Summary Kjbniu
• problem-solving strategy
2. A problem-solving strategy is a plan used to find a ______ or ________ a challenge.
• solution or overcome
3. ________ have different action plans associated with them.
• Different strategies
4. Different strategies have different action plans ________ with them.
• associated
5. A well-Known _______ is trial and error.
• strategy
6. A well Known strategy is ______.
• trial and error
7. Problems themselves can be classified into two different ________ known as ill-defined and
well-defined problems.
• categories
8. Problems themselves can be classified into two different categories known as ______ and
______.
• ill-defined and well-defined problems
9. Problems was classified into two categories by ______.
• Schacter 2009
10. ___________ represent issues that do not have clear goals, solution paths, or expected
solutions.
• Ill-defined problems
11. _______________have specific goals, clearly defined solutions, and clear expected solutions.
• Well-defined problems
• Introspection
• Simulation
• Computer modelling
• Experimentation.
12. A ________ approach to problem-solving involves trying a number of different solutions and
ruling out those that do not work.
• trial-and-error
13. __________ is not typically one of the most time-efficient strategies, it is a commonly used one.
• Trial And error
14. A common type of strategy is an _______.
• algorithm
15. A common type of ________ is an algorithm.
• strategy
16. An algorithm was defined has a problem-solving formula that Provides you with step-by-step
instructions used to achieve a desired outcome by ___________.
• Kahneman, 2011
17. _________ are used frequently in our everyday lives, especially in computer science.
• Algorithms
18. A ________ is a general problem-solving framework.
• heuristic
19. A heuristic is a general problem-solving _______.
• framework
20. A ―rule of thumb is an example of a _________.
• Heuristic
Different types of heuristics are used In different types of situations, but the impulse to use a
heuristic occurs when one of five conditions is met (Pratkanis, 1989):
• When one is faced with too much information
• When the time to make a decision is limited
• When the decision to be made is unimportant
• When there is access to very little information to use in making the decision
• When an appropriate heuristic happens to come to mind in the same moment
21. Another useful heuristic is the practice of accomplishing a large goal or task by breaking it Into a
series of smaller steps.
• heuristic
22. Another useful heuristic is the practice of accomplishing a large goal or task by breaking it Into a
series of _______.
• smaller steps
23. The ___________ involves choosing and analysing an action at a series of smaller steps to move
Closer to the goal.
• means-ends analysis
24. Means-ends analysis examples can be found by using the __________.
• Tower of Hanoi paradigm.
25. Means-ends analysis examples can be found by using the Tower of _______
• Hanoi paradigm
26. The actual _________ consists of three rods sitting vertically on a base with a number of disks
of different sizes that can slide onto any rod.
• Tower of Hanoi problem
Other Problem-solving Strategies
• Use past experience
• Bring in a facilitator
• Develop a decision matrix for evaluation
• Ask your peers for help
• Step away from the problem
27. A ________ can be an excellent tool to help you approach this task because It allows you to
rank potential solutions.
• decision matrix
Some factors you can analyse when ranking each Potential solution are in decision matrix for
evaluation are :
• Timeliness
• Manageability
• Risk
• Expense
• Practicality
• Effectiveness
28. Computer science is all about solving problems with ________ .
• computers
29. __________ is all about solving problems with computers.
• Computer science
30. __________ is the sequential process of analysing information related to a given situation and
generating appropriate response options.
• Problem Solving
31. __________ is a precise sequence of instructions for solving a problem.
• Algorithm
32. ___________ is often used as a way of describing a computer program to someone who doesn‘t
understand how to program a computer.
• Pseudocode
33. _________ is the process of converting a program into instructions that can be understood by
the computer.
• Compiling
34. _______ are errors with a program that cause it to stop working or produce incorrect or
undesirable results
• Bugs
35. ________ is the process of finding and fixing errors in program code.
• Debugging
36. __________ strategy is characterised by a lack of sophistication in terms of their approach to
the Solution.
• Brute-force Approach
37. __________ typically takes the most direct or obvious route, without attempting to minimize
the number of operations required to compute the solution.
• Brute-force Approach
38. ___________ is considered quite often in the course of searching.
• Brute-force approach
39. _______________ a problem is solved recursively by applying three steps at each level of the
recursion.
• Divide and conquer strategy
Divide-and-conquer Approach is divided into three steps :
• Divide
• Conquer
• Combine
40. __________ is the first step of the divide and conquer strategy.
• Divide
41. In _______ step the problem is divided into smaller sub-problems until it is small enough to be
solved.
• Divide
42. In ________ step, sub-problems become smaller but still represent some part of the actual
problem.
• Divide
43. A ___________ calls itself with smaller or simpler input values, known as the recursive case.
• recursive algorithm
44. When the divide step is implemented, the recursive case is determined which will divide the
problem into smaller __________ .
• sub-problems
45. The _________ is normally implemented with recursion by specifying the recursive base case.
• conquer step
46. In _______ step, the solution of the sub-problems is combined to solve the whole problem.
• combine
47. In _______ step, we merge output from the conquer step to solve bigger sub-problems.
Solution.
• Combine
48. __________ is similar to divide-and-conquer in that both solve problems by breaking it down
into several sub-problems that can be solved recursively.
• Dynamic programming approach
49. __________ is a bottom-up technique that usually begins by solving the smallest Sub-problems,
saving these results and then reusing them to solve larger and larger sub - Problems until the
solution to the original problem is obtained.
• Dynamic programming
50. __________ Is in contrast to the divide-and-conquer approach, which solves problems in a top-
down fashion.
• Dynamic programming approach
51. ___________ is only justified if there is some degree of overlap in the sub-problems.
• Dynamic programming approach
52. ___________ is often used to solve optimisation problems.
• Dynamic programming
53. A _________ is the sequence of numbers in which each number is the sum of the two preceding
ones.
• Fibonacci series
Greedy Algorithm Approach
In a greedy algorithm, at each decision point the choice that has the smallest immediate
(i.e.,local) cost is selected, without attempting to look ahead to determine if this choice is part of
our optimal solution to the problem as a whole (i.e., a global solution).
The important characteristics of a Greedy algorithm are:
• There is an ordered list of resources, with costs or value attributions. These quantify
constraints on a system.
• Take the maximum quantity of resources in the time a constraint applies.
• For example, in an activity scheduling problem, the resource costs are in hours, and the
activities need to be performed in serial order.
• The greedy approach has a few trade-offs, which may make it suitable for optimization.
• One prominent reason is to achieve the most feasible solution immediately.
• Another reason is to divide a problem recursively based on a condition, with no need to
combine all the solutions.
• In the activity selection problem, the ―recursive division‖ step is achieved by scanning a
list of items only once and considering certain activities.
54. _________ are similar to dynamic programming in the sense that they are both tools for
optimization.
• Greedy algorithms
55. _________ Look for locally optimum solutions or in other words, a greedy choice, in the hopes
of finding a global optimum.
• Greedy algorithms
56. __________ can make a guess that looks optimum at the time but becomes costly down the
line and do not guarantee a globally optimum.
• Greedy algorithms
57. This ________ is dependent not only on the input data, but also on the values provided by a
Random number generator.
• randomized approach
58. ____________ are best suited in game-theoretic situations where we want to ensure fairness in
the face of mutual suspicion.
• Randomized Approach
59. ________approach is widely used in computer and Information security as well as in various
computer-based games.
• Randomized
60. Good strategies typically use some form of abstraction as a tool for dealing with this ________.
• complexity
61. Good strategies typically use some form of _________ as a tool for dealing with this complexity.
• Abstraction
62. __________ are essential in the construction of appropriate models, designs, and
implementations that are fit for the particular purpose at hand.
• Abstraction skills
63. ________ is the creation of well-defined interfaces to hide the inner workings of computer
Programs from users.
• Abstraction
64. _________ is the process of identifying the general characteristics needed to solve a problem
while filtering out unnecessary information.
• Abstraction
65. Abstraction is the process of identifying the general characteristics needed to solve a problem
while filtering out __________.
• unnecessary information
66. ________ is described as simplifying a process or artefact by providing what you really need,
and hiding the useless details you don’t care about, thus removing unnecessary detail.
• Abstraction
67. Abstraction is _______ used to simplify things that may be very complex.
• widely
Importance of Abstraction
• In computer science, abstraction is used to manage the complexity of a lot of what is
designed and created. Computer hardware is seen as components or black boxes.
How to Abstract
• In computing, when we decompose problems, we then look for patterns among and
within the smaller problems that make up the complex problem. Abstraction allows us
to create a general idea of what the problem is and how to solve it. We remove all
specific detail, and Any patterns that will not help us solve the problem.
Types of Abstraction
• Representational Abstraction
• Abstraction by Generalisation
• Procedural abstraction
• Functional Abstraction
• Data Abstraction
68. _________ abstraction appears in many forms within computing, both in terms of techniques
used to approach problem-solving, and in the computational tools employed to develop
solutions.
• Representational
69. The maps of many metropolitan public transport systems worldwide is a classic example of a
___________.
• representational abstraction.
70. When you group things in terms of a set of common characteristics, you are _______ .
• generalizing
71. The type of abstraction that represents a computational method is ______.
• procedural abstraction
72. One of the _______ that you will develop as a computer scientist is the ability to design a well-
abstracted procedure that is generalised as far as possible.
• skills
73. In __________ , the implementation detail of the computational method is hidden.
• functional abstraction
74. _________ is a technique that allows you to separate the way that a compound data object is
used, from the details of how it is constructed.
• Data abstraction
75. ADT stands for _____.
• Abstract data type
76. LIFO stands for _____.
• Last In , First Out
77. A ________ is a last in, first out (LIFO) data structure that supports three standard operations
• stack
A stack is a last in, first out (LIFO) data structure that Supports three standard operations:
• push (add an item to the stack)
• pop (remove an item from a stack)
• peek (look at the item at the top of the stack)
The abstract concept of a stack, And its operations, can be understood without any
consideration of how it is implemented.
78. _________ is one of the four cornerstones of computer science.
• Abstraction
79. Abstraction is one of the ________ of computer science.
• four cornerstones
80. Abstraction is one of the four cornerstones of _________.
• computer science.
81. The _________ aspect of abstraction is seen in the programming with the use of data
abstraction.
• generalisation
82. An ________ is an effective step-by-step procedure for solving a problem in a finite number of
steps.
• algorithm
83. An algorithm is an effective _________ procedure for solving a problem in a finite number of
steps.
• step-by-step
84. _________ is a finite set of well-defined instructions or step-by- step description of the
procedure written in human readable language for solving a given problem.
• Algorithm
85. An _______ itself is division of a problem into small steps which are ordered in sequence and
easily understandable.
• algorithm
• When a sub-algorithm comes back with some kind of object Or value such as numerical
result, we call the sub-algorithm a function
• If the sub-algorithm does not return any particular value, it is instead known as a
procedure.
Reasons for Algorithm
A programmer writes a program to instruct the computer to do certain tasks as desired. The
Computer then follows the steps written in the program code. Therefore, the programmer first
Prepares a roadmap of the program to be written, before actually writing the code.
86. An _________ can be defined as ―a complete, unambiguous, finite number of logical steps for
Solving a specific problem.
• algorithm
Characteristics of Algorithm
An algorithm must possess following characteristics:
• Precision — the steps are precisely stated or defined.
• Uniqueness — results of each step are uniquely defined and only depend on the input
and the result of the preceding steps.
• Finiteness — the algorithm always stops after a finite number of steps.
• Input — the algorithm receives some input.
• Output — the algorithm produces some output.
87. ___________ is used to describe properties of an algorithm elating to how much of various
types of resources it consumes.
• Algorithm efficiency
88. The ___________ (execution time) of an algorithm is the amount of time that it takes to
complete once it has begun.
• runtime complexity
89. The __________ of an algorithm is the amount of storage space that it requires while running
from start to completion.
• space complexity
90. A _________ is a piece of data provided as input to a function or procedure
• parameter
91. _________ solutions are often preferred since they are significantly more efficient than even
linear algorithms.
• Logarithmic
Advantages of Algorithm
• Effective Communication: Since algorithm is written in English like language, it is Simple
to understand step-by-step solution of the problems.
• Easy Debugging: Well-designed algorithm makes debugging easy so that we can Identify
logical error in the program.
• Easy and Efficient Coding: An algorithm acts as a blueprint of a program and helps
during program development.
• Independent of Programming Language: An algorithm is independent of programming
languages and can be easily coded using any high level language.
Disadvantages of Algorithm
• Developing algorithm for complex problems would be time consuming and difficult to
understand.
• Understanding complex logic through algorithms can be very difficult.
There are two common methods of representing an algorithm — flowchart and Pseudo code
92. A ________ is a type of diagram that represents an algorithm, workflow or process, showing
the steps as boxes of various kinds, and their order by connecting them with arrows.
• flowchart
93. __________ are used in analysing, designing, documenting or managing a process or program in
various field.
• Flowcharts
94. _________ is a diagram that shows each step or progression through a process.
• Flowcharts
95. A well-made _______ can be used to break big ideas into small, bite-sized pieces that are
expresse visually, so knowing how to make one is sort of like having a universal language.
• Flowcharts
96. __________ are a valuable type of business diagram but can also be used for more technical
fields like manufacturing or software engineering.
• Flowcharts
Flowchart Types
• The Process Flowchart or Process Flow Diagram
• The Workflow Chart or Workflow Diagram
• The Swimlane Flowchart
• The Data Flowchart
97. A ___________ is probably the most versatile of the four commonly used flowchart types
because it can be applied to virtually anything.
• process flowchart or process flow diagram
98. _________ can help quickly explain how something gets done in your organization.
• Process flow diagrams or process mapping
99. _________ can help quickly explain how something gets done in your organization.
• Process flow diagrams
These types of flowcharts use a standard language or notation, like Business Process Modelling
Notation (BPMN). Use a process flow diagram to:
• Map out roles and responsibilities within an organization to gain clarity.
• Describe the manufacturing process or inputs that go into creating a finished product.
• Draw up a proposal for a new process or project to understand its scope and steps.
• Show the way you wake up in the morning, as shown below.
100. A _________ shows the way a business or process functions.
• workflow chart
This type of workflow diagram can be used to:
• train new employees
• discover potential problem area
• create or organize your team around a new standard operating procedure
• clarify business operations by showing a high-level overview
101. The __________ comes in handy when one needs to show multiple flows of Information
side by side.
• swimlane flowchart
102. ________ might sound really similar to a workflow diagram, but the key here is that it
allows the creation of different categories where activity takes place.
• Swimlane diagrams
103. _________ diagram is great for documenting a whole process that interacts with
different segments of an organization or requires collaboration among different teams.
• 102. Swimlane
104. A ________ shows the way data is processed.
• data flowchart
105. A data flowchart or ___________ shows the way data is processed.
• data flow diagram
Areas for using Flowcharts
• Sales & Marketing
• Manufacturing
• Business Operations
• Software Engineering or Programming
• Show the sales process and chart an opportunity’s movement through that process
• Help identify opportunities based on data
• Guide sales representatives’ decisions on pricing packages or quotes to customers
• Document policies or communications plans
Manufacturing
Flow diagrams are extremely valuable in manufacturing, where standardization and uniformity
are important. In manufacturing, they’re used to:
• Show the ingredients, chemicals, or other inputs that go into the creation of a product
• Clearly illustrate the manufacturing process to show dependencies and bottlenecks
• Create a consistent quality assurance or evaluation process
Business Operations
Visualizing your operations will help your team perform consistently. A flow diagram can:
• Help on board employees by describing tasks or routines
• Document order and fulfilment processes
• Describe a project and identify milestones for its completion
• Stick to one font to make flowcharts easy to follow. Also, make sure that the fonts Are
easy to read and large enough.
• Fewer words the better. Because documentation is important, don’t get rid of it
completely
• Know your audience and how to speak to them. Some flowcharts have to be more
technical than others but make sure the people reviewing them understand them. when
possible, make your charts as straightforward as possible.
• Share flowcharts with the right teams. Any teams that are affected by the information
in the flowchart need to know where to find it. Set up a documentation process that
ensures that the right people see the charts.
Differences between Algorithm and Flowchart
Algorithm
Flowchart
Advantages of Flowcharts
• The flowchart shows the logic of a problem displayed in pictorial fashion which
felicitates easier checking of an algorithm.
• The Flowchart is good means of communication to other users. It is also a compact
means of recording an algorithm solution to a problem.
• The flowchart allows the problem solver to break the problem into parts. These parts
can be connected to make master chart.
• The flowchart is a permanent record of the solution which can be consulted at a later
time.
106. Flowcharts are __________ that map out a process, so that one can easily communicate
it to other people.
• simple diagrams
107. _________ is a term which is often used in programming and algorithm based fields.
• Pseudo code
108. _________ is a methodology that allows the programmer to represent the
implementation of an algorithm.
• Pseudo code
109. ________ is the cooked up representation of an algorithm.
• Pseudo code
110. ________ is a false code or a representation of code which can be understood by Even
a layman with some school level programming knowledge.
• Pseudo code
111. _________ is simply an implementation of an algorithm in the form of annotations and
informative text written in Plain English.
• Pseudo code
112. __________ is a syntax-free description of an algorithm.
• Pseudo code
Reasons for using Pseudocode
• Better readability. Often, programmers work alongside people from other domains,
such as mathematicians, business partners, managers, and so on.
• Ease up code construction. When the programmer goes through the process of l
developing and generating Pseudo code, the process of converting that into real code
written in any programming language will become much easier and faster as well.
• A good middle point between flowchart and code. Moving directly from the idea to the
flowchart to the code is not always a smooth ride.
• Act as a start point for documentation. Documentation is an essential aspect of building
a good project.
• Easier bug detection and fixing. Since Pseudo code is written in a human-readable
Format, it is easier to edit and discover bugs before actually writing a single line of Code.
The core of Pseudo code is the ability to represent 6 programming constructs (always written In
uppercase):
• SEQUENCE represents linear tasks sequentially performed one after the other.
• WHILE a loop with a condition at its beginning.
• REPEAT-UNTIL a loop with a condition at the bottom.
• FOR another way of looping.
• IF-THEN-ELSE a conditional statement changing the flow of the algorithm.
• CASE the generalization form of IF-THEN-ELSE.
• Always capitalize the initial word (often one of the main 6 constructs).
• Have only one statement per line.
• Indent to show hierarchy, improve readability, and show nested constructs always end
multiline sections using any of the END keywords (ENDIF, ENDWHILE, etc.).
• Keep your statements programming language independent.
• Use the naming domain of the problem, not that of the implementation. E.g.,―Append
the last name to the first name, instead of ―name = first+ last.)
• Keep it simple, concise, and readable
Advantages of Pseudocode
If statements execute one or more statements when a condition is met. If the testing of that
condition is TRUE, the statement gets executed. But if it is FALSE (the condition is not met),then
nothing happens.
The If-Else Statement
This Control Structure allows a program to follow alternative paths of execution, whether a
Condition is met or not.
125. __________ is the automation of multi-step processes by organizing sequences of
actions, and Grouping the parts that need to be repeated.
• Iteration (Looping)
126. ________ can repeat a sequence of steps as often As necessary, and appropriate
repetitions of simple steps can solve complex problems.
• Iteration (Looping)
• For Loops: are the ones that execute for a prescribed number of times, as controlled by
a counter or an index.
• While Loops and Repeat Loops: are based on the onset and verification of a logical
condition. The condition is tested at the start or end of the loop construct.
127. _______ is a series of numbers with the characteristic that the next number in the
sequence is found by adding up the two numbers Before it: 0, 1, 1, 2, 3, 5, 8, 13, 21,…
• Fibonacci sequence
128. _________ sequence can be found in several natural phenomena, and has different
applications in finance, music, architecture, and other disciplines.
• Fibonacci
129. __________ is when we break a problem down into smaller parts to make it easier to
tackle.
• Decomposition
130. _________ is a useful problem-solving strategy.
• Decomposition
131. ________ saves a lot of time.
• Decomposition
132. ________ is the measure of the degree of interdependence between the modules. A
good Software will have low coupling
• Coupling
133. ________ is a measure of the degree to which the Elements of the module are
functionally related.
• Cohesion
134. _________ is the process of separating the functionality of a program into independent,
Interchangeable modules, such that each contains everything necessary to execute only one
aspect of the desired functionality.
• Modularizations
Motivations for Modularisation
One of the most prominent problems in software engineering has been how to program large
and complex pieces of software. Often, large projects involve hundreds of programmers working
on millions of lines of code.
The Followings are some of the major motivations.
• Ease of Debugging When debugging large programs, how and when any bugs occur can
become a mystery
• Reusable Code Modular code allows programmers to easily reuse code.
• Readability Modular code is code that is highly organized.
• Reliability All these advantages add up to one big advantage: reliability. Code that is
Easier to read, easier to debug, easier to maintain and easier to share will always run
Smoother with less errors.
One of the most important concepts of programming is the ability to group some lines of cod
Into a unit that can be included in our program.
• Program Control – Functions used to simply sub-divide and control the program. These
functions are unique to the program being written.
• Specific Task – Functions designed to be used with several programs. These functions
Perform a specific task and thus are usable in many different programs because the
Other programs also need to do the specific task.
The basic principle of Modularity is that systems should be built from cohesive, loosely coupled
components (modules); which means a system should be made up of different components that are
united and work together in an efficient way and such components have a well-defined function.
• Modular Decomposability
Decomposability simply means to break down something into smaller pieces. Modular
decomposability means to break down the problem into different sub-Problems in a
systematic manner.
• Modular Composability
Composability simply means the ability to combine modules that are created.
• Modular Understandability
Understandability simply means the capability of being understood, quality of
comprehensible.
• Modular Continuity
Continuity simply means unbroken or consistent or uninterrupted connection for a long
period of time without any change or being stopped.
• Modular Protection
Protection simply means to keep something safe from any harms, to protect against any
unpleasant means or damage.
• Manageability
• Team Programming
• Quality
135. _________ is a process to check if the program or the entire system is working same as
it was supposed to do, and not working as it was not supposed to do.
• Program testing
136. __________ can be done using manual and automated process.
• Program testing
Types of Program Tests
• Unit Test
• Integration Tests
• End-to-End Tests
• Functional Tests
• Smoke Tests
137. ________ are low-level tests that focus on testing a specific part of the system.
• Unit tests
138. ______ are cheap to write and fast to run.
• Unit tests
139. _________ check to see if the system meets our defined business requirements.
• End-to-end tests
140. UI stands for ______.
• User Interface
141. __________ focus on the business requirements of an application.
• Functional tests
142. _______ are basic tests that check basic functionality of the application.
• Smoke tests
Properties of Tests
• Fast
• Deterministic
• Automated
143. _________ can cause a defect or failure at any stage of the software development life
Cycle.
• Human errors
144. Human errors can cause a defect or failure at any stage of the ________ development
life Cycle.
• software
145. Human errors can cause a _____ or _______ at any stage of the software development
life Cycle.
• defect or failure
Need for Program Testing
Human errors can cause a defect or failure at any stage of the software development life
cycle. The results are classified as trivial or catastrophic, depending on the consequences of the
error.
The requirement of rigorous testing and their associated documentation during the software
development life cycle arises because of the following reasons:
• To identify defects
• To reduce flaws in the component or system
• Increase the overall quality of the system