0% found this document useful (0 votes)
58 views21 pages

CIT108 Problem-Solving Strategies Summary

The document provides an overview of problem-solving strategies, including definitions and classifications of problems as well as various methods such as algorithms, heuristics, and dynamic programming. It discusses the importance of abstraction in computer science and outlines the characteristics and steps involved in developing algorithms. Additionally, it highlights the advantages and disadvantages of algorithms and introduces flowcharts as a method for representing algorithms and processes.

Uploaded by

christamara246
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views21 pages

CIT108 Problem-Solving Strategies Summary

The document provides an overview of problem-solving strategies, including definitions and classifications of problems as well as various methods such as algorithms, heuristics, and dynamic programming. It discusses the importance of abstraction in computer science and outlines the characteristics and steps involved in developing algorithms. Additionally, it highlights the advantages and disadvantages of algorithms and introduces flowcharts as a method for representing algorithms and processes.

Uploaded by

christamara246
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CIT108 GENERAL SUMMARY

A is a plan used to find a solution or overcome a challenge.


problem-solving strategy

A problem-solving strategy is a plan used to find a ________ or ________a challenge.


solution or overcome

have different action plans associated with them.


Different strategies

Different strategies have different action plans___________ with them.


associated

A well-Known is trial and error.


strategy

A well Known strategy is .


trial and error

Problems themselves can be classified into two different known as ill-defined


and well-defined problems.
Categories

Problems themselves can be classified into two different categories known as


and ______.
ill-defined and well-defined problems

Problems was classified into two categories by .


Schacter 2009
represent issues that do not have clear goals, solution paths, or expected
solutions.
Ill-defined problems

have specific goals, clearly defined solutions, and clear expected solutions.
Well-defined problems

Various Methods of studying problem solving


✓ Introspection
✓ Simulation
✓ Computer modelling
✓ Experimentation.

A________ approach to problem-solving involves trying a number of different


solutions and ruling out those that do not work.
trial-and-error

1|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
________ is not typically one of the most time-efficient strategies, it is a commonly
used one.
Trial and error

A common type of strategy is an________


algorithm

A common type of________ is an algorithm.


strategy

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

are used frequently in our everyday lives, especially in computer science.


Algorithms

A is a general problem-solving framework.


heuristic

A heuristic is a general problem-solving .


framework

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

Another useful heuristic is the practice of accomplishing a large goal or task by


breaking it Into a series of________
smaller steps

The________ involves choosing and analysing an action at a series of smaller steps to


move closer to the goal.
Means-ends analysis

Means-ends analysis examples can be found by using the________


Tower of Hanoi paradigm.

Means-ends analysis examples can be found by using the Tower of________


Hanoi paradigm

2|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
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

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

Computer science is all about solving problems with________


computers
is all about solving problems with computers.
Computer science

is the sequential process of analysing information related to a given situation


and generating appropriate response options.
Problem Solving

is a precise sequence of instructions for solving a problem.


Algorithm
is often used as a way of describing a computer program to someone who
doesn‘t understand how to program a computer.
Pseudocode

is the process of converting a program into instructions that can be understood


by the computer.
Compiling

are errors with a program that cause it to stop working or produce incorrect or
undesirable results
Bugs

3|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
is the process of finding and fixing errors in program code.
Debugging

strategy is haracterized by a lack of sophistication in terms of their approach


to the Solution.
Brute-force Approach

typically takes the most direct or obvious route, without attempting to


minimize the number of operations required to compute the solution.
Brute-force Approach

is considered quite often in the course of searching.


Brute-force approach

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

is the first step of the divide and conquer strategy.


Divide

In step the problem is divided into smaller sub-problems until it is small enough
to be solved.
Divide

In step, sub-problems become smaller but still represent some part of the actual
problem.
Divide

A calls itself with smaller or simpler input values, known as the recursive case.
Recursive algorithm

When the divide step is implemented, the recursive case is determined which will
divide the problem into smaller .
sub-problems

The________ is normally implemented with recursion by specifying the recursive base


case.
conquer step

4|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
In________ step, the solution of the sub-problems is combined to solve the whole
problem.
Combine
In step, we merge output from the conquer step to solve bigger sub-problems.
Solution.
Combine

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

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

Is in contrast to the divide-and-conquer approach, which solves problems in a


top- down fashion.
Dynamic programming approach

is only justified if there is some degree of overlap in the sub-problems.


Dynamic programming approach

is often used to solve ptimization problems.


Dynamic programming

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.

5|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
Motivations for Greedy Approach
Here are the reasons for using the greedy approach:
✓ 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.

