linear and binary search algorithms.(discrete mathematics)

12
Project Presentaion. Linear and Binary Search Algorithms.

Upload: shanawaz-ahamed

Post on 21-Jan-2018

65 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Linear and Binary Search Algorithms.(Discrete Mathematics)

Project Presentaion.

Linear and Binary Search Algorithms.

Page 2: Linear and Binary Search Algorithms.(Discrete Mathematics)

Shanawaz Ahamed 2016-1-60-103.

.

Mahfuza Rahman Mim 2016-2-60-001

Md Tahsif Ahmed 2016-2-60-117.

Page 3: Linear and Binary Search Algorithms.(Discrete Mathematics)

Outlines:

Concept of Algorithm.

The Linear search Algorithm.

The Binary search Algorithm.

Code (Flowchart).

Results.

Graph(Using MatLab).

Conclusions.

Page 4: Linear and Binary Search Algorithms.(Discrete Mathematics)

AlgorithmSearching Algorithm

1)The Linear search Algorithm.

2) The Binary search Algorithm.

.

Page 5: Linear and Binary Search Algorithms.(Discrete Mathematics)

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.

Page 6: Linear and Binary Search Algorithms.(Discrete Mathematics)

Code:

1)C++

2) Object Oriented.

3) Used Array.

4) rand(), function.

5)Clock(), function.

6)Linear Search Algorithm.

7) Binary Search Algorithm

Page 7: Linear and Binary Search Algorithms.(Discrete Mathematics)

Output:integer 5 as Input.

Page 8: Linear and Binary Search Algorithms.(Discrete Mathematics)

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.

Page 9: Linear and Binary Search Algorithms.(Discrete Mathematics)

Graph:

Page 10: Linear and Binary Search Algorithms.(Discrete Mathematics)

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.

Page 11: Linear and Binary Search Algorithms.(Discrete Mathematics)

Any Query??Please, feel free to ask …

Page 12: Linear and Binary Search Algorithms.(Discrete Mathematics)