Bin search
This commit is contained in:
@@ -2,13 +2,16 @@
|
||||
#define S0034_FIND_FIRST_AND_LAST_POSITION_OF_ELEMENT_IN_SORTED_ARRAY_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Solution {
|
||||
class Solution1 {
|
||||
public:
|
||||
vector<int> searchRange(vector<int>& nums, int target);
|
||||
};
|
||||
|
||||
class Solution2 {
|
||||
public:
|
||||
vector<int> searchRange(vector<int>& nums, int target);
|
||||
};
|
||||
#endif
|
||||
|
@@ -2,11 +2,15 @@
|
||||
#define S0035_SEARCH_INSERT_POSITION_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Solution {
|
||||
class Solution1 {
|
||||
public:
|
||||
int searchInsert(vector<int>& nums, int target);
|
||||
};
|
||||
|
||||
class Solution2 {
|
||||
public:
|
||||
int searchInsert(vector<int>& nums, int target);
|
||||
};
|
||||
|
18
include/s0704_binary_search.hpp
Normal file
18
include/s0704_binary_search.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef S0704_BINARY_SEARCH_HPP
|
||||
#define S0704_BINARY_SEARCH_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Solution1 {
|
||||
public:
|
||||
int binSearch(vector<int>& nums, int target);
|
||||
};
|
||||
|
||||
class Solution2 {
|
||||
public:
|
||||
int binSearch(vector<int>& nums, int target);
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user