You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now the documentation will not include the working details of the algorithm but only information about the "interface" of various functions, i.e. about:
what the function does,
its inputs,
its output (return value), if any,
along with (wherever necessary),
time complexity,
space complexity.
The inputs, variables and output will have their type, name and a single line description. The time and space complexity will be of the best and worst cases (and average case too, if necessary).
For example, for Kadane.cpp the documentation could look like:
maximumSubarray
<description of what the function does in 1-2 lines>
Input
values
Type: const vector<int> &
<description in 1-2 lines>
Output
tuple of maxSum, start, end
Type: tuple<int, size_t, size_t>
<description of maxSum in 1-2 lines>
<description of start in 1-2 lines>
<description of end in 1-2 lines>
Time complexity
Worst case
O(N), where N is the size of values
Best case
O(N), where N is the size of values
Markdown for the above documentation:
## `maximumSubarray`
<description of what the function does in 1-2 lines>
### Input
- #### `values`
Type: `const vector<int> &`
<description in 1-2 lines>
### Output
- #### tuple of `maxSum`, `start`, `end`
Type: `tuple<int, size_t, size_t>`
<description of `maxSum` in 1-2 lines>
<description of `start` in 1-2 lines>
<description of `end` in 1-2 lines>
### Time complexity
- #### Worst case
_O_(**N**), where **N** is the size of `values`
- #### Best case
_O_(**N**), where **N** is the size of `values`
This issue has been automatically marked as inactive because it has not had recent activity. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Activity
sriram-25 commentedon Jun 3, 2017
What all should the documentation contain? For eg. Time Complexity,Working of the Algorithm?
@faheel
faheel commentedon Jun 4, 2017
For now the documentation will not include the working details of the algorithm but only information about the "interface" of various functions, i.e. about:
along with (wherever necessary),
The inputs, variables and output will have their type, name and a single line description. The time and space complexity will be of the best and worst cases (and average case too, if necessary).
For example, for Kadane.cpp the documentation could look like:
maximumSubarray
<description of what the function does in 1-2 lines>
Input
values
Type:
const vector<int> &
<description in 1-2 lines>
Output
tuple of
maxSum
,start
,end
Type:
tuple<int, size_t, size_t>
<description of
maxSum
in 1-2 lines><description of
start
in 1-2 lines><description of
end
in 1-2 lines>Time complexity
Worst case
O(N), where N is the size ofvalues
Best case
O(N), where N is the size ofvalues
Markdown for the above documentation:
faheel commentedon Jul 21, 2017
Issue #74 is now closed
faheel commentedon Jul 21, 2017
This task can be automated using Doxygen.
stale commentedon Jul 31, 2019
This issue has been automatically marked as inactive because it has not had recent activity. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.
31 remaining items