smv1999 / CompetitiveProgrammingQuestionBank

This repository contains all the popular Competitive Programming and DSA questions with solutions for your Coding Interview Preparation.
https://smv1999.github.io/CompetitiveProgrammingQuestionBank/
MIT License
1.22k stars 350 forks source link

First and last occurrence of an element in the sorted array using binary search #920

Closed Soham2020 closed 2 years ago

Soham2020 commented 3 years ago

Have you read the Contributing Guidelines on Pull Requests?

Yes

Description

Isssue: #919 The problem that I have added wasn't there in the Searching Algorithm section, I am sure that it is fully optimized. Problem Statement: Given a sorted array with possibly duplicate elements, the task is to find indexes of first and last occurrences of an element x in the given array.

Checklist

Related Issues or Pull Requests

Issue: #919

Fill up the DCP form

If you are a part of DCP 21, fill up this form after the PR is merged.

The links provided in the form will be checked thoroughly, if someone tries fooling around, strict actions will be taken against the individual.

Soham2020 commented 3 years ago

Please review @smv1999

Soham2020 commented 2 years ago

@smv1999 As this questions are on searching algorithm, I had put into searching algorithm folder. Afterwards, if there is any problem, please mention me and tell in which folder I have to put. Thank you.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

Please reopen this issue once you commit the changes requested or make improvements on the code. Thank you for your contributions.