Nov 2, 2023 · Different types of problems require different types of algorithmic techniques to be solved in the most optimized manner. There are many types of algorithms but the most important and fundamental algorithms that you must are discussed in this article. 1. Brute Force Algorithm: This is the most basic and simplest type of algorithm. ... Feb 23, 2022 · Problem Solving Process. The process of problem-solving is an activity which has its ingredients as the specification of the program and the served dish is a correct program. This activity comprises of four steps : 1. Understanding the problem: To solve any problem it is very crucial to understand the problem first. What is the desired output ... ... Jul 21, 2022 · Problem-Solving Techniques. There are three different types of problem-solving techniques. Program ; Algorithm; Flowchart; Program. A set of instructions given to a computer to solve a problem is called a program. A computer works according to the given instructions in the program. Computer programs are written in programming languages. ... Solving Problems with Solutions Requiring Sequential Processing Overview Computer programming is not just programming language syntax and using a development environment. At its core, computer programming is solving problems. We will now turn our attention to a structured methodology you can use to construct solutions for a given problem. ... to apply problem solving techniques. Problem solving begins with the precise identification of the problem and ends with a complete working solution in terms of a program or software. Key steps required for solving a problem using a computer are shown in Figure 4.1 and are discussed in following subsections. 4.2.1 Analysing the problem ... 1-2 Introduce data collection and problem solving. 3 Introduce the four steps of the problem solving process. 4-6 Apply the problem solving process. Use different strategies to plan and carry out the plan to solve several problems. 7-9 Reinforce the four steps of the problems solving process. 10-12 Count in the binary number system. ... While it might appear that problem-solving and decision-making are interchangeable terms, they signify distinct aspects of addressing challenges in computer science. Problem-solving: Within a computer science context, problem-solving involves identifying an issue within a system, application, or theory and resolving it effectively. This process ... ... How to begin the problem-solving process . Programmers must solve many different types of problems. One problem that students often encounter in programming classes is how to find the lowest or highest value in a list of numbers. Review the following example, and note the steps a programmer could take to solve the problem. Example problem: Find ... ... A computational problem is a problem that can be solved step-by-step with a computer. These problems usually have a well-defined input, constraints, and conditions that the output must satisfied. Here are some types of computational problems: A decision problem is one where the answer is yes or no. ... ">
  • Python Programming
  • C Programming
  • Numerical Methods
  • Dart Language
  • Computer Basics
  • Deep Learning
  • C Programming Examples
  • Python Programming Examples

Problem Solving Using Computer (Steps)

Computer based problem solving is a systematic process of designing, implementing and using programming tools during the problem solving stage. This method enables the computer system to be more intuitive with human logic than machine logic. Final outcome of this process is software tools which is dedicated to solve the problem under consideration. Software is just a collection of computer programs and programs are a set of instructions which guides computer’s hardware. These instructions need to be well specified for solving the problem. After its creation, the software should be error free and well documented. Software development is the process of creating such software, which satisfies end user’s requirements and needs.

The following six steps must be followed to solve a problem using computer.

  • Problem Analysis
  • Program Design - Algorithm, Flowchart and Pseudocode
  • Compilation and Execution
  • Debugging and Testing
  • Program Documentation
  • Trending Now
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial

CBSE Class 11 | Problem Solving Methodologies

Problem solving process.

The process of problem-solving is an activity which has its ingredients as the specification of the program and the served dish is a correct program. This activity comprises of four steps : 1. Understanding the problem: To solve any problem it is very crucial to understand the problem first. What is the desired output of the code and how that output can be generated? The obvious and essential need to generate the output is an input. The input may be singular or it may be a set of inputs. A proper relationship between the input and output must be drawn in order to solve the problem efficiently. The input set should be complete and sufficient enough to draw the output. It means all the necessary inputs required to compute the output should be present at the time of computation. However, it should be kept in mind that the programmer should ensure that the minimum number of inputs should be there. Any irrelevant input only increases the size of and memory overhead of the program. Thus Identifying the minimum number of inputs required for output is a crucial element for understanding the problem.

2. Devising the plan: Once a problem has been understood, a proper action plan has to be devised to solve it. This is called devising the plan. This step usually involves computing the result from the given set of inputs. It uses the relationship drawn between inputs and outputs in the previous step. The complexity of this step depends upon the complexity of the problem at hand.

3. Executing the plan: Once the plan has been defined, it should follow the trajectory of action while ensuring the plan’s integrity at various checkpoints. If any inconsistency is found in between, the plan needs to be revised.

4. Evaluation: The final result so obtained must be evaluated and verified to see if the problem has been solved satisfactorily.

Problem Solving Methodology(The solution for the problem)

The methodology to solve a problem is defined as the most efficient solution to the problem. Although, there can be multiple ways to crack a nut, but a methodology is one where the nut is cracked in the shortest time and with minimum effort. Clearly, a sledgehammer can never be used to crack a nut. Under problem-solving methodology, we will see a step by step solution for a problem. These steps closely resemble the software life cycle . A software life cycle involves several stages in a program’s life cycle. These steps can be used by any tyro programmer to solve a problem in the most efficient way ever. The several steps of this cycle are as follows :

Step by step solution for a problem (Software Life Cycle) 1. Problem Definition/Specification: A computer program is basically a machine language solution to a real-life problem. Because programs are generally made to solve the pragmatic problems of the outside world. In order to solve the problem, it is very necessary to define the problem to get its proper understanding. For example, suppose we are asked to write a code for “ Compute the average of three numbers”. In this case, a proper definition of the problem will include questions like : “What exactly does average mean?” “How to calculate the average?”

Once, questions like these are raised, it helps to formulate the solution of the problem in a better way. Once a problem has been defined, the program’s specifications are then listed. Problem specifications describe what the program for the problem must do. It should definitely include :

what is the input set of the program

What is the desired output of the program and in what form the output is desired?

2. Problem Analysis (Breaking down the solution into simple steps): This step of solving the problem follows a modular approach to crack the nut. The problem is divided into subproblems so that designing a solution to these subproblems gets easier. The solutions to all these individual parts are then merged to get the final solution of the original problem. It is like divide and merge approach.

Modular Approach for Programming :

The process of breaking a large problem into subproblems and then treating these individual parts as different functions is called modular programming. Each function behaves independent of another and there is minimal inter-functional communication. There are two methods to implement modular programming :

  • Top Down Design : In this method, the original problem is divided into subparts. These subparts are further divided. The chain continues till we get the very fundamental subpart of the problem which can’t be further divided. Then we draw a solution for each of these fundamental parts.
  • Bottom Up Design : In this style of programming, an application is written by using the pre-existing primitives of programming language. These primitives are then amalgamated with more complicated features, till the application is written. This style is just the reverse of the top-down design style.

3. Problem Designing: The design of a problem can be represented in either of the two forms :

The ways to execute any program are of three categories:

  • Sequence Statements Here, all the instructions are executed in a sequence, that is, one after the another, till the program is executed.
  • Selection Statements As it is self-clear from the name, in these type of statements the whole set of instructions is not executed. A selection has to be made. A selected number of instructions are executed based on some condition. If the condition holds true then some part of the instruction set is executed, otherwise, another part of the set is executed. Since this selection out of the instruction set has to be made, thus these type of instructions are called Selection Statements.

