diff --git a/BinarySearch.md b/BinarySearch.md
new file mode 100644
index 0000000..a153213
--- /dev/null
+++ b/BinarySearch.md
@@ -0,0 +1,161 @@
+# Binary Search
+
+***
+
+
+ About Binary Search
+
+In computer science, **Binary Search**, also known as **half-interval search**, **logarithmic search**, or **binary chop**, is a search algorithm that finds the position of a target value within a sorted array.
+
+Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array.
+
+Binary search runs in logarithmic time in the worst case, making **O(log n)** comparisons, where **n** is the number of elements in the array. Binary search is faster than linear search except for small arrays. However, the array must be sorted first to be able to apply binary search. There are specialized data structures designed for fast searching, such as hash tables, that can be searched more efficiently than binary search. However, binary search can be used to solve a wider range of problems, such as finding the next-smallest or next-largest element in the array relative to the target even if it is absent from the array.
+
+There are numerous variations of binary search. In particular, fractional cascading speeds up binary searches for the same value in multiple arrays. Fractional cascading efficiently solves a number of search problems in computational geometry and in numerous other fields. Exponential search extends binary search to unbounded lists. The binary search tree and B-tree data structures are based on binary search.
+
+
+
+
+### Algorithm
+
+***
+
+
+ Explanation
+
+Binary search works on sorted arrays. Binary search begins by comparing an element in the middle of the array with the target value. If the target value matches the element, its position in the array is returned. If the target value is less than the element, the search continues in the lower half of the array. If the target value is greater than the element, the search continues in the upper half of the array. By doing this, the algorithm eliminates the half in which the target value cannot lie in each iteration.
+
+
+
+
+
+Let **A** be an array, which has **n** elements and we want to search for a number **T**. The **Pseudocode** of searching for this item is given below:
+
+
+ Pseudocode
+
+ function binary_search(A, n, T) is
+ L := 0
+ R := n − 1
+ while L ≤ R do
+ m := floor((L + R) / 2)
+ if A[m] < T then
+ L := m + 1
+ else if A[m] > T then
+ R := m − 1
+ else:
+ return m
+ return unsuccessful
+
+
+
+The **function** for running Binary Search over a sorted array is given below:
+
+
+ Function of Binary Search
+
+```cpp
+
+int BinarySearch ( int DATA[], int LB, int UB, int ITEM )
+{
+ int BEG = LB, END = UB, MID;
+
+ while( BEG <= END ) {
+ MID = ( int ) ( BEG + END ) / 2;
+ if ( ITEM < DATA[MID] ) { // ITEM < DATA[MID]. Update END value
+ END = MID - 1;
+ }
+ else if ( ITEM > DATA[MID] ) { // ITEM > DATA[MID]. Update BEG value
+ BEG = MID + 1;
+ }
+ else {
+ return MID; // found the item! So returning its index
+ }
+ }
+ return -1; // there is no such item. So returning an impossible index
+}
+
+```
+
+
+
+
+
+ More about the function of Binary Search
+
+In this function -
+
+```cpp
+
+int DATA[] = the dataset given to us.
+int LB = the lower bound of the range we want to search for.
+int UB = the upper bound of the range we want to search for.
+int ITEM = the item which we are searching.
+
+```
+
+Suppose, we have a sorted array **DATA[8] = { 10, 20, 20, 20, 30, 30, 40, 50 }**. We would like to search if **40** is present in this array or not. And we want to search in the whole array. In this case,
+
+```cpp
+
+int LB = 0;
+int UB = 7;
+int ITEM = 40
+
+```
+
+Then we call the function to get the location of the item.
+
+```cpp
+
+int index = BinarySearch ( DATA[], 0, 8, 40 );
+if( index == -1 ) std::cout << "Item Not Found" << endl;
+else std::cout << "Item Found at Index " << index << endl;
+
+```
+
+```
+Output:
+Item Found at Index 6
+```
+
+If we set `ITEM = 25`, the output will be - `Item Not Found`.
+
+If we do not want to run Binary Search over the whole array but on a section of the array, we just have to set the boundary. Suppose we want to run over from index 2 to index 5 of the array, then our code will look like -
+
+```cpp
+
+int index = BinarySearch ( DATA[], 2, 5, 40 );
+
+```
+
+```
+Output:
+Item Not Found.
+```
+
+This is the most simple version of Binary Search. We can also use Binary Search to find some other things too, such as - we can find **Lower Bound** and **Upper Bound** of an item, **smallest element** and **largest element** from a rotated (after sorted) array, we can also solve some other problems like **Max in a hill** or **Min in a canyon**. We will be exploring them in the further part.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 5c46278..bb7b2b1 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@
- Dynamic Programming
- BitSet
- Greedy
+- [Binary Search](https://definecoder.github.io/BinarySearch)
- Two Pointer
- Geometry
- Combinatorics
diff --git a/STL/PriorityQueue.md b/STL/PriorityQueue.md
index 8ba26b6..3275987 100644
--- a/STL/PriorityQueue.md
+++ b/STL/PriorityQueue.md
@@ -20,10 +20,14 @@ This creates a priority queue nammed MyPriorityQueue of a cerrain data type.
## Operations
You can do the following operation in a priority queue :
-- push
-- pop
-- top
- + _**PUSH :**_ This operation takes an input of certain data type and pushes it into your priority queue or heap. It works same as pushing something in a heap. It take logN time to do this operation. Suppose you want to push 12, 18, 8 into your priority queue. You can do that using the following code:
++ push
++ pop
++ top
+
+Now lets see the implementation
+
+## Implementation of the operations
++ _**PUSH :**_ This operation takes an input of certain data type and pushes it into your priority queue or heap. It works same as pushing something in a heap. It take logN time to do this operation. Suppose you want to push 12, 18, 8 into your priority queue. You can do that using the following code:
```cpp
priority_queue < int > MyPQ;
MyPQ.push(12);
@@ -31,7 +35,7 @@ You can do the following operation in a priority queue :
MyPQ.push(8);
```
This code makes a priority queue of integers named MyPQ and pushes 12, 18 and 8 into that. Then it works like a heap and so you can pop out the maximum number from the heap list in just logN time which means this 3 numbers will be stored in this sequence { 18, 12, 8 }.
- + _**POP :**_ You can retrieve the maximum number from the numbers you pushed earlier using this operation. You can see the following code to see the implementation of this operation :
++ _**POP :**_ You can retrieve the maximum number from the numbers you pushed earlier using this operation. You can see the following code to see the implementation of this operation :
```cpp
priority_queue < int > MyPQ;
MyPQ.push(12);
@@ -44,7 +48,7 @@ You can do the following operation in a priority queue :
// Now the queue will be empty
```
This pop functionality works like popping from a heap. And after popping it automatically adjusts the queue in logN time.
- + _**TOP :**_ This function gives us the access to the topmost element of the priority queue. If the queue is in default mode it will return the maximum element and if it is declared as the smaller version of the heap it will return the smallest number of the list. See the following code for better understanding :
++ _**TOP :**_ This function gives us the access to the topmost element of the priority queue. If the queue is in default mode it will return the maximum element and if it is declared as the smaller version of the heap it will return the smallest number of the list. See the following code for better understanding :
```cpp
priority_queue < int > MyPQ;
MyPQ.push(12);
@@ -53,3 +57,97 @@ You can do the following operation in a priority queue :
cout << MyPQ.top() << endl;
// prints 18 as it is the largest among the heap
```
+***
+## Printing a Priority Queue using a custom function :
+There are no library function to print a queue without popping. So, we will write a custom function of oue own to print a priority queue. We will send a copy of our priority queue in order to print it. We can pop that copy because it will not change the main Priority_queue which is inside the main function. So, Lets see the code :
+ ```cpp
+ #include
+ #include
+
+ using namespace std;
+
+ void print_priority_queue(priority_queue < int > temp)
+ {
+ cout << "Elements of the priority_queue are :: \n" ;
+ while ( !temp.empty() )
+ {
+ cout << temp.top() << " ";
+ temp.pop();
+ }
+ cout << '\n';
+ }
+
+ int main(){
+ priority_queue < int > MyPQ;
+ MyPQ.push(12);
+ MyPQ.push(18);
+ MyPQ.push(8);
+ // After Pushing the queue will be 18, 12, 8
+ print_priority_queue(MyPQ);
+ // printing the priority queue using custom function
+ // Here we are sending a copy of the queue
+ MyPQ.pop(); // popping 18
+ MyPQ.pop(); // popping 12
+ MyPQ.pop(); // popping 8
+ // Now the queue will be empty
+ return 0;
+ }
+ ```
+### OUTPUT:
+ ```
+ Elements of the priority_queue are ::
+ 18 12 8
+ ```
+
+## Set the Minimum Number as priority ( Minimum Number Heap )
+Sometimes your priority can be to pop the smallest number first. Which means if you want to keep your data in ascending order you need to declare the priority queue using the following code :
+
+ ```cpp
+ #include
+ #include
+
+ using namespace std;
+
+ // Function to print minimum heap priority queue
+ void print_spcl_priority_queue(priority_queue < int , vector < int > , greater < int > > temp)
+ {
+ cout << "Elements of the priority_queue are :: \n" ;
+ while ( !temp.empty() )
+ {
+ cout << temp.top() << " ";
+ temp.pop();
+ }
+ cout << '\n';
+ }
+
+ int main(){
+ priority_queue < int , vector < int > , greater < int > > MySpclPQ;
+ MySpclPQ.push(12);
+ MySpclPQ.push(18);
+ MySpclPQ.push(8);
+ // After Pushing the queue will be 8 , 12 , 18
+ print_spcl_priority_queue(MySpclPQ);
+ // printing the priority queue
+ MySpclPQ.pop(); // popping 8
+ MySpclPQ.pop(); // popping 12
+ MySpclPQ.pop(); // popping 18
+ // Now the queue will be empty
+ return 0;
+ }
+ ```
+### OUTPUT :
+ ```
+ Elements of the minimum_heap_priority_queue are ::
+ 8 12 18
+ ```
+Here we changed the argument of the queue printing function to _**`priority_queue < int , vector < int > , greater < int > > temp`**_ To let the function know that it is a minimum heap.
+
+## Functions :
+
+| Function | Work of the function |
+|:-------------:|:------------------------------------------------------------:|
+| MyPQ.empty() | Returns True is MyPQ is empty otherwise returns False |
+| MyPQ.top() | Returns the most prioritized (Topmost) element of the queue |
+| MyPQ.pop() | Removes the most prioritized (Topmost) element of the queue |
+| MyPQ.push(x) | Pushes x into the heap |
+| pq1.swap(pq2) | Swaps the values from pq1 to pq2 |
diff --git a/STL/home.md b/STL/home.md
index 7909d76..4c1dbcb 100644
--- a/STL/home.md
+++ b/STL/home.md
@@ -16,7 +16,7 @@ STL is a very powefull tool for **competitive programming**. It saves a lot of t
* Multiset
* Unordered Set
* Unordered Multiset
-- Map
+- [Map](https://definecoder.github.io/STL/map)
* Multimap
* Unordered Map
* Unordered Multimap
diff --git a/STL/map.md b/STL/map.md
new file mode 100644
index 0000000..10a14f4
--- /dev/null
+++ b/STL/map.md
@@ -0,0 +1,93 @@
+# Map in C++
+
+## Introduction
+
+Map is one of the most powerful tools in STL. There are countless uses of maps and all of them are very useful. According to [cplusplus.com](http://www.cplusplus.com/reference/map/map/), Maps are associative containers that store elements formed by a combination of a key value and a mapped value, following a specific order. There are many things common between Set and Map. Infact some argues that **Map** is nothing but a 2D **Set**. So, without further due, lets jump into it!
+
+## Declaration
+For using map you need to add the following header file:
+```cpp
+#include