Skip to main content Accessibility help
×
Hostname: page-component-8448b6f56d-jr42d Total loading time: 0 Render date: 2024-04-24T21:34:28.940Z Has data issue: false hasContentIssue false

6 - Searching

Published online by Cambridge University Press:  27 April 2019

Sandeep Sen
Affiliation:
Indian Institute of Technology, Delhi
Amit Kumar
Affiliation:
Indian Institute of Technology, Delhi
Get access

Summary

The problem of searching is basic in the computer science field and vast amount of literature is devoted to many fascinating aspects of this problem. Starting with searching for a given key in a pre-processed set to the more recent techniques developed for searching documents, the modern civilization forges ahead using Google Search. Discussing the latter techniques is outside the scope of this chapter, so we focus on the more traditional framework. Knuth [83] is one of the most comprehensive sources of the earlier techniques; all textbooks on data structures address common techniques like binary search and balanced tree-based dictionaries like AVL (Adelson-Velsky and Landis) trees, red–black trees, B-trees, etc. We expect the reader to be familiar with such basic methods. Instead, we focus on some of the simpler and lesser known alternatives to the traditional data structures. Many of these rely on innovative use of randomized techniques, and are easier to generalize for a variety of applications. They are driven by a somewhat different perspective of the problem of searching that enables us to get a better understanding including practical scenarios where the universe is much smaller. The underlying assumption in comparison-based searching is that the universe may be infinite, that is, we can be searching real numbers. While this is a powerful framework, we miss out on many opportunities to develop faster alternatives based on hashing in a bounded universe. We will address both these frameworks so that the reader can make an informed choice for a specific application.

Skip-Lists – A Simple Dictionary

Skip-list is a data structure introduced by Pugh [119] as an alternative to balanced binary search trees for handling dictionary operations on ordered lists. The reader may recall that linked lists are very amenable to modifications in O(1) time although they do not support fast searches like binary search trees. We substitute complex book-keeping information used for maintaining balance conditions for binary trees by random sampling techniques. It has been shown that given access to random bits, the expected search time in a skip-list of n elements is O(logn), which compares very favorably with balanced binary trees.

Type
Chapter
Information
Design and Analysis of Algorithms
A Contemporary Perspective
, pp. 109 - 127
Publisher: Cambridge University Press
Print publication year: 2019

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Searching
  • Sandeep Sen, Indian Institute of Technology, Delhi, Amit Kumar, Indian Institute of Technology, Delhi
  • Book: Design and Analysis of Algorithms
  • Online publication: 27 April 2019
  • Chapter DOI: https://doi.org/10.1017/9781108654937.007
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Searching
  • Sandeep Sen, Indian Institute of Technology, Delhi, Amit Kumar, Indian Institute of Technology, Delhi
  • Book: Design and Analysis of Algorithms
  • Online publication: 27 April 2019
  • Chapter DOI: https://doi.org/10.1017/9781108654937.007
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Searching
  • Sandeep Sen, Indian Institute of Technology, Delhi, Amit Kumar, Indian Institute of Technology, Delhi
  • Book: Design and Analysis of Algorithms
  • Online publication: 27 April 2019
  • Chapter DOI: https://doi.org/10.1017/9781108654937.007
Available formats
×