Gazzie. An obsessed music freak. 18 years of age.^_^. Long brown/black hair. Easily entertained. Skinny. Loud. Acclaimed Prince Gaz by Arwen! Member of the Unfortunate Family Tree and Secret Keeper of it as well. Lives in America, unfortunately. Owner of an iPod Touch. Is glomped everday! Born into this [world] on 12/19/1989 as it seems it be, Sagittarius. Member of [Slytherin].
   

<< September 2009 >>
Sun Mon Tue Wed Thu Fri Sat
 01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30


If you want to be updated on this weblog Enter your email here:



rss feed



 
Monday, September 28, 2009
Computer Science Notes v.8
Chapter 6 Problem solving and Algorithm Design

Problem solving
-the act of finding a solution to a perplexing, distressing, vexing, or unsettled question.

How do you solve problems?
1) Understand the problem
2) devise a plan
...

Ask questions!
What do I know about the problem?
What is the information that I have to process in order to find..

Ask question! Never reinvent the wheel!
Similar problems come up again and again in different guises.

A good programmer recognizes a task or subtask that has been solved before and plugs in the solution.

Divide and Conquer!

Break up a large problem into smaller units and solve each smaller problem.
-Applies the concept of abstraction
-The divide-and-conquer approach can be applied over and over again until each subtask is manageable.

Algorithm
-A set of unambiguous instructions for solving a problem or subproblem in a finite amount of time using a finite amount of data.

Computer-Problem Solving
Analysis and Specification Phase
-Analyze
-Specification

Algorithm Decvelopment Phase
-Develop algorithm
-Test algorithm

Implementation Phase
-Code algorithm
-Test algorithm

Maintenance Phase
-Use
-Maintain

Pseudocode
-A mixture of English and formatting to make the steps in an algorithm explicit.
-Algorithm to Convert base -10 number to other bases.
[White the (the quotient is not zero).
Divide the decimal number by the new base...]

Two methodologies used to develop computer solutions to a problem
-Top-down design focuses on the tasks to be done
-Object-orientated design focuses on the data involved

Psuedocode
A way of expressing algorithms that uses a mixture of English phrases and indention to make the steps in the solution explicit.

Variables
-Names of places to store values

Assignment
-Storing the value of an expression into a variable

Output
-Printing a value on an output device

Input
-Getting values from the outside...

Repetition
-Repeating a series of statements.

Selection
-Making a choice to execute or skip a statement (or group of statements)


Posted at 09:54 am by lemony

 

Leave a Comment:

Name


Homepage (optional)


Comments




Previous Entry Home Next Entry