Identification of arithmetic and logical operations required for the solution : While writing the algorithm for a problem, the arithmetic and logical operations required for the solution are also usually identified. They help to write the code in an easier manner because the proper ordering of the arithmetic and logical symbols is necessary to determine the correct output. And when all this has been done in the algorithm writing step, it just makes the coding task a smoother one.

  • Flow Chart : Flow charts are diagrammatic representation of the algorithm. It uses some symbols to illustrate the starting and ending of a program along with the flow of instructions involved in the program.

4. Coding: Once an algorithm is formed, it can’t be executed on the computer. Thus in this step, this algorithm has to be translated into the syntax of a particular programming language. This process is often termed as ‘coding’. Coding is one of the most important steps of the software life cycle. It is not only challenging to find a solution to a problem but to write optimized code for a solution is far more challenging.

Writing code for optimizing execution time and memory storage : A programmer writes code on his local computer. Now, suppose he writes a code which takes 5 hours to get executed. Now, this 5 hours of time is actually the idle time for the programmer. Not only it takes longer time, but it also uses the resources during that time. One of the most precious computing resources is memory. A large program is expected to utilize more memory. However, memory utilization is not a fault, but if a program is utilizing unnecessary time or memory, then it is a fault of coding. The optimized code can save both time and memory. For example, as has been discussed earlier, by using the minimum number of inputs to compute the output , one can save unnecessary memory utilization. All such techniques are very necessary to be deployed to write optimized code. The pragmatic world gives reverence not only to the solution of the problem but to the optimized solution. This art of writing the optimized code also called ‘competitive programming’.

5. Program Testing and Debugging: Program testing involves running each and every instruction of the code and check the validity of the output by a sample input. By testing a program one can also check if there’s an error in the program. If an error is detected, then program debugging is done. It is a process to locate the instruction which is causing an error in the program and then rectifying it. There are different types of error in a program : (i) Syntax Error Every programming language has its own set of rules and constructs which need to be followed to form a valid program in that particular language. If at any place in the entire code, this set of rule is violated, it results in a syntax error. Take an example in C Language

In the above program, the syntax error is in the first printf statement since the printf statement doesn’t end with a ‘;’. Now, until and unless this error is not rectified, the program will not get executed.

Once the error is rectified, one gets the desired output. Suppose the input is ‘good’ then the output is : Output:

(ii) Logical Error An error caused due to the implementation of a wrong logic in the program is called logical error. They are usually detected during the runtime. Take an example in C Language:

In the above code, the ‘for’ loop won’t get executed since n has been initialized with the value of 11 while ‘for’ loop can only print values smaller than or equal to 10. Such a code will result in incorrect output and thus errors like these are called logical errors. Once the error is rectified, one gets the desired output. Suppose n is initialised with the value ‘5’ then the output is : Output:

(iii) Runtime Error Any error which causes the unusual termination of the program is called runtime error. They are detected at the run time. Some common examples of runtime errors are : Example 1 :

If during the runtime, the user gives the input value for B as 0 then the program terminates abruptly resulting in a runtime error. The output thus appears is : Output:

Example 2 : If while executing a program, one attempts for opening an unexisting file, that is, a file which is not present in the hard disk, it also results in a runtime error.

6. Documentation : The program documentation involves :

  • Problem Definition
  • Problem Design
  • Documentation of test perform
  • History of program development

7. Program Maintenance: Once a program has been formed, to ensure its longevity, maintenance is a must. The maintenance of a program has its own costs associated with it, which may also exceed the development cost of the program in some cases. The maintenance of a program involves the following :

  • Detection and Elimination of undetected errors in the existing program.
  • Modification of current program to enhance its performance and adaptability.
  • Enhancement of user interface
  • Enriching the program with new capabilities.
  • Updation of the documentation.

Control Structure- Conditional control and looping (finite and infinite)

There are codes which usually involve looping statements. Looping statements are statements in which instruction or a set of instructions is executed multiple times until a particular condition is satisfied. The while loop, for loop, do while loop, etc. form the basis of such looping structure. These statements are also called control structure because they determine or control the flow of instructions in a program. These looping structures are of two kinds :

In the above program, the ‘for’ loop gets executed only until the value of i is less than or equal to 10. As soon as the value of i becomes greater than 10, the while loop is terminated. Output:

In the above code, one can easily see that the value of n is not getting incremented. In such a case, the value of n will always remain 1 and hence the while loop will never get executed. Such loop is called an infinite loop. Output:

Similar Reads

  • CBSE Class 11 | Problem Solving Methodologies Problem Solving Process The process of problem-solving is an activity which has its ingredients as the specification of the program and the served dish is a correct program. This activity comprises of four steps : 1. Understanding the problem: To solve any problem it is very crucial to understand th 13 min read
  • Critical Thinking Math Problems Ability to make decisions by the application of logical, sceptic, and objective analyses and evaluations of data, arguments, and other evidence is known as critical thinking. Regarding mathematics, critical thinking is not only about making calculations but also involves logical reasoning, pattern r 10 min read
  • Class 11 NCERT Solutions - Chapter 1 Sets - Exercise 1.6 Chapter 1 of Class 11 NCERT Mathematics focuses on "Sets" a fundamental concept in mathematics that provides the basis for the various mathematical structures and operations. Understanding sets is crucial for grasping more advanced topics in algebra, calculus, and discrete mathematics. Exercise 1.6 8 min read
  • NCERT Solutions for Class 9 English Moments Chapter 1 The Lost Child We have tried to provide NCERT Solutions for Supplementary English Class 9 Chapter 1 The Lost Child covering each & every question of Supplementary English. Students will improve their answer writing skills by referring to the following NCERT Solutions for Class 9 Supplementary English Moments. 6 min read
  • NCERT Solutions for Class 9 English Beehive Chapter 3 The Little Girl We have tried to provide NCERT Solutions for Class 9 English- Chapter 3 The Little Girl covering each and every question of the textbook Beehive. Students will improve their answer writing skills by referring to the following NCERT Solutions for Class 9 English Beehive. The following NCERT Solutions 13 min read
  • NCERT Solutions for Class 9 English Beehive Chapter 1 The Fun They Had We have tried to provide NCERT Solutions for Class 9 English Chapter 1 The Fun They Had covering each and every question of the textbook Beehive. Students will improve their answer writing skills by referring to the following NCERT Solutions for Class 9 English Beehive. The following NCERT Solutions 14 min read
  • CBSE 10th Board Exam Experience For every Indian student, the Central Board of Secondary Education (CBSE) 10th board exams mark a significant milestone in their academic journey. These exams are not just assessments of academic prowess; they are rites of passage, symbolizing the transition from secondary to higher secondary educat 4 min read
  • How to read Competitive Programming Questions? Competitive Programming is considered as a sport in the field of computer science. The culture of this sport is growing day by day and a lot of people are also considering this as a career choice. So, to help the participants with improving their efficiency in this sport, in this post, we have tried 5 min read
  • Non Verbal Reasoning : Paper Cutting Non-verbal reasoning is integral to the Staff Selection Commission (SSC) Combined Graduate Level (CGL) examination, which no student should avoid. You can take a good lead in this section with practice. One common and very important topic of Non-Verbal reasoning is paper cutting, which involves anal 6 min read
  • Non-Verbal Reasoning : Dot Situation SSC CGL examination has one of the most important sections i.e. Non-Verbal Reasoning section. It includes many important topics and out of which Dot Situation-related questions are frequently asked. Sometimes, Dot situation-based questions can be tricky and confusing, but with continuous practice an 4 min read
  • Accolite Interview Experience | Set 4 (On-Campus) Round 1 (Written) Around 140 students appeared for the offline test. There were 20 MCQs that to be done in (30 minutes), questions were from OS,DBMS,Datastructures. After that coding round was there (paper coding) in which 3 questions were given and we have to attempt any 2 (1 hour) 1. Write your ow 8 min read
  • Points to focus on while doing Competitive Programming Competitive Programming is vital for one’s development in the coding field. This article is going to discuss some basics points one should keep in mind while competing. Make a list of functions to perform tasks that are encountered frequently in questions and add them to your code in the form of a t 5 min read
  • OLA Interview Experience | Set 11 ( For Internship) Round 1 (Online Test): Four Programming Questions- a) Given a string find number of different substrings that are palindromes. b) In a matrix we can destruct it's one column by vanishing any of the element in column . We have to destruct the matrix completely so that sum of the elements destucted by 2 min read
  • Final Exam | Google Kickstart 2021 Round D It's time for the final exam in algorithms and data structures! Edsger prepared N sets of problems. Each set consists of problems in an increasing difficulty sequence; the i-th set can be described by two integers Ai and Bi (Ai≤Bi), which denotes that this set contains problems with difficulties Ai, 12 min read
  • Cisco Interview Experience | Set 9 (For Experienced) Written Test: 1) 15 Aptitude Questions 2) 25 CS Fundamentals & Couple of output questions. 3) Coding Question: A thief trying to escape from a jail has to cross 'N' walls each with varying heights. He climbs 'X' feet every time. But, due to the slippery nature of those walls, every times he slip 2 min read
  • Amazon Interview | Set 55 (On-Campus) Online Test on InterviewStreet: 18 MCQs (Normal C loop questions, networking, dbms, os, analytical) 2 Coding questions 1. Check if an undirected graph is a tree or not. 2. Given an array of integers, print the 2 elements with least absolute difference. Interview Rounds:- Round 1: Tell me about yours 4 min read
  • MakeMyTrip Interview Experience | Set 6 (Online Coding) Round-1: Online test There were 2 sections – Aptitude and Coding Section A- 20 MCQ's on General Aptitude. Section B- There were 3 coding questions. 1) Given an array and 2 numbers l,r find the number of elements in the array in between l and r; 2) Calculate a power b (b -> [1,1000000000] (required a 3 min read
  • Microsoft Interview experience | Set 98 (On Campus for IDC) Round 1 : (1hr 15 min) Online test on CoCubes contains 3 Coding Questions Calculate difficulty of a given sentence. Where difficulty of a word is: Word is hard if it has 4 consecutive consonants or number of consonants are more than number of vowels else word is easy. Difficulty of sentence is defin 3 min read
  • MakeMyTrip Interview Experience | Set 8 (On-Campus) MakeMyTrip recently visited our campus. There were 4 rounds. Online Round ( 1 Hour ) This round consisted of 20 aptitude questions and 3 coding Questions. Coding Questions: 1. Find ‘x’ in the equation. The input is in the form of a string. Equation consisted of addition operator only and 2 integers 3 min read
  • School Programming

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

  • Skip to primary navigation
  • Skip to main content
  • Skip to footer

logo

Eduinput- Online tutoring platform for Math, chemistry, Biology Physics

An online learning platform for Mcat, JEE, NEET and UPSC students

Problem Solving Techniques in Computer Science

types of problem solving in computer

Problem-solving is the process of identifying a problem and finding the best solution for it. Problem-solving is a technique that can be developed by following a well-organized approach. Every day we encounter many problems and solve them.

Every problem is different. Some problems are very difficult and are needed more attention to recognize the solution.

A problem may be solved by multiple methods. One solution may be faster, cheaper, and more reliable than others. It is important to choose a suitable worthy solution.

Different strategies, techniques, and tools are used to solve a problem. Computers are used as a tool to solve complex problems by developing computer programs.

Computer programs contain different instructions for computers. A programmer writes instructions and the computer executes these instructions to solve a problem. A person can be a good programmer if he has the skill of solving problems.

Table of Contents

Problem-Solving Techniques.

There are three different types of problem-solving techniques.

A set of instructions given to a computer to solve a problem is called a program.

A computer works according to the given instructions in the program. Computer programs are written in programming languages. A person who develops a program is called a programmer.

The programmer develops programs to instruct the computer on how to process data into information. The programmer uses programming languages or tools to write programs.

 Advantages of Computer Program

Different advantages of computer programs are as follows:

  • A computer program can solve many problems by giving instructions to the computer.
  • A computer program can be used to perform a task again and again and fastly.
  • A program can process a large amount of data easily.
  • It can display the results in different styles.
  • The processing of a program is more efficient and less time-consuming.
  • Different types of programs are used in different fields to perform certain tasks.

   Algorithms & Pseudo Code

An algorithm is a step-by-step procedure to solve a problem. The process of solving

problem becomes simpler and easier with help of algorithm. It is better to write an algorithm

before writing the actual computer program.

Properties of Algorithm

Following are some properties of an algorithm:

  • The given problem should be broken down into simple and meaningful steps.
  • The steps should be numbered sequentially.
  • The steps should be descriptive and written in simple English. 

Algorithms are written in a language that is similar to simple English called pseudocode. There is no standard to write pseudo code. It is used to specify program logic in an English-like manner that is independent of any particular programming language.

Pseudocode simplifies program development by separating it into two main parts.

Logic Design

In this part, the logic of the program is designed. We specify different steps required to solve the problem and the sequence of these steps.

In this part, the algorithm is converted into a program. The steps of the algorithm are

translated into instructions of any programming language.

The use of pseudo-code allows the programmer to focus on the planning of the program. After the planning is final, it can be written in any programming language.

The following algorithm inputs two numbers calculate the sum and then displays the result on the screen.

4. Total A+B

5. Display Total

The following algorithm inputs the radius from the user and calculates the area of a circle.

Hint: Area 3.14* radius* radius)

2. Input radius in r

3. area = 3.14* r* r

4. Print area

Advantages of Algorithm

There are many advantages of an algorithm

Reduce complexity

Writing algorithm and program separately simplifies the overall task by dividing it into two simpler tasks. While writing the algorithm, we can focus on solving the problem instead of concentrating on a particular language.

Increased Flexibility

An algorithm is written so that the code may be written in any language. Using an algorithm, the program could be written in Visual Basic, Java or C++, etc.

Ease of Understanding

It is not necessary to understand a particular programming language to understand an algorithm. It is written in an English-like manner.

A flowchart is a combination of two words flow and chart. A chart consists of different symbols to display information about any program. Flow indicates the direction processing that takes place in the program.

Flowchart is a graphical representation of an algorithm. It is a way of visually presenting the flow of data, operations performed on data, and the sequence of these operations.

Flowchart is similar to the layout plan of a building. A designer draws the layout plan of the building before constructing it. Similarly, a programmer prefers to design the flowchart before writing the computer program. Flowchart is designed according to the defined rule.

Uses of Logic Flowchart

Flowchart is used for the following reasons

  • Flowchart is used to represent an algorithm in a simple graphical manner.
  • Flowchart is used to show the steps of an algorithm easily.
  • Flowchart is used to understand the flow of the program.
  • Flowchart is used to improve the logic for solving a problem.
  • Programs can be reviewed and debugged easily.
  • Chapter-Getting Started with C

Related Articles

types of problem solving in computer

Scripting Languages-Different Types of Scripting Languages

types of problem solving in computer

Introduction to Flowchart | Difference between Flowchart and Algorithm

types of problem solving in computer

History of C Language – Advantages and Disadvantages of C Language

types of problem solving in computer

High-Level Programming Language-Popular High-level languages

Leave a reply cancel reply.

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

Save my name, email, and website in this browser for the next time I comment.

Get updates about new courses

NCERT solutions

footer-logo

9th Class 10th Class 11 Class 12 Class

Join the groups below to get updates.

Learning Materials

  • Business Studies
  • Combined Science
  • Computer Science
  • Engineering
  • English Literature
  • Environmental Science
  • Human Geography
  • Macroeconomics
  • Microeconomics
  • Problem Solving Techniques

Unlock the secrets of efficient coding, develop an in-depth understanding of different strategies, and learn how decision-making plays a significant role in using problem-solving techniques in Computer Science . This enlightening journey begins with an exploration into the definition of problem-solving techniques and their paramount importance in Computer Science. You further discover the basic problem-solving methods, their practical applications, and how these foundational skills apply directly to coding. 

Millions of flashcards designed to help you ace your studies

  • Cell Biology

What are problem-solving techniques in computer science?

Why are problem-solving techniques important in computer science?

What is the 'Divide and Conquer' problem-solving technique in computer science?

What is the purpose of the 'Heuristics' problem-solving technique?

What are some of the important functions of coding problem-solving techniques in computer science?

What are some examples of coding problem-solving techniques?

What is the Divide and Conquer problem-solving technique in computer science?

What are the uses of Randomised Algorithms within computer science?

What are the key roles of brainstorming in problem-solving techniques?

What are the steps to effectively apply brainstorming in problem-solving and decision-making techniques?

What are the key differences between problem-solving and decision-making techniques in computer science?

Achieve better grades quicker with Premium

Geld-zurück-Garantie, wenn du durch die Prüfung fällst

Review generated flashcards

to start learning or create your own AI flashcards

Start learning or create your own AI flashcards

Vaia

StudySmarter Editorial Team

Team Problem Solving Techniques Teachers

  • 20 minutes reading time
  • Checked by StudySmarter Editorial Team
  • Algorithms in Computer Science
  • Blockchain Technology
  • Computer Network
  • Computer Organisation and Architecture
  • Computer Programming
  • Computer Systems
  • Cybersecurity in Computer Science
  • Data Representation in Computer Science
  • Data Structures
  • Functional Programming
  • Game Design in Computer Science
  • Issues in Computer Science
  • Abstraction Computer Science
  • Agile Methodology
  • Agile Scrum
  • Breakpoints
  • Computational Thinking
  • Decomposition Computer Science
  • Integration Testing
  • Kanban Boards
  • Pattern Recognition
  • Software Development Life Cycle
  • Step Into Debugging
  • Step Over Debugging
  • System Testing
  • Unit Testing
  • Watch Variable
  • Waterfall Model
  • Theory of Computation

Jump to a key chapter

Going deeper, you explore seven pivotal problem-solving techniques, understanding their concepts and their indispensable uses in Computer Science . Finally, learn the nuances involved in contrasting problem-solving and decision-making techniques, the subtleties that set them apart, and ways in which they can be combined for the most effective results, in terms of both efficiency and creativity.

Understanding Problem-Solving Techniques

Problem-solving techniques in computer science are the protocols, procedures, or methods employed to identify the root cause of a problem and construct an efficient solution.

Definition of problem-solving techniques in Computer Science

Problem-solving techniques in computer science refer to the methods used to find solutions to complex issues using algorithmic or heuristic approaches. These techniques can be systematic, analytical, or intuitive, encompassing traditional programming, machine learning, or artificial intelligence methods.

These techniques are used in various domains within computer science, including data analysis, software development, network troubleshooting, and cybersecurity. For example, in software development, problem-solving may involve debugging an application. Here, the issue could be a broken functionality within the application, and the solution might be modifying a specific segment of code.

At a software development company, the team notices that their mobile application crashes whenever a user tries to upload a profile picture. By employing problem-solving techniques such as testing , the team identifies that the crash occurs due to a buffer overflow when processing large images. Once identified, they solve this problem by modifying the code to handle large image sizes better.

Importance of problem-solving techniques in Computer Science

Problem-solving techniques are the cornerstone of computer science. From designing efficient algorithms for a given task to optimising or guaranteeing certain performance metrics, these techniques are used daily. Here's why they're important:

  • Mitigating runtime errors and system crashes: By identifying and rectifying coding mistakes effectively.
  • Optimizing software: Problem-solving techniques can help improve the efficiency of software, leading to enhanced user experience and reduced resource consumption.
  • Data analysis: They help in organizing, evaluating, and interpreting complex datasets to derive meaningful insights.
  • Cybersecurity: By identifying potential vulnerabilities and patching them before they can be exploited, thereby safeguarding digital assets .

In the domain of machine learning, problem-solving techniques are even more paramount. Here, problems can include determining the best machine learning model for a specific task, tuning the hyperparameters of a model, or dealing with issues like data imbalance or overfitting. These techniques can guide computer scientists in their quest to develop robust, accurate machine-learning models that can make sense of vast, complex data.

Given the rapidly evolving nature of computer science, mastering various problem-solving techniques is essential to stay ahead in this field. It helps you adapt to new advancements and tackle a wide range of challenges that come your way.

Basic Problem-Solving Techniques

Before diving into advanced, specialized techniques for solving problems, it is essential to become proficient in the fundamentals, which transcend specific problem domains and provide a solid foundation for exploring more complex areas within computer science.

Introduction to basic problem-solving techniques

There are several standard problem-solving techniques that you can employ irrespective of the field of study in computer science. The first step, however, is always understanding the problem, then you can choose the right strategy to solve it. Here are some of the basic problem-solving methods that are particularly useful:

Divide and Conquer: This technique involves breaking a larger problem into smaller, more manageable parts, solving each of them individually, and finally combining their solutions to get the overall answer.

Consider an example in the context of sorting a list of numbers. Using a divide-and-conquer algorithm like Merge Sort , the list is continually split in half, until you reach lists of size one. These lists are inherently sorted, and then you recursively merge these sorted lists, resulting in a fully sorted list.

Algorithm Design: This technique involves formalizing a series of organized steps into an algorithm to solve a specific problem. Common approaches include greedy algorithms, dynamic programming, and brute force .

Heuristics: These are rules of thumb or educated guesses that can help you find an acceptable, if not the perfect, solution when the problem is too complex for a direct mathematical approach, or when computational resources are limited.

