Ad
  • Default User Avatar

    I am using c#. I have not idea how to return the error.

    Maybe you could google "C# throw error".

  • Custom User Avatar

    I'm going to have to completely disagree with you banny127: this is the best answer because it was calculated before coding.

    Math first; code later. Your CPU will thank you.

    Programmers need to have a ton of tools in their toolbox, and your casual dismissal of "algebra" is, frankly, terrifying--given that all programming boils down to logical/mathematical computations.

  • Custom User Avatar

    That depends on the view of what is the best solution. However, in most computer algorithms the best solution (out of all that give correct results) the best is where is minimum used memory & CPU time. This is a solution in constant time because there was a previous analysis with pen & paper. That is what I call a real optimization - the author found a way of different solving of the same problem using less resources.