Searching and Sorting - PowerPoint Presentation,Algorithm, Engineering Notes | EduRev

: Searching and Sorting - PowerPoint Presentation,Algorithm, Engineering Notes | EduRev

 Page 1


1
24 24
© 2006 Pearson Education, Inc.  All rights reserved.
Searching and 
Sorting
Page 2


1
24 24
© 2006 Pearson Education, Inc.  All rights reserved.
Searching and 
Sorting
2
With sobs and tears 
he sorted out
Those of the largest size …
— Lewis Carroll 
Attempt the end, and never stand to doubt;
Nothing’s so hard, but search will find it out.  
© 2006 Pearson Education, Inc.  All rights reserved.
— Robert Herrick
It is an immutable law in business that words are 
words, explanations are explanations, promises 
are promises — but only performance is reality.  
— Harold S. Green
Page 3


1
24 24
© 2006 Pearson Education, Inc.  All rights reserved.
Searching and 
Sorting
2
With sobs and tears 
he sorted out
Those of the largest size …
— Lewis Carroll 
Attempt the end, and never stand to doubt;
Nothing’s so hard, but search will find it out.  
© 2006 Pearson Education, Inc.  All rights reserved.
— Robert Herrick
It is an immutable law in business that words are 
words, explanations are explanations, promises 
are promises — but only performance is reality.  
— Harold S. Green
3
OBJECTIVES
In this chapter you will learn: 
 To search for a given value in an array 
using the linear search and binary search 
algorithm.
 To sort arrays using the iterative selection 
© 2006 Pearson Education, Inc.  All rights reserved.
 To sort arrays using the iterative selection 
and insertion sort algorithms.
 To sort arrays using the recursive merge 
sort algorithm.
 To determine the efficiency of searching 
and sorting algorithms.
Page 4


1
24 24
© 2006 Pearson Education, Inc.  All rights reserved.
Searching and 
Sorting
2
With sobs and tears 
he sorted out
Those of the largest size …
— Lewis Carroll 
Attempt the end, and never stand to doubt;
Nothing’s so hard, but search will find it out.  
© 2006 Pearson Education, Inc.  All rights reserved.
— Robert Herrick
It is an immutable law in business that words are 
words, explanations are explanations, promises 
are promises — but only performance is reality.  
— Harold S. Green
3
OBJECTIVES
In this chapter you will learn: 
 To search for a given value in an array 
using the linear search and binary search 
algorithm.
 To sort arrays using the iterative selection 
© 2006 Pearson Education, Inc.  All rights reserved.
 To sort arrays using the iterative selection 
and insertion sort algorithms.
 To sort arrays using the recursive merge 
sort algorithm.
 To determine the efficiency of searching 
and sorting algorithms.
4
24.1 Introduction
24.2 Searching Algorithms
24.2.1 Linear Search
24.2.2 Binary Search
24.3 Sorting Algorithms
24.3.1 Selection Sort
24.3.2 Insertion Sort 
24.3.3 Merge Sort 
© 2006 Pearson Education, Inc.  All rights reserved.
24.3.3 Merge Sort 
24.4 Wrap-Up
Page 5


1
24 24
© 2006 Pearson Education, Inc.  All rights reserved.
Searching and 
Sorting
2
With sobs and tears 
he sorted out
Those of the largest size …
— Lewis Carroll 
Attempt the end, and never stand to doubt;
Nothing’s so hard, but search will find it out.  
© 2006 Pearson Education, Inc.  All rights reserved.
— Robert Herrick
It is an immutable law in business that words are 
words, explanations are explanations, promises 
are promises — but only performance is reality.  
— Harold S. Green
3
OBJECTIVES
In this chapter you will learn: 
 To search for a given value in an array 
using the linear search and binary search 
algorithm.
 To sort arrays using the iterative selection 
© 2006 Pearson Education, Inc.  All rights reserved.
 To sort arrays using the iterative selection 
and insertion sort algorithms.
 To sort arrays using the recursive merge 
sort algorithm.
 To determine the efficiency of searching 
and sorting algorithms.
4
24.1 Introduction
24.2 Searching Algorithms
24.2.1 Linear Search
24.2.2 Binary Search
24.3 Sorting Algorithms
24.3.1 Selection Sort
24.3.2 Insertion Sort 
24.3.3 Merge Sort 
© 2006 Pearson Education, Inc.  All rights reserved.
24.3.3 Merge Sort 
24.4 Wrap-Up
5
24.1 Introduction
• Searching
- Determining whether a search key is present in data
• Sorting
- Places data in order based on one or more sort keys
© 2006 Pearson Education, Inc.  All rights reserved.
Read More
Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!