Pure Programmer
Blue Matrix

Cluster Map

Project: Median Filter

Write a filter program that accepts text representations of floating point values on the standard input, one per line. The program should then compute the [[median]] value. To find the median you must sort the data and pick the middle value. If the number of values is even, you must average the middle two values to compute the median. Finally the program should output the value of the median to 16 decimal places on a single line so that it can easily be used by other programs.

$ g++ -std=c++17 MedianFilter.cpp -o MedianFilter -lfmt $ ./MedianFilter < ../../data/text/FPList1.txt 4.77444 $ g++ -std=c++17 MedianFilter.cpp -o MedianFilter -lfmt $ ./MedianFilter < ../../data/text/FPList2.txt 52.2446 $ g++ -std=c++17 MedianFilter.cpp -o MedianFilter -lfmt $ ./MedianFilter < ../../data/text/FPList3.txt 496.557