Problem Solving Flashcards
What is Problem Solving?
Problem solving is the process of finding a solution for a problem
What are the steps in problem solving?
Define the problem
Propose and evaluate solution
Determine the most efficient solution
Test and validate the solution
What is an Algorithm?
An algorithm is a set of detailed, unambiguous and ordered instructions developed to describe the processes necessary to produce the desired output from a given input
What is the Divide and Conquer Approach?
Divide the given problem into subproblems
Conquer the subproblem by solving them recursively
Combine the solutions for the subproblems to a solution for the original problem
An algorithm must have?
Finite number of steps
Precise
Unambiguous
Flow of control
Terminate
Algorithms are usually represented using?
Narrative
Pseudocode
Flow chart
What is a Constant?
A constant is an identifier’s value that cannot be change during the execution of a program.
What are some Data Types?
Integers - stores whole numbers
Floating Point/Real - store real or fractional numbers
Characters- a single letter or punctuation
String - a word, phrase or sentence enclosed by double quotes
Boolean - Can only contain one of two values i.e true or false
Rules of Variables?
The name of the variable should reveal what it does
It should only contain letters numbers and underscores
It should begin with a letter
It must have no spaces