Skip to content

Add documentation for all data structures and algorithmic functions #59

@faheel

Description

@faheel
Member

Add a README to each directory containing proper documentation for algorithms or data structures in that directory.

Activity

sriram-25

sriram-25 commented on Jun 3, 2017

@sriram-25

What all should the documentation contain? For eg. Time Complexity,Working of the Algorithm?
@faheel

faheel

faheel commented on Jun 4, 2017

@faheel
MemberAuthor

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`
faheel

faheel commented on Jul 21, 2017

@faheel
MemberAuthor

Issue #74 is now closed

faheel

faheel commented on Jul 21, 2017

@faheel
MemberAuthor

This task can be automated using Doxygen.

pinned this issue on Jun 2, 2019
stale

stale commented on Jul 31, 2019

@stale

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alxmjo@faheel@rishabhp99@sriram-25@100sarthak100

        Issue actions

          Add documentation for all data structures and algorithmic functions · Issue #59 · ProAlgos/ProAlgos-Cpp