Google interview question

Design a software library to implement a histogram.

Interview Answer

Anonymous

28 Mar 2010

class Hist { private: int value; int items; friend class Graph; public: Hist(int); int showvalue(); void plot(); }; Hist::Hist(int a) { value = a; items++; //Graph(this,items); } int Hist::showvalue() { return value; } void Hist::plot() { for(int i=0;i