Introduction to Algorithm and Data Structures

 Difference Between Data, Information and Knowledge


Data: 

    We always use word data. Data is collection of symbol,mnemonics, digit, elementary description of things, events, activities and transactions that are recorded, classified and stored but are not organized to convey any specific meaning.

Information:

    When we perform some operations or process on data Data it converts into information. Information have meaning and value to the recipient.

Knowledge:

    Data and/or information organized and processed to convey understanding, experience, accumulated learning and expertise as they apply to a current problem or activity.


Problem Solving:

To solve a given problem by using a computer, we need to write a program for it .

A program consists of two components as follows:
                        

Algorithm:

It can be defined as a step by step procedure for solving a particular problem

Characteristic of Algorithm:

1. Unambiguous : Algorithm should be clear. Each of its steps and their input output should be clear and must lead to only one meaning.

2. Input : An algorithm should have 0 or more well defined input

3. Output: An algorithm should have 1 or more well defined output. 
 
4. Finiteness : Algorithm must terminate after finite no. of steps

5. Feasibility : Should be feasible with available resources.

6. Independent: An algorithm should have step by step directions, which should be independent of any programming code  


 Algorithm Design Tools:


1. Pseudo Code: 
  • Consists of natural language like statements that enables the programmer to plan without worrying about syntax.
  • Statements describe actions
  • Focuses on logic of the algorithm/ program
  • It neither an algorithm nor a program
Example: Program for Addition of two nos.
                  
                    Add()
                    {
                    a=input number
                    b=input number
                    c=addition of a+b
                    print(c)
                    }

2. Flowchart:  
  • A flowchart is a graphical or symbolical representation of an algorithm
  • It is a diagram that describes a process or operation
There are large number of symbols used for drawing flowchart. Some of them are as follows:

1. Oval: This shape is also called as 'Terminator Symbol'. 
                                
Terminator


This oval shape symbol represents the start or end of process. We always write 'start', 'end' ,'begin' or 'stop' inside it.

2. Rectangle:  This is also referred as 'action symbol'.


This rectangle shape symbol represents 'action', 'operation', 'function' or 'process'. This is most widely used symbol for drawing flowchart.

3. Parallelogram: This is also referred as 'data symbol'.

This symbol represents input and output (Information entering and leaving) of the system.

4. Diamond: This symbol represents 'Decision'. It is used in a process flow to ask a question and the answer is terms of arrows coming out diamond. It takes decision as 'yes/no' or 'true/false'.


5. Circle: This symbol connects separate elements across one page. It represents continuous flow with matching symbol.

6. Arrow:  This represents 'connection' and 'relationship' from one symbol to another using arrow. 

Example:
                 Find out whether number is even or odd 
Flowchart:
        



No comments

File Uploading in PHP

  File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...