Are similar to dynamic programming in the sense that they are both tools for
optimization.
Greedy algorithms

Look for locally optimum solutions or in other words, a greedy choice, in the
hopes of finding a global optimum.
Greedy algorithms

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

This________ is dependent not only on the input data, but also on the values provided
by a Random number generator.
Randomized approach

are best suited in game-theoretic situations where we want to ensure fairness


in the face of mutual suspicion.
Randomized Approach

approach is widely used in computer and Information security as well as in


various computer-based games.
Randomized

Good strategies typically use some form of abstraction as a tool for dealing with this
.
complexity

Good strategies typically use some form of as a tool for dealing with this
complexity.
abstraction

are essential in the construction of appropriate models, designs, and


implementations that are fit for the particular purpose at hand.
Abstraction skills

6|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
is the creation of well-defined interfaces to hide the inner workings of computer
Programs from users.
Abstraction

is the process of identifying the general characteristics needed to solve a


problem while filtering out unnecessary information.
Abstraction

Abstraction is the process of identifying the general characteristics needed to solve a


problem while filtering out .
unnecessary information

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

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

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

The maps of many metropolitan public transport systems worldwide is a classic


example of a ________.
representational abstraction.

7|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
When you group things in terms of a set of common characteristics, you are .
generalizing

The type of abstraction that represents a computational method is .


procedural abstraction

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
In ________, the implementation detail of the computational method is hidden.
Functional abstraction

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

ADT stands for .


Abstract Data Type

LIFO stands for .


Last In , First Out

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.

Is one of the four cornerstones of computer science.


Abstraction

Abstraction is one of the________ of computer science.


four cornerstones

Abstraction is one of the four cornerstones of________.


computer science.

The________ aspect of abstraction is seen in the programming with the use of data
abstraction.
generalization

8|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
An________ is an effective step-by-step procedure for solving a problem in a finite
number of steps.
algorithm

An algorithm is an effective procedure for solving a problem in a finite number


of steps.
Step-by-step

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

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.

An________ can be defined as a complete, unambiguous, finite number of logical steps


for Solving a specific problem.
algorithm

Steps Involved in Algorithm Development


✓ Step1: Identification of input: For an algorithm, there are quantities to be supplied
called Input and these are fed externally. The input is to be identified first for any
specified Problem.
✓ Step2: Identification of output: From an algorithm, at least one quantity is
produced, called for any specified problem.
✓ Step3: Identify the processing operations: All the calculations to be performed in
order to Lead to output from the input are to be identified in an orderly manner.
✓ Step4: Processing Definiteness: The instructions composing the algorithm must
be clear and there should not be any ambiguity in them.
✓ Step5: Processing Finiteness: If we go through the algorithm, then for all cases,
the algorithm should terminate after a finite number of steps.
✓ Step6: Possessing Effectiveness: The instructions in the algorithm must be
sufficiently basic and in practice they can be carries out easily.

9|P ag e
Patronize us for other Summaries & Past Questions WS:08137025435
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.

is used to describe properties of an algorithm elating to how much of various


types of resources it consumes.
Algorithm efficiency

The________ (execution time) of an algorithm is the amount of time that it takes to


complete once it has begun.
runtime complexity

The________ of an algorithm is the amount of storage space that it requires while


running from start to completion.
space complexity

A is a piece of data provided as input to a function or procedure


parameter

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

10 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
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

are used in analysing, designing, documenting or managing a process or


program in various field.
Flowcharts

is a diagram that shows each step or progression through a process.


Flowcharts

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

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

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

can help quickly explain how something gets done in your organization.
Process flow diagrams or process mapping

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.

A shows the way a business or process functions.


Workflow chart

11 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
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

The________ comes in handy when one needs to show multiple flows of Information
side by side.
Swimlane flowchart

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

diagram is great for documenting a whole process that interacts with different
segments of an organization or requires collaboration among different teams.
Swimlane

A________ shows the way data is processed.


Data flowchart

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

In sales, flowcharts can be used to:


✓ 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

12 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
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

Software Engineering or Programming


These charts can describe highly technical information in a clearer way. While coding
or Working in software, diagrams can:
✓ Show how users navigate a page or use an application
✓ Describe how code is structured or organized
✓ Explain the flow of data through a system or a program
✓ Visualize an algorithm

Here are a few factors to consider when designing flowcharts.


