Skip to content

Instantly share code, notes, and snippets.

View Naveen-Shah01's full-sized avatar
💭
Off track

Naveen Shah Naveen-Shah01

💭
Off track
View GitHub Profile
#include<bits/stdc++.h>
using namespace std;
int position(int arr[],int n,int target)
{ int start=0;int end=n-1;
while(start<=end)
{ int mid=start+(end-start)/2;
if(arr[mid]==target)
return mid;
else if(arr[mid]>target)