Heuristics are not guaranteed to yield the optimal solution but are often good enough for practical purposes and can dramatically reduce the time and resources needed to find a solution.

Recursive Thinking: Recursion is predicated on solving a problem by breaking it down into smaller instances of the same problem. The idea is that, eventually, you will get to a problem that is small enough to solve directly.

Even though these techniques might sound simple, they form a cornerstone and are often cloaked within complex problem-solving techniques used in higher-level computer science.

Practical application of basic problem-solving techniques

The practical application of basic problem-solving techniques in computer science is broad and varied, depending on the specific domain. However, some applications cut across most sectors of computer science:

Each technique has its strengths and weaknesses, and the key is knowing which technique (or combination of techniques) to use for a particular problem. Remember, the goal is not just to find any solution, but to find the most efficient one possible.

Other fields, too, benefit from these problem-solving techniques. For example, bioinformatics implements algorithm design to match genetic sequences, while digital forensics employs divide-and-conquer techniques to sift through large amounts of data during an investigation. Moreover, heuristics play a significant role in the burgeoning field of AI, proving that these problem-solving techniques not only provide a solid foundation for computer science but also have real-world applications.

Coding Problem-Solving Techniques

Delving into the more specific realm of coding within computer science, the arsenal of problem-solving techniques takes on facets best suited for resolving issues related to programming and development.

Importance of coding problem-solving techniques in Computer Science

Coding problem-solving techniques are the tools that software developers use to create, optimise, and manage software applications effectively. These techniques play an instrumental role in many aspects:

  • Enhancing code efficiency: Efficient code is faster to execute, consumes less memory, and results in responsive, user-friendly applications. For instance, choosing an optimal sorting algorithm based on the size of the list can markedly improve runtime.
  • Mitigating errors: Through structured debugging and systematic thinking, developers can track and rectify logic errors, syntax errors , or runtime exceptions, leading to robust, error-free code.
  • Facilitating code readability and maintenance: Good coding practices, such as following a consistent naming scheme and using descriptive comments, make code easier to understand, troubleshoot, and maintain – essential when working in a team.
  • Implementing complex functionalities: Many modern applications require intricate algorithms, use elaborate data structures , and handle large volumes of data. Mastery of coding problem-solving techniques enables developers to tackle these challenges effectively.

Examples of coding problem-solving techniques

There's a myriad of coding problem-solving techniques at a developer's disposal. These methods typically supplement basic problem-solving techniques with practices tailored for the coding environment. Let's delve into a few:

Debugging: Debugging is the process of identifying and rectifying coding errors. It often involves using built-in tools or software debuggers to step through the code line-by-line, track variable values, and uncover where things go awry. A systematic debugging approach is essential for problem-solving in coding.

Suppose you are developing a JavaScript web application, and some functionality isn't working as expected. By using the browser's debugging tools, you can step through your JavaScript code, watch the values assigned to variables, and identify the line creating the issue.

Code Refactoring: Refactoring implies rearranging and improving the structure of existing code without changing its functionality. Refactoring techniques, such as extracting repeated code into functions or simplifying conditional expressions, are integral problem-solving tools aimed at improving code readability and efficiency.

Using Data Structures & Algorithms: Effective use of data structures ( Arrays , LinkedList, Stack, Queue, Tree, Hashtable, etc.) and algorithms (Sorting, Searching, etc.) is fundamental in coding problem-solving. The correct choice and application of such tools can have a dramatic impact on a program’s performance.

Version Control : While writing code, you often need to try out different solutions or collaborate with other team members. Using version control systems , like Git, helps manage changes, track history, and merge code from different branches. This aids in solving and managing complex coding problems.

Apart from these fundamental techniques, advanced paradigms, such as Test-Driven Development (TDD), Behaviour Driven Development (BDD), etc., also exist. In TDD, the developer writes tests for a function before writing the actual function. In BDD, the behaviour of an application from the end user's perspective is the guiding force behind development. These paradigms incorporate problem-solving in their methodologies and guide the development process to create effective, robust applications.

Indeed, coding problem-solving techniques enrich a developer's toolkit and provide avenues to tackle the myriad of challenges that arise in programming. Whether it's minimising bugs, improving code efficiency, or implementing complex functionalities, these techniques are indispensable in daily coding endeavours.

In-depth study of 7 Problem-Solving Techniques

Problem-solving takes centre stage in the realm of computer science, where challenges need methodical approaches for efficient resolution. Let's delve into an in-depth exploration of seven such techniques, with each offering a unique perspective on how to tackle and solve issues effectively.

Conceptual understanding of the 7 problem-solving techniques

Within the realm of computer science, efficient problem-solving techniques can be the key to unlocking streamlined workflows, effective data handling, and improved coding management. These problem-solving methods include:

  • Divide and Conquer: This technique splits larger problems into smaller, more manageable sub-problems, solves the sub-problems individually and combines the solutions to get a complete resolution. This technique is pertinent to a wide range of algorithms in computer science , including sorting and searching algorithms.
  • Greedy Algorithms: Greedy algorithms solve problems by making the best choice at each step, with the hope that these local optimal solutions will lead to a globally optimal solution. They are often used in scenarios where the optimal solution has a 'greedy property', such as in the famous 'travelling salesman' problem.
  • Backtracking : This technique incrementally builds candidates for the solutions and abandons a candidate as soon as it determines that this candidate cannot possibly be extended to a valid solution.
  • Dynamic Programming: This method solves complex problems by breaking them down into simpler sub-problems, but unlike divide and conquer, these sub-problems are not solved independently. Instead, the results of sub-problems are stored and utilised to build up solutions to larger problems.
  • Brute Force : This straightforward approach tries every possible solution until it finds the best one. The simplicity of this method often makes it a practical and easy-to-implement fallback plan, although it may not be the most efficient.
  • Randomised Algorithms: For certain problems, deterministic algorithms may be too slow or complex, and the solution space too large to navigate exhaustively. In such cases, randomised algorithms offer an option where random choices drive the solution process. These algorithms have proven extremely efficient in problems like QuickSort and the Monte Carlo method.
  • Heuristic Methods: Heuristics are problem-solving approaches that are not always guaranteed to provide the perfect solution but will produce a good solution in a reasonable time. Various AI and machine learning techniques, such as genetic algorithms or neural networks, heavily use heuristic methods.

A Greedy Algorithm is one where, at each step, the choice that looks the best at that moment is selected with the belief that this choice will lead to an optimal global solution.

Understanding the foundations of these techniques provides a comprehensive toolset to approach a wide array of problems in computer science. It's important to remember that a technique's effectiveness largely depends on the nature of the problem.

Uses of the 7 problem-solving techniques in Computer Science

Each problem-solving method can be coupled with different facets within computer science. For example, encryption techniques, compression algorithms, network routing strategies, and database searches all rely on precise problem-solving methodologies. Here are just a few of the potential uses for each method:

The flexibility and variety of these problem-solving techniques enable a far-reaching applicability across the vast landscape of computer science. By understanding and mastering these techniques, you can tackle a wide array of complex problems more efficiently.

Brainstorming Problem-Solving Techniques

In the context of problem-solving techniques, brainstorming is an invaluable tool. Brainstorming offers a creative, open-ended approach well-suited for troubleshooting challenges, stimulating new ideas, and tackling issues from fresh angles.

Role of brainstorming in problem-solving techniques

Brainstorming's emphasis on exploratory thinking and collaborative problem-solving makes it an excellent tool in computer science. This interactive technique encourages you to think outside the box, ushering a wealth of ideas and potential problem-solving approaches. Here's why brainstorming plays a pivotal role in problem-solving techniques:

  • Encourages Creative Thinking: Brainstorming breaks down the barriers of conventional thought, promoting imaginative solutions that may not be immediately evident. This out-of-the-box thinking can generate unique problem-solving methods for complex computer science problems.
  • Fosters Collaboration: Brainstorming is fundamentally a collective effort. By combining the expertise and viewpoints of multiple individuals, it can foster innovative problem-solving approaches that would not surface in isolated thinking.
  • Aids in Problem Understanding: In the process of brainstorming, not only are solutions discussed, but the problem itself is dissected from different angles. This aids in gaining a deeper understanding of the problem, essential to uncover the most effective solutions.

Consider a team of developers brainstorming to develop a feature for a software application. One developer might suggest a direct approach that, although simple, may not be the most efficient. Another team member could propose a more complex, but efficient, algorithm for the feature. A third might contribute an innovative approach that balances both performance and simplicity.

Through this collective brainstorming, the team converges on the most well-rounded approach, emphasising the critical role that brainstorming plays in problem-solving methodologies.

Applying brainstorming in problem-solving techniques

Brainstorming is not just about generating as many ideas as possible; it's also about creating an organized framework for synthesizing and evaluating those ideas.

For effective brainstorming in problem-solving and decision-making techniques, you can follow the steps below:

  • Define the Problem: Clearly understand and define the problem that needs solving. The more accurately the problem is described, the more targeted the brainstorming will be.
  • Set Guidelines: Establish rules for the brainstorming session to keep it focused and productive. These might include encouraging free thinking, postponing judgment, welcoming wild ideas, building on other ideas, and setting a time limit.
  • Idea Generation: Begin brainstorming, inviting everyone involved to share their ideas. The key is to promote creativity and diversity of thought. No idea is too outlandish; often, the most unconventional suggestions lead to the most innovative solutions.
  • Categorise and Consolidate: Once all the ideas are documented, start to group related ideas together and consolidate overlapping ideas.
  • Analyse and Evaluate: It's time to analyse each idea based on its feasibility, potential impact, and resource requirement. Ideas that might not appear effective initially can be valuable when combined with other ideas.
  • Select and Implement: After thorough analysis and discussion, decide on the best solution(s) to implement, based on the resources and time available, instantly making the brainstorming session instrumental in decision making as well.

Remember: Brainstorming is not just a one-time activity. It can and should be done iteratively. Often, implementation of an idea will bring forward new challenges, requiring another round of brainstorming. The strength of brainstorming lies in its fluid nature, allowing it to adapt and iterate until the problem at hand is fully resolved.

All in all, brainstorming is a powerful problem-solving and decision-making technique in computer science. By cultivating creativity, encouraging collaboration, and fostering a deeper understanding of problems, it holds the potential to tackle complex issues effectively.

Problem Solving and Decision Making Techniques

In computer science, problem-solving and decision-making form the core techniques widely employed in managing software development, debugging, data analysis, network operations, and more. Incorporating these methodologies in a concerted, structured manner can significantly enhance the outcomes in various fields of technology.

Difference between problem-solving and decision-making techniques

While it might appear that problem-solving and decision-making are interchangeable terms, they signify distinct aspects of addressing challenges in computer science.

  • Problem-solving: Within a computer science context, problem-solving involves identifying an issue within a system, application, or theory and resolving it effectively. This process often includes defining the problem, identifying root causes, generating alternative solutions, selecting a solution, and implementing it. Problem-solving often utilises techniques like debugging, algorithmic design, divide and conquer, dynamic programming, recursive thinking, heuristic methods, and more.
  • Decision-making: Decision-making, on the other hand, is a process of choosing between different alternatives. It often follows problem-solving whereby, after identifying potential solutions to a problem, the best option needs to be chosen. Decision-making techniques might include tools like decision matrices, cost-benefit analyses, or simple pros-and-cons lists. In computer science, decision-making can involve choosing the right data structure, deciding which algorithm to use, or selecting a coding methodology.

For instance, problem-solving might involve identifying a bottleneck in a software's performance and brainstorming different ways to enhance the efficiency. However, decision-making comes into play when you need to choose one of the generated solutions based on various factors like resource availability, time constraints, the impact of the solution, etc. Thus, while both techniques cater to overcoming challenges, problem-solving is more focused on creating solutions, whereas decision-making prioritises choosing the most optimal one from these solutions.

Combining problem-solving and decision-making for effective results

Effective results in computer science often stem from an amalgamation of both problem-solving and decision-making techniques. Combining these approaches ensures a comprehensive solution to challenges, complete with a thorough understanding of the problem, an array of possible solutions, and a well-thought-out decision on implementing the best solution.

Consider a situation where a computer system is repeatedly encountering a fatal error. Here's how problem-solving and decision-making techniques can be combined for effective results:

  • Identification: Firstly, identify the issue affecting the system. This could be established through system monitoring tools or error logs. Once the problem is identified, it sets the base for problem-solving.
  • Problem-Solving: Now, brainstorm for possible solutions to rectify the error. This could involve debugging the system or reviewing the code to find potential bugs. Perhaps the issue might be a memory leak that needs addressing or a race condition in multi-threaded operations. These solutions emanate from problem-solving techniques.
  • Decision-Making: Once a list of possible solutions is generated, use decision-making techniques to select the best course of action. You could create a pros-and-cons list for each solution or use a more formal decision matrix to evaluate effectiveness, resources required, impact on system performance, etc. Finally, implement the solution.
  • Review: After implementation, monitor the system to ensure the solution is working as intended. If the problem persists, the process returns to the problem-solving stage to revisit the issue and generate new solutions.

It's important to keep in mind that real-word scenarios seldom follow a tidy linear sequence. More commonly, problem-solving and decision-making are iterative, cyclical processes that overlap and interrelate. It's a dynamic environment where a bottleneck can stimulate new decision-making criteria, or an unforeseen decisional deadlock might call for fresh problem-solving ideas.

Combining problem-solving with decision-making offers a structured, strategic approach to tackle challenges commonly found in computer science. This conjunction of techniques provides a robust, versatile methodology to drive effective results across the diverse landscape of technology.

Problem Solving Techniques - Key takeaways

  • Problem-solving techniques in Computer Science are techniques which typically use algorithmic or heuristic approaches to resolve complex issues.
  • Problem-solving techniques can be systematic, analytical, or intuitive, and involve traditional programming, machine learning, or artificial intelligence methods. Applied in domains such as data analysis, software development, network troubleshooting, and cybersecurity.
  • Basic problem-solving techniques comprises of methods like divide and conquer, algorithm design, heuristics, and recursive thinking, all aimed at understanding and tackling problems.
  • Practical applications of basic problem-solving techniques include applications spanning across various sectors of computer science, including sorting and searching algorithms, routing protocols for networks, AI game playing, and parsing syntax trees in compilers.
  • Examples of coding problem-solving techniques include Debugging which is essential in identifying and rectifying coding errors, Code Refactoring to improve the structure of existing code without changing its functionality, Using Data Structures & Algorithms to have a dramatic impact on a program’s performance, and Version Control System like Git for managing changes, tracking history and merging code from different branches.

Flashcards in Problem Solving Techniques 404

Problem-solving techniques in computer science refer to the methods used to find solutions to complex issues using algorithmic or heuristic approaches, which can be systematic, analytical, or intuitive. They encompass traditional programming, machine learning, or artificial intelligence methods.

Problem-solving techniques in computer science are important for mitigating runtime errors and system crashes, optimizing software, organizing, evaluating, and interpreting complex datasets, and identifying potential cybersecurity vulnerabilities and patching them.

The 'Divide and Conquer' technique involves breaking a larger problem into smaller, more manageable parts, solving each individually, and combining their solutions to get the overall answer. This is often used in sorting algorithms like Merge Sort.

'Heuristics' are educated guesses that can help find an acceptable solution when the problem is too complex for a direct mathematical approach, or when computational resources are limited. They are often used in AI and language translations.

Coding problem-solving techniques aid in enhancing code efficiency, mitigating errors, facilitating code readability and maintenance, and implementing complex functionalities.

Examples include debugging, code refactoring, using appropriate data structures and algorithms, and implementing version control.

Learn faster with the 404 flashcards about Problem Solving Techniques

Sign up for free to gain access to all our flashcards.

Problem Solving Techniques

Already have an account? Log in

Frequently Asked Questions about Problem Solving Techniques

What are some problem-solving techniques?

Some common problem solving techniques include brainstorming, the five whys technique, root cause analysis, lateral thinking, striving for simplicity, the 6 thinking hats and using flow charts or diagrams. Additionally, techniques such as SWOT analysis, Trial and Error, and Decision Trees can also be effective tools in problem-solving. Each technique is employed based on the nature and context of the problem to be solved. It's crucial to understand the problem fully before choosing a technique to apply.

What are the four problem-solving techniques?

The four problem solving techniques are: 

1) Defining the problem clearly to understand its nature and scope

2) Generating a range of potential solutions through brainstorming or creative thinking 

3) Evaluating and selecting the most feasible solutions by analysing their pros and cons

4) Implementing the chosen solution and monitoring its effectiveness.

How to apply problem-solving techniques?

To apply problem solving techniques, you first need to clearly identify and define the problem. Next, gather as much information as you can related to the problem. Once you have all the details, generate a range of potential solutions and evaluate each for its merits and downsides. Finally, implement the best solution and review its effectiveness, making adjustments as necessary.

What are the different problem solving techniques?

Different problem solving techniques include brainstorming, lateral thinking, root cause analysis, the five whys technique, mind mapping, SWOT analysis, "divide and conquer" technique and use of algorithms or heuristics. Additionally, the use of decision trees, fishbone diagrams, and PEST & STEEPLE analysis are also widely used in strategic problem solving. All these techniques help in breaking down complex problems into manageable parts and finding effective solutions. The choice of technique may vary depending on the nature and complexity of the problem.

How to choose problem-solving techniques?

Choosing problem-solving techniques involves understanding the nature and scope of the problem, identifying all potential methods for resolution, and then carefully evaluating each one in terms of its appropriateness, feasibility, and probable effectiveness, selecting the most promising one. Take into consideration multidisciplinary insights, and factor in resources available, time constraints, and potential risks. It can also be useful to bring in outside perspectives or utilise brainstorming techniques. The chosen method should ideally be both effective and efficient in resolving the problem at hand.

Test your knowledge with multiple choice flashcards

What is the 'Divide and Conquer' problem-solving technique in computer science?

That was a fantastic start!

You can do better, sign up to create your own flashcards.

Access over 700 million learning materials

Study more efficiently with flashcards

Get better grades with AI

Already have an account? Log in  

Keep learning, you are doing great.

Discover learning materials with the free StudySmarter app

1

About StudySmarter

StudySmarter is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.

Team Computer Science Teachers

Study anywhere. Anytime.Across all devices.

Create a free account to save this explanation..

Save explanations to your personalised space and access them anytime, anywhere!

By signing up, you agree to the Terms and Conditions and the Privacy Policy of StudySmarter.

Sign up to highlight and take notes. It’s 100% free.

Join over 22 million students in learning with our StudySmarter App

The first learning app that truly has everything you need to ace your exams in one place

  • Flashcards & Quizzes
  • AI Study Assistant
  • Study Planner
  • Smart Note-Taking

Join over 22 million students in learning with our StudySmarter App

  • 3. Functions
  • 5. First C Program
  • 6. CS1010 I/O Library
  • 7. Arithmetic Operations
  • 9. Logical Expression
  • 10. Assertion
  • 12. Reasoning About Loops
  • 13. Call Stack
  • 14. Pointers
  • 16. Strings
  • 17. Call by Reference
  • 19. Multidimensional Array
  • 20. C Pre-processing
  • 22. Efficiency
  • 23. Binary Search
  • 24. Sorting
  • 25. Tower of Hanoi
  • 26. Permutation
  • 27. N Queens
  • 28. Structure
  • C in CS1010
  • Style Guide
  • Documentation Guide

Unit 2: Computational Problems and Algorithms

Learning outcomes:.

After this unit, students should:

  • understand the basic terminologies: computational problem solving, algorithm, flowchart, debugging, testing, variables, value, assignment
  • be familiar with the algorithm to find the maximum among a list of numbers
  • be able to trace through flowcharts and updates of variables, and argue if a given algorithm is correct or incorrect

Computational Problems

So, what is computational problem solving? Let's start with the question, what is a computational problem ?

A computational problem is a problem that can be solved step-by-step with a computer. These problems usually have a well-defined input, constraints, and conditions that the output must satisfied. Here are some types of computational problems:

A decision problem is one where the answer is yes or no. For instance, "given a number n , is n even?" is a decision problem. Some decision problems take more steps to solve than others. For instance, "given a number n , is n prime?" takes more steps than just checking the parity of a number.

A search problem is one where the solution consists of one or more values that satisfies a given condition. For instance, we may want to compute a path from one geographical location to another on a map.

A counting problem is one where the answer is the number of solutions to a search problem.

An optimization problem is one where the solution is the "best" possible solution, where the "best" can be defined in a different way. For instance, we may want to compute the fastest route from one location to another.

Questions such as "what is the meaning of life?" "do I look good in this outfit?" 1 are not computational problems, because they do not have well-defined input, constraints, and conditions that the output must satisfy.

In CS1010 (followed by CS2040C and CS3230), you will learn how to solve computational problems computationally -- this means that you learn to come up with step-by-step instructions meant for computers that you can translate into computer programs, to solve a given problem.

Example: Finding the maximum

First, let's consider if this is a computational problem. The input is very well defined. We know what an integer is. We are told we have at least one, and we have a finite number of them 2 .

Second, let's consider the output. What conditions must the output satisfy? First, it has to be equal or larger than every other integer on the list. Second, it must be an integer in the list. This is well defined by the problem statement, so we can say that it is a computational problem.