Style and Design
✓ Direction is important. For the most part, charts should flow left-to-right or top-
to bottom. Eyes follow this path naturally, making it easier for people looking at
the flowchart to understand them.
✓ Keep them on one page when possible. Charts are easier to digest when they’re
simple and kept to one page. The more pages there are, the more complex the chart
Seems.
✓ Use consistent sizing and spacing because uniform design makes them easier to
read and follow.
✓ Include a chart key. There are standard symbols that most flowcharts use. Because
these symbols are standardized, they make it easier to understand the flowchart.
✓ Use no more than three colours. It’s tempting to want to use as many colours as
Possible to show a path or highlight certain information.

Text and Content


✓ 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

Access and Communication


✓ 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.

13 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
Differences between Algorithm and Flowchart
Algorithm
✓ A method of representing the step-by-step logical procedure for solving a problem
✓ It contains step-by-step English Descriptions, each step representing a particular
operation leading to solution of problem
✓ These are particularly useful for small
Flowchart
✓ Flowchart is diagrammatic representation of an algorithm. It is constructed using
different types of boxes and symbols.
✓ The flowchart employs a series of blocks and arrows, each of which represents a
particular step in an algorithm
✓ These are useful for detailed

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.

Flowcharts are that map out a process, so that one can easily communicate it to
other people.
simple diagrams

is a term which is often used in programming and algorithm based fields.


Pseudo code

is a methodology that allows the programmer to represent the implementation


of an algorithm.
Pseudo code

is the cooked up representation of an algorithm.


Pseudo code

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

is simply an implementation of an algorithm in the form of annotations and


informative text written in Plain English.
Pseudo code

is a syntax-free description of an algorithm.


Pseudo code

14 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
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.

Rules for writing Pseudocode


✓ 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
✓ Improves the readability of any approach.
✓ Acts as a bridge between the program and the algorithm or flowchart.
✓ The main goal of a pseudo code is to explain what exactly each line of a program
should do, hence making the code construction phase easier for the programmer.

is a powerful implementation technique in which a function calls itself (either


directly or indirectly) on a smaller problem of the same type in order to simplify the
problem To a solvable state.
Recursion

15 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
Every recursive function must have at least two cases: the recursive case and the base
case.

The________ is a small problem that we know how to solve and is the case that causes
the recursion to end.
base case

The _________is the more general case of the problem we're trying to solve
Recursive case

Types of Recursion
✓ Tail Recursion
✓ Linear Recursive
✓ Binary Recursive
✓ Exponential recursion
✓ Nested Recursion
✓ Mutual Recursion

GCD Stands for__________


Greatest Common Denominator

A function is a function that only makes a single call to itself each time the
Function runs (as opposed to one that would call itself multiple times during its
execution).
linear recursive

The factorial function is a good example of .


linear recursion

The________ is a good example of linear recursion.


Factorial function

can be considered as the building blocks of computer programs.


Control Structures

Control Structures can be considered as the building blocks of .


computer programs.

Are commands that enable a program to ―take decisions‖, following one path
or another.
Control Structures

are the blocks that analyse variables and choose directions in which to go based
on given parameters.
Control Structures

16 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
The basic Control Structures in programming languages are:
✓ Selection (Conditionals): which are used to execute one or more statements if a
condition is met.
✓ Iteration (Loops): which purpose is to repeat a statement a certain number of times
Or while a condition is fulfilled.

Selection is at the very core of .


programming

The If Statement
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.

Is the automation of multi-step processes by organizing sequences of actions,


and Grouping the parts that need to be repeated.
Iteration (Looping)

can repeat a sequence of steps as often As necessary, and appropriate


repetitions of simple steps can solve complex problems.
Iteration (Looping)

In general terms, there are two types of ―Looping techniques‖:


✓ 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.

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

sequence can be found in several natural phenomena, and has different


applications in finance, music, architecture, and other disciplines.
Fibonacci

is when we break a problem down into smaller parts to make it easier to tackle.
Decomposition

is a useful problem-solving strategy.


Decomposition

17 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
_________ saves a lot of time.
Decomposition

is the measure of the degree of interdependence between the modules. A good


Software will have low coupling
Coupling
is a measure of the degree to which the Elements of the module are functionally
related.
Cohesion

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.

Basic concept of Modularisation


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.

Generally, functions fall into two categories:


✓ 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.

Basic Properties of Modularity


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.

Some of these Criteria are given below:

18 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
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.

Advantages of modularisation in Programming


✓ Manageability
✓ Team Programming
✓ Quality

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

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

are low-level tests that focus on testing a specific part of the system.
Unit tests

are cheap to write and fast to run.


Unit tests

check to see if the system meets our defined business requirements.


End-to-end tests

UI stands for__________.
User Interface

focus on the business requirements of an application.


Functional tests

19 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
are basic tests that check basic functionality of the application.
Smoke tests

Properties of Tests
✓ Fast
✓ Deterministic
✓ Automated

can cause a defect or failure at any stage of the software development life Cycle.
Human errors

Human errors can cause a defect or failure at any stage of the development life
Cycle.
Software

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

Benefits of Program Testing


✓ Modify Code with Confidence
✓ Identify Bugs Early
✓ Improve System Design

is a computer programing process for finding and resolving errors in software


or a Website, often referred to as “bugs.”
Debugging

Importance of Debugging
Debugging is important because it allows software engineers and developers to fix
errors in a program before releasing it to the public.

20 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435
Types of Errors to Debug
✓ Syntax errors
✓ Logic errors
✓ Run-time errors
✓ Interface errors

are grammatical interruptions in a line of code.


Syntax errors
are issues in the code’s algorithms.
Logic errors

occur when a person uses the program and they’re detected by the
computer executing it.
Run-time errors

involve a disconnect in an API, which means one or both coding languages in


an API cause this error to occur.
Interface errors

Common Debugging Strategies


✓ Run a Debugging Feature
✓ Use the Scientific Method
✓ Debug after Adding New Code
✓ Incorporate the Backtracking Method
✓ Perform the Binary Search Method
✓ Classify Different Bug Types
✓ Involve Static Code Analysis
✓ Try Remote Debugging

21 | P a g e
Patronize us for other Summaries & Past Questions WS:08137025435

Common questions

Powered by AI

Randomized approaches introduce unpredictability by utilizing random number generators, which helps ensure fairness in game-theoretic situations. By making the outcomes less deterministic, these strategies prevent exploitation by players with complete information, promoting equitable conditions where mutual suspicion exists. This randomness can negate advantages that one party may have over another, leading to a fairer interaction .

Divide-and-conquer is a top-down approach that breaks down a problem into smaller sub-problems, solves each sub-problem recursively, and then combines the results. In contrast, dynamic programming is a bottom-up technique that typically starts by solving the smallest sub-problems, saves these results, and reuses them to tackle larger sub-problems. The key distinction lies in the overlapping sub-problems that dynamic programming leverages, unlike the typically distinct sub-problems in divide-and-conquer .

Pseudocode is highly effective for problem-solving as it provides a syntax-free, readable format that bridges the gap between algorithm design and actual coding. It enhances readability and ease of bug detection before actual coding begins. Flowcharts, while useful in visually representing the logic of algorithms, can become complex and unwieldy for large problems. Pseudocode facilitates a smooth transition to coding by providing a narrative form, making it accessible to those outside programming domains .

Abstraction is crucial in managing complexity as it simplifies intricate systems by filtering out unnecessary details and highlighting general characteristics. This simplification allows for the construction of appropriate models and designs tailored to specific purposes while ignoring superfluous complexity. It streamlines communication and understanding by providing well-defined interfaces that encapsulate complex processes .

The brute-force approach, characterized by its directness and lack of sophistication, often results in significant computational overhead due to the exhaustive exploration of all possible solutions. While it guarantees finding a solution if one exists, it is inefficient in terms of time and resource consumption. The trade-offs include simplicity and guaranteed solutions versus high operational cost and non-viability for large data sets or complex problems .

Using algorithms in complex scenarios can be time-consuming due to the difficulty in devising clear, unambiguous steps. They may fail to handle intricate logic and dependencies effectively, leading to convoluted solutions that are hard to comprehend and implement. Additionally, extensive algorithms risk becoming inefficient in resource usage when addressing multifaceted problems .

An effective algorithm is defined by its precision, uniqueness, finiteness, input-output specificity, and efficiency in resource consumption. It should clearly state each step, terminate after a finite sequence, provide distinct operations influenced solely by inputs and prior results, and exhibit both runtime and space efficiency .

A decision matrix assists in problem-solving by allowing the ranking of potential solutions based on various criteria such as timeliness, manageability, risk, expense, practicality, and effectiveness. This systematic approach enables a structured evaluation and comparison of different options, facilitating a more informed and balanced decision-making process by quantifying and weighing each criterion .

Flowcharts enhance communication by visually depicting the flow of data and structure of code, making complex processes more accessible. They facilitate clearer understanding by using standardized symbols and sequencing, aiding in documentation, onboarding, and ensuring consistency across team members by providing a unified reference point throughout the software development lifecycle .

The greedy algorithm prioritizes immediate, local optima at each decision point, which does not guarantee a globally optimal solution. It lacks foresight and does not consider future consequences of choices, which can lead to suboptimal overall results. Therefore, while it can quickly yield a feasible solution, its simplicity and short-sightedness make it unsuitable for problems where a global optimum is required .

You might also like