0% found this document useful (0 votes)
50 views

Introduction To Algorithm

This document introduces algorithms and data structures. It defines an algorithm as a step-by-step method for solving a problem and a data structure as a specialized format for organizing and storing data. It discusses properties of algorithms like input, output, correctness, finiteness, and effectiveness. It also describes different ways of writing algorithms like flow charts and pseudo-code. Finally, it discusses different ways of searching organized data in a database like linear search, binary search, and greedy search.

Uploaded by

kyle fate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Introduction To Algorithm

This document introduces algorithms and data structures. It defines an algorithm as a step-by-step method for solving a problem and a data structure as a specialized format for organizing and storing data. It discusses properties of algorithms like input, output, correctness, finiteness, and effectiveness. It also describes different ways of writing algorithms like flow charts and pseudo-code. Finally, it discusses different ways of searching organized data in a database like linear search, binary search, and greedy search.

Uploaded by

kyle fate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Introduction to Algorithm

Algorithm
Step by step method of solving problems

Procedure

Detailed series of instructions for carrying out an operation or solving a problem

We can also use algorithms in everyday tasks (ex. recipe)

Can be written in any matter unless they provide a solution of a problem

Data Structure
Specialized format for organizing and storing data

Used in computing to make it easy to locate and retrieve information

Can also be used to group and organize other data

Properties of Algorithms
Input

Input values from a specified set

Usually from us developer or user

Output

From the values the algorithms produces the output values from a specified set

Solution

Correctness

The algorithm should produce correct output values for each set of inputs

Finiteness

Introduction to Algorithm 1
The algorithm should produce the output after a finite number of stems for any
input

Effectiveness

MUST be possible to perform each step of the algorithm correctly and in a finite
amount of time

Generality

The algorithm should work for all problems of the desired form

Ways of Writing Algorithm


Flow chart

Pseudo-code

Different Ways on How to Search the Organized Data in


Database
Linear Search

Prose Description: Locate an item in a list by examining the sequence of list


elements one at a time, starting at the beginning

Iterate across the array from left to right, searching for specified element

One by one testing

Binary Search

The input is a list of items in increasing order

It begins by comparing the target with the middle element

If found the position is returned, otherwise 0 when not found

Greedy Search

Optimization problems minimize or maximize some parameter over all possible


inputs

Optimization problems can often be solved by this

Introduction to Algorithm 2
Examples

Finding a route between two cities with the smallest total mileage

Determining how to encode messages using the fewest possible bits

Finding fiber links between network nodes using the least amount of fiber

Bubble Sort

Introduction to Algorithm 3

You might also like