From 0c706d9fc9406b58a84fc88402e8b8c10a6a43a2 Mon Sep 17 00:00:00 2001 From: wasim0315 <50516723+wasim0315@users.noreply.github.com> Date: Sat, 3 Oct 2020 15:00:49 +0530 Subject: [PATCH] Create solution.cpp Solution of "Find the Running Median" --- .../Heap/Find the Running Median/solution.cpp | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 DataStructures/Heap/Find the Running Median/solution.cpp diff --git a/DataStructures/Heap/Find the Running Median/solution.cpp b/DataStructures/Heap/Find the Running Median/solution.cpp new file mode 100644 index 0000000..52faf8b --- /dev/null +++ b/DataStructures/Heap/Find the Running Median/solution.cpp @@ -0,0 +1,52 @@ +#include + +using namespace std; + +int main() { int i,n,k; float median; cin >> n; + +vectormy; + +for(i=0;i> k; + + if(i == 0) + { + cout<::iterator pos; + + pos = upper_bound(my.begin(),my.end(),k); + my.insert(pos,k); + + /*for(int j=0;j