December 16, 2025

WatuCrash

Where Creativity Meets Opportunity

Computer Science

PROBLEM SOLVING AND ALGORITHM

PROBLEM SOLVING


Problem Solving
Concept of Problem Solving
It is required to solve problems at some point in our daily lives. Activities such as paying school fees, making payments using mobile money, buying various items from a shop, or withdrawing money from a bank account are tasks that need problem solving. If you are watching the Tanzania Broadcasting Corporation (TBC) channel on your TV and you want to shift to another channel, you will need to do something, such as push the channel number on your remote to transfer to that channel. This is an example of problem-solving.

A group of students in a class may decide to go on a study tour and choose to share the cost. Calculating overall expenses and the amount each person must contribute to the study tour is also a form of problem solving.

The problem is a kind of obstacle to accomplishing your goal, and problem solving is a method of removing that obstacle through a series of activities. The process taken to arrive at a feasible solution may vary from one to another.

Problem solving in computer science can be defined as the process of identifying a problem, developing a set of procedures (steps) to solve the identified problem and implementing the proposed steps to create a computer program.

Importance of Problem Solving in Programming

This is because it is much easier to discover errors in a program that is well analysed rather than one that is not. For this reason, it is recommended to spend a considerable amount of time analysing a problem and planning for a solution before implementing.


To be a good problem solver and a good programmer, you need to follow good problem solving techniques. Applying problem solving techniques is very important before developing computer programs.

Applying appropriate problem solving technique is essential in programming development in order to meet user and system requirements.

Problem Solving Process
To successfully instruct a computer, you must thoroughly understand the problem to be solved. Also, you should be able to plan a technique for solving it in the form of a set of consecutive steps. Instructing the computer to solve the problem becomes relatively easier after it is well-defined and a strategy for solving it has been created.

  1. Identify and Define the Problem
    This stage involves understanding and interpreting the problem. It would be helpful if you could describe the problem you are trying to solve. Break your problem down into manageable smaller pieces/parts and refine it at each stage. You should check whether the problem you are trying to solve is relevant before attempting to develop an algorithm to solve it.
  2. Generate Possible Solutions
    At this stage, think and ask yourself this question: what could be an alternative solution to the problem? Make a list of several feasible solutions that you believe will adequately solve the problem. You can review the possible solutions and then select a single solution favouring the many problem-solving possibilities provided.

Having various options can significantly improve the value of your perfect solution. Different alternative solutions must be generated before the last evaluation. Once you have decided on the “what”, it creates a foundation for establishing the structure for analysing options by evaluating each solution.

  1. Evaluate Alternatives
    After gathering several alternatives, you will need to examine them to choose the best one. The best option is the one that is agreed upon with the team, that solves the problem, and which is simple to implement using available resources. When evaluating alternatives, do not be biased because this can lead you to discarding the best alternative and opting for the worst. At this stage, try to narrow down the options to just one.
  2. Decide on a Solution
    After you have come up with solutions and alternatives to the problem, you need to explore the strengths and weaknesses of each option while forecasting outcomes. Several influencing factors can be used to help you determine whether to take it or leave it out. Criteria must be set to help you select the best one.

Sometimes pure facts dictate which ideas will work and which one will not. In some situations, feelings and intuitions decide the solution. Try to shortlist and refine the shortlisted solution to as few options as possible. Lastly, you need to have one or two expected solutions for implementation from the whole list.

  1. Implement the Solution
    After selecting the best solution, it is necessary to consider how it might be implemented. Providing insight into funding potential problems with implementing the solution, and the time frame of implementing the solution are essential for any workable solution. Not all solutions can be implemented. Finally, you need to develop an action plan to implement and execute the solution process in this stage.

Programming Process
The problem solving process applies to every work in life. It also assumes that you have already known a number of existing solutions to choose from in order to select the best solution. Sometimes you may be required to propose your own solution, creating it from scratch. The process of developing or creating your own solution involves sequential steps.

In programming context, these steps are summarised to fit in the perspective of developing a system or program. These steps, commonly known as five steps in a programming process, are:

Defining and analysing the problem

Designing or planning the solution

Coding the program

Testing and debugging the program

Documenting the program

Algorithm Representation
Concept of Algorithm
In daily life, you perform activities by following steps. Examples include getting ready for exercise, making breakfast, riding a bicycle, wearing shoes, and washing utensils. To complete each of these activities, you follow a sequence of steps.

For example, the following are the steps required to ride a bicycle:
(a) Remove the bicycle from the stand;
(b) Sit on the seat of the bicycle;
(c) Start peddling;
(d) Use brakes whenever needed; and
(e) Stop on reaching the destination.

Thus, a set of procedures required to perform a given task or to solve a problem is known as an algorithm. An algorithm is a set of steps that generate a predictable sequence of basic computational processes leading to a solution of the given problem. It is a method of representing the systematic and logical procedure for solving a problem.

Before developing an algorithm for solving a given problem, think of what will be the output when such algorithm is executed.

Importance of Algorithm
(a) An algorithm is essential in enhancing a computer program according to the available resources;
(b) It enables you to solve a problem through better approaches;
(c) It saves for the best program speed and desired minor memory consumption;
(d) It emphasises solving problems most straightforwardly.

Characteristics of a Suitable Algorithm
(a) Well defined input: an algorithm requires some input values. Such input values can be zero or more, but only a finite number of inputs are required.
(b) Well defined output: the algorithm must give the output (one or more) once executed, and that output must relate to the input.
(c) Unambiguity: instructions must be clear, precise, and well communicated.
(d) Effectiveness: each instruction should be adequate and correctly achieve its purpose within a finite time.
(e) Programming language independence: an algorithm should not depend on any specific programming language and should always provide the same results.
(f) Fitness: an algorithm must be composed of a finite number of steps.
(g) Termination: the algorithm must terminate and should not go into an infinite loop.

Qualities of a Good Algorithm
(a) Memory utilisation: the best algorithm consumes the least amount of memory.
(b) Efficiency: the best algorithm enables a program to produce results using less processing power in a short time.
(c) Cost-effective: the best algorithm is simple, straightforward, and produced at minimal cost.
(d) Accuracy: the best algorithm provides more accurate results than other existing algorithms.

Recommendations for Writing a Suitable Algorithm
(a) Instructions should be clear and precise;
(b) Write algorithms in a sequence;
(c) Avoid infinite repetitions;
(d) Use phrases that resemble typical English language;
(e) Ensure the algorithm will terminate;
(f) Ensure expected results are obtained after termination.

Uses of Algorithm
The use of an algorithm aims at increasing reliability, accuracy, and efficiency of obtaining solutions. Algorithms are helpful for small and complicated problems.

Leave a Reply

Your email address will not be published. Required fields are marked *