Skip to content

ShamsEmam/Algorithm

Repository files navigation

⚙️ Algorithm Collection

This repository contains a set of classic sorting and searching algorithms implemented in Java. The algorithms are organized by their category for easy navigation and understanding.


📚 Algorithms

🔍 Search Algorithms:

  • Binary Search: A fast searching algorithm that works on sorted arrays. It repeatedly divides the search interval in half until the value is found or the interval is empty.
  • Linear Search: A simple search algorithm that checks each element in the array sequentially until the target value is found.

🔄 Sorting Algorithms:

  • Bubble Sort: A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
  • Selection Sort: A comparison-based sorting algorithm that divides the input into two parts: the sorted part and the unsorted part. It repeatedly selects the smallest (or largest) element from the unsorted part and swaps it with the leftmost unsorted element.
  • Insertion Sort: A simple sorting algorithm that builds the sorted list one element at a time by inserting each new element into the correct position.
  • Merge Sort: A divide-and-conquer algorithm that divides the input array into two halves, recursively sorts them, and then merges the sorted halves.
  • Quick Sort: Another divide-and-conquer algorithm that selects a pivot element and partitions the array into two sub-arrays according to whether they are less than or greater than the pivot.

🧠 Purpose

The goal of this repository is to:

  • Practice and master algorithmic thinking.
  • Prepare for coding interviews and competitions.
  • Serve as a reference for implementing common algorithms.
  • Share knowledge with others.

🛠️ How to Use

  1. Clone the repository:
    git clone https://github.com/ShamsEmam/Algorithm.git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages