/squareSpiral

Solution of the square spiral at various levels of complexity

Primary LanguageC++

Square Spiral

Given the following square spiral below, write a program that displays the coordinates (x, y) of a given point provided for an input n. Implement two distinct algorithms that run in the worst case:

  • O(1)
  • O(n)

ScreenShot