Skip to Main Content
Introducing Data Structures with Java
book

Introducing Data Structures with Java

by David Cousins
March 2013
Intermediate to advanced content levelIntermediate to advanced
416 pages
9h 41m
English
Pearson Education India
Content preview from Introducing Data Structures with Java

6

Searching Arrays

Arrays Arrays

Contents

  • A fundamental operation on array data—searching
  • Linear search and binary search algorithms
  • Algorithm efficiency and O( ) notation
6.1 INTRODUCTION

Searching for an item is a common operation, whether checking a train departure timetable, looking up a phone number or using the ‘find and replace’ option in a word processor, and we shall deal with it for each structure we consider. In this chapter, we examine the process of performing searches on arrays and the methods or ‘algorithms’ used for this purpose.

6.2 A SIMPLE SEARCH STRATEGY

Imagine that an array holds data representing goods in a retail company’s ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures and Algorithms Using Java

Data Structures and Algorithms Using Java

William McAllister

Publisher Resources

ISBN: 9788131758649