From 3004e6f80b457ffec7f1b0719f80378321bdcb2e Mon Sep 17 00:00:00 2001 From: wasim0315 <50516723+wasim0315@users.noreply.github.com> Date: Thu, 1 Oct 2020 19:34:33 +0530 Subject: [PATCH] Create RunningMedian.cpp Solution of Find the Running Median --- .../Find the Running Median/RunningMedian.cpp | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Hacker-Rank/Find the Running Median/RunningMedian.cpp diff --git a/Hacker-Rank/Find the Running Median/RunningMedian.cpp b/Hacker-Rank/Find the Running Median/RunningMedian.cpp new file mode 100644 index 0000000..52faf8b --- /dev/null +++ b/Hacker-Rank/Find the Running Median/RunningMedian.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