---
type: "Chapter"
knowledge_type: "chapter"
entity_type: "chapter"
id: "66def9b03f8b4e9e69bdbddf"
title: "Searching"
board: "CBSE"
curriculum: "CBSE"
class: "Class 12"
subject: "Computer Science"
book: "Computer Science"
chapter: "Searching"
chapter_slug: "searching"
canonical_url: "https://www.edzy.ai/cbse-class-12-computer-science-searching"
markdown_url: "https://www.edzy.ai/okf/chapter/cbse-class-12-computer-science-searching.md"
source_type: "examSubjectBookChapter"
source_id: "66def9b03f8b4e9e69bdbddf"
source_pdf: "https://edzy-ai.s3.ap-south-1.amazonaws.com/edzy-express-ts/0350723c-4cc1-4019-a065-7c96691bde07.pdf"
source: "Edzy"
version: 1
last_updated: "2026-06-20"
---

# Searching
Searching refers to the process of locating a particular element within a collection of elements. The outcome of the search indicates whether the element exists in the collection and its position if present. In computer science, understanding various searching algorithms is essential for effective data retrieval.

---

## Knowledge Snapshot

| Field | Details |
| :--- | :--- |
| Class | Class 12 |
| Subject | Computer Science |
| Book | Computer Science |
| Chapter | Searching |
| Pages | 81-96 |

---

## Chapter Summary

### Short Summary
This chapter focuses on different searching techniques used in computer science, including linear search, binary search, and search by hashing.

### Detailed Summary
The chapter outlines the concept of searching, which involves locating a specific element in a collection. Searching is a crucial aspect of programming and algorithm design. It details three primary methods of searching: linear search, which checks each element sequentially; binary search, which requires a sorted list and divides the data to find the element quickly; and hashing, which provides an efficient lookup method via a hash table.

---

## Topic-Wise Explanation

### Introduction
Searching involves identifying an element in a data collection, which can lead to confirming the element's existence and its location.

### Linear Search
Linear search is an exhaustive method that compares each element in the list with the key until a match is found or the list ends. It is useful for small, unordered collections.

### Binary Search
Binary search operates on sorted lists, comparing the target key with the middle element and eliminating half of the remaining elements based on the comparison. This method is efficient and reduces search time drastically in sorted data.

### Search by Hashing
Hashing is a technique that allows the quick identification of the presence of an element in a collection by mapping elements to indices using a hash function, significantly speeding up search operations.

---

## Core Ideas

| Idea | Explanation |
| :--- | :--- |
| Searching | The process of locating a specific element in a collection of elements. |
| Linear Search | A basic search method involving sequential comparison of elements. |
| Binary Search | An efficient search method for sorted collections that reduces search space by half with each iteration. |
| Hashing | A method for quickly locating elements using a hash function and a hash table.

---

## Key Concepts

| Concept | Meaning |
| :--- | :--- |
| Linear Search | A searching method that checks each element sequentially until the desired element is found or the end of the collection is reached. |
| Binary Search | A searching method that divides a sorted area into halves to narrow down the key's location quickly. |
| Hash Table | A data structure that uses a hash function to map keys to values, allowing for fast data retrieval. |

---

## Important Points for Revision

* Searching is essential for data retrieval in computer science.
* Linear search works best for small, unsorted collections.
* Binary search requires sorted data and can be significantly faster than linear search.
* Hashing provides constant time complexity for retrieval if collisions are resolved appropriately.
* Collision in hashing occurs when multiple elements hash to the same index.
* A perfect hash function avoids collisions altogether.

---

## Practice Questions

### Short Answer Questions
1. What is linear search?
2. How does binary search improve search efficiency?
3. Define hashing in the context of searching algorithms.
4. Describe a scenario where linear search would be preferred.
5. Explain the consequences of collisions in hashing.

### Long Answer Questions
1. Compare linear search and binary search in terms of their efficiency, and provide examples of each.
2. Explain the process of hashing, and describe how to implement it in a programming language.
3. Discuss the importance of searching techniques in algorithm design, providing real-life applications.

---

## Related Concepts

* Data Structures
* Algorithm Design
* Complexity Analysis

---

## Source Attribution

| Field | Value |
| :--- | :--- |
| Source | Edzy |
| Reference Type | examSubjectBookChapter |
| Reference ID | 66def9b03f8b4e9e69bdbddf |
| Canonical URL | https://www.edzy.ai/cbse-class-12-computer-science-searching |
| Markdown URL | https://www.edzy.ai/okf/chapter/cbse-class-12-computer-science-searching.md |
