Problem solving using Algorithms
Dr Jyotika Pruthi
As we are living in the digital era, we enjoy exploring different Android/iOS/Windows apps, web apps on everyday basis. Many students are choosing computer science as their career option as they are tempted to develop their own applications. It becomes important to understand the importance of learning algorithms. An algorithm is a step-by-step procedure to solve a problem. The algorithm is implemented using a programming language and we get a Program. Algorithm written correctly, helps to solve the problem in a precise manner.
Activity
Develop an algorithm to cross a highway on foot.
Steps to write an algorithm
1. Understand the problem with its outcome: Its important to have a clear picture of the specific problem you wish to solve or the task you want it to accomplish.
2. Decide the starting point: It is challenging to identify the start and the end point which are crucial to list the steps of any process. To determine the starting point, try to answer the following questions:
- What data is available?
- What is the location of the data?
- What are the constraints/rules to work with the available data?
- How are the values of the data related to each other?
3. Decide the end point: As we identified the starting point, we can determine the end point of the algorithm by finding answers to the following questions:
- What are the changes coming in from start to end?
- What would be the additions or what would be removed?
4. Think and determine how each step would be achieved: As we have the step-by-step outline, its important to think about coding of each step. The language we would use, the resources available, identifying robust and efficient way to accomplish each step are some of the important aspects we need to consider.
5. Review the algorithm: As we complete writing the algorithm, it is equally important to evaluate it. The algorithm has been designed to achieve a certain goal so that we can start writing a program using it. Try to answer the following questions:
- Does the algorithm solve the task that it was supposed to solve?
- Does the algorithm have clearly defined inputs and outputs?
- Do we need to make changes in any of the steps to simplify them?
- Does the algorithm guarantee the correct result?
— The writer is Design Thinker, Computer Scientist, Email: jyotika0507@gmail.com