ProAlgos-Cpp: Mention time and space complexities in comments

For each algorithm, mention its time complexity and space complexity in the “description comment” of its implementation program.

The format for the “description comment” (which is written at the beginning) should be:

/*
    <Name of algorithm>
    -------------------
    <Brief description>

    Time complexity
    ---------------
    O(...), where <description of variable(s)>    
    
    Space complexity
    ----------------
    O(...), where <description of variable(s)>
*/

Following are the algorithms for which time and space complexity hasn’t been added yet:

  • N-Queens
  • Kadane
  • Binary search
  • Bubble sort
  • Counting sort
  • Insertion sort
  • Merge sort
  • Quick sort
  • Selection sort

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I think its a good idea to put this in the readme or coding guidlines.