Here is an example. Suppose the input consists of:

4 1 -4 0 9 9 3 5 8

The output should be 9 .

Now, you should pause reading and think about how you would solve this step-by-step.

One way to solve this problem is to check through the integers in the list, one-by-one, and keep track of the maximum value so far. When you reach the end of the list, your "maximum value so far" will also be the maximum for the whole list.

Let's look at an example:

The English description above, however, is not detailed enough for computers to understand. What is the meaning of "check one-by-one"? "keep track of maximum so far"? how to tell if we have reached "the end of the list"?

Let's work out all the details.

Now, we have enough details to describe step-by-step, how to find the maximum value from a list of integers. Such steps, which the computer can take to solve a problem, is called an algorithm .

There are different ways one can describe an algorithm. The easiest way I find is to use a diagram called a flowchart . The flowchart for the algorithm above looks like this. A diamond box represents a "question" that can be true or false (yes or no), and we trace through the "flow" step by step, following the corresponding path depending on the answer.

Flowchart

We can perform two very basic operations on the variables: reading and writing. In other words, we can set their values and we can retrieve their values.

For an algorithm to correctly solve the given problem, it has to produce the correct result for all valid inputs to the problem. If we can find one counterexample, one input where the algorithm does not produce the correct output, then the algorithm is incorrect. Note that I say does not produce the correct output , which means that either the algorithm produces the wrong output or does not produce any output at all .

In this case, we say that the algorithm or the program has a bug . A bug is a defect that causes the algorithm to behave incorrectly. As a software developer, you will spend some time finding bugs in your code, a process known as debugging . A debugger is a tool that helps programmers find bugs in their code.

Before we even start the process of debugging, we first have to know if our algorithm is correct. Remember that an algorithm is correct only if it produces the correct output only all possible valid inputs. So, one way to check if an algorithm is correct is to try it with all possible valid inputs. For the problem we are solving above, however, even though the list is finite, there are infinitely many possible inputs, and so, it is impossible to try all possible valid inputs. In practice, we craft a smaller set of test inputs to check if the algorithm behaves correctly for these test inputs, and hope that it is correct for all possible inputs. With experience, you will choose the right set of test inputs to maximize that chances that you will find a bug in your code. There are also systematic ways of deriving test cases so that the test cases cover different paths of execution of the algorithm, but we won't be covering it in CS1010 3 .

Another way of checking if an algorithm is correct, is to reason about the behavior of the algorithm. We will do this rather informally in CS1010, starting in 1-2 lectures from now. You get to rigorously prove that an algorithm is correct in a higher level module (CS3230 Design and Analysis of Algorithms).

Finally, even if an algorithm is correct, the corresponding program might not be. Recall that an algorithm is a step-by-step process to solve a problem. It is what you want your program to do. You still have to write a program (in C, or other languages) to actually have the computer do what you want it to do (in other words, to implement the algorithm ). This process of translating the algorithm to a computer program, called coding may introduce bugs as well. But we will worry about this later when we learn to program.

In the problem set at the end of this lecture, you will see slight variations of the algorithm above. You should check through them to see whether they are correct or not.

Problem Set

Problem 1.1.

If an algorithm is buggy, give a counter-example where the output is incorrect. In addition, give an example input where the algorithm still produces the correct output, where possible.

Flowchart

Problem 1.2

Problem 1.3.

The answer is, by the way, always "Yes."  ↩

Think about why it is important to have a finite number of integers in the input.  ↩

Software testing is a body of knowledge worthy of an advanced module by itself -- we offer one in CS4218.  ↩

IMAGES

  1. computer problem solving flowchart

    types of problem solving in computer

  2. 6 Ways to Improve Your Programming Problem Solving

    types of problem solving in computer

  3. 5 Problem Solving Strategies to Become a Better Problem Solver

    types of problem solving in computer

  4. Problem-Solving Strategies: Definition and 5 Techniques to Try

    types of problem solving in computer

  5. 4 Types of Problems and problem solving strategies

    types of problem solving in computer

  6. Top 15 computer problems with solution

    types of problem solving in computer

COMMENTS

  1. Problem Solving Using Computer (Steps) - Codesansar

    Problem Solving Using Computer (Steps) Computer based problem solving is a systematic process of designing, implementing and using programming tools during the problem solving stage. This method enables the computer system to be more intuitive with human logic than machine logic. Final outcome of this process is software tools which is ...

  2. Most important type of Algorithms - GeeksforGeeks

    Nov 2, 2023 · Different types of problems require different types of algorithmic techniques to be solved in the most optimized manner. There are many types of algorithms but the most important and fundamental algorithms that you must are discussed in this article. 1. Brute Force Algorithm: This is the most basic and simplest type of algorithm.

  3. CBSE Class 11 | Problem Solving Methodologies - GeeksforGeeks

    Feb 23, 2022 · Problem Solving Process. The process of problem-solving is an activity which has its ingredients as the specification of the program and the served dish is a correct program. This activity comprises of four steps : 1. Understanding the problem: To solve any problem it is very crucial to understand the problem first. What is the desired output ...

  4. Problem Solving Techniques in Computer Science - Eduinput

    Jul 21, 2022 · Problem-Solving Techniques. There are three different types of problem-solving techniques. Program ; Algorithm; Flowchart; Program. A set of instructions given to a computer to solve a problem is called a program. A computer works according to the given instructions in the program. Computer programs are written in programming languages.

  5. Problem Solving Basics and Computer Programming - IIT

    Solving Problems with Solutions Requiring Sequential Processing Overview Computer programming is not just programming language syntax and using a development environment. At its core, computer programming is solving problems. We will now turn our attention to a structured methodology you can use to construct solutions for a given problem.

  6. Introduction to Problem Solving - NCERT

    to apply problem solving techniques. Problem solving begins with the precise identification of the problem and ends with a complete working solution in terms of a program or software. Key steps required for solving a problem using a computer are shown in Figure 4.1 and are discussed in following subsections. 4.2.1 Analysing the problem

  7. Unit 2: Problem Solving - Exploring Computer Science

    1-2 Introduce data collection and problem solving. 3 Introduce the four steps of the problem solving process. 4-6 Apply the problem solving process. Use different strategies to plan and carry out the plan to solve several problems. 7-9 Reinforce the four steps of the problems solving process. 10-12 Count in the binary number system.

  8. Problem Solving Techniques: Decision Making & Brainstorming

    While it might appear that problem-solving and decision-making are interchangeable terms, they signify distinct aspects of addressing challenges in computer science. Problem-solving: Within a computer science context, problem-solving involves identifying an issue within a system, application, or theory and resolving it effectively. This process ...

  9. Computer Programming Problem Solving Process - Germanna

    How to begin the problem-solving process . Programmers must solve many different types of problems. One problem that students often encounter in programming classes is how to find the lowest or highest value in a list of numbers. Review the following example, and note the steps a programmer could take to solve the problem. Example problem: Find ...

  10. 2. Computational Problem & Algorithms - CS1010 Programming ...

    A computational problem is a problem that can be solved step-by-step with a computer. These problems usually have a well-defined input, constraints, and conditions that the output must satisfied. Here are some types of computational problems: A decision problem is one where the answer is yes or no.