Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

0xsaifdev/Data-Structures-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

10 Commits

Repository files navigation

Data Structures and Algorithms

This repository contains implementations of common algorithms in C++. Below is a brief overview of each algorithm, its time complexity, and typical usage scenarios.

Sorting Algorithms

  1. Bubble Sort

    • Time Complexity: O(n2)
    • Usage: Simple but inefficient, used for small datasets or educational purposes.
  2. Selection Sort

    • Time Complexity: O(n2)
    • Usage: Better than bubble sort for small datasets, useful for learning purposes.
  3. Quick Sort

    • Time Complexity: O(n log n) on average
    • Usage: Efficient for large datasets; performance may degrade with bad pivot choices.
  4. Merge Sort

    • Time Complexity: O(n log n)
    • Usage: Stable and consistent, ideal for large datasets where stability is required.
  5. Insertion Sort

    • Time Complexity: O(n2)
    • Usage: Efficient for small datasets and nearly sorted data.

Problem-Solving

  1. Two Sum Problem

    • Description: Find two numbers that add up to a target value.
    • Time Complexity: O(n)
    • Usage: Common problem in coding interviews.
  2. Counter Problem

    • Description: Count occurrences of elements in an array.
    • Time Complexity: O(n)
    • Usage: Useful for frequency counting.
  3. Remove Duplicates

    • Description: Remove duplicates from a sorted array.
    • Time Complexity: O(n)
    • Usage: Simplifies an array by removing duplicate values.

Credits

Developed by Muhammad Saif.

About

This repository contains implementations of common algorithms and Leetcode problems in C++.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /