• C# and .NET - OOD / OOP - Programming

    PriorityQueue in .NET 6: a practical guide

    .NET 6 added a long-missing collection to the base class library: PriorityQueue<TElement, TPriority>. A priority queue is useful when you do not want to process items in the order they were inserted, but in the order of their priority. Typical examples include job scheduling, pathfinding, graph algorithms, simulations, message processing,…

  • C# and .NET - OOD / OOP - Programming

    Custom comparer of a SortedSet in C#

    SortedSet in .NET manages ordered, unique elements using a custom comparer that defines both sorting order and element uniqueness. A common pitfall occurs when two different instances with the same value are treated as duplicates. To avoid this, a tie-breaker is needed, ensuring both order and distinctness among elements.

  • OOD / OOP

    Returning buffers with C++ and Boost

    In the article comparing CPU and GPU implementations of the median filter, the class was designed to receive image buffers with the AddSample method and return a pointer to the image buffer with the GetMedianImage method: class TM_CPURefImpl : public TM_BaseClass { public: TM_CPURefImpl(const int _NumSamples, const int _BufferSize); virtual…

  • OOD / OOP

    An object-oriented approach to FizzBuzz

    FizzBuzz is described as: Write a program that prints the integers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz” It takes a couple…