Linear and Binary Search Algorithms.(Discrete Mathematics)

Post on 21-Jan-2018

65 views 1 download

transcript

Project Presentaion.

Linear and Binary Search Algorithms.

Shanawaz Ahamed 2016-1-60-103.

.

Mahfuza Rahman Mim 2016-2-60-001

Md Tahsif Ahmed 2016-2-60-117.

Outlines:

Concept of Algorithm.

The Linear search Algorithm.

The Binary search Algorithm.

Code (Flowchart).

Results.

Graph(Using MatLab).

Conclusions.

AlgorithmSearching Algorithm

1)The Linear search Algorithm.

2) The Binary search Algorithm.

.

List of Random Integers

Randomly chosen an integer number.

Used Linear search Algorithm to find This

Number.

Used Binary search Algorithm to find This

Number.

Measured The Execution Time.

Measured The Execution Time.

Work Way.

Code:

1)C++

2) Object Oriented.

3) Used Array.

4) rand(), function.

5)Clock(), function.

6)Linear Search Algorithm.

7) Binary Search Algorithm

Output:integer 5 as Input.

Matlab:

1) Selected integers as independent Variables (x).

2) Time during linear & Binary search input as “y1” and

“y2”.

3) Plot them to get figure.

4) Labeling each axis.

Graph:

Conclusion:

Binary Search take more time than linear search.

For large number program took too much time to execute.

The graph don’t follow any sequence.

Any Query??Please, feel free to ask …