Skip to content

Instantly share code, notes, and snippets.

@luccasiau
Created August 18, 2020 01:05
Show Gist options
  • Save luccasiau/b95c968963961633070b07f6fab64543 to your computer and use it in GitHub Desktop.
Save luccasiau/b95c968963961633070b07f6fab64543 to your computer and use it in GitHub Desktop.
MedianStream; Part 0
class MedianStream {
public:
// Constructor
MedianStream();
// Adds integer value to the stream
void addNumber(int x);
// Returns median of all numbers seen so far
double getMedian();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment