Skip to content

Commit fbbc250

Browse files
authored
Created info file for project structure
1 parent c09e083 commit fbbc250

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

STRUCTURE.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Directory Structure
2+
----
3+
The general directory structure is as follows -
4+
```
5+
category_name
6+
|------ post_name
7+
|------ C
8+
|------- algorithm.c
9+
|------- input1.txt
10+
|------- output1.txt
11+
|------- input2.txt
12+
|------- output2.txt
13+
|------ C++
14+
|------- algorithm.cpp
15+
|------- input1.txt
16+
|------- output1.txt
17+
|------- input2.txt
18+
|------- output2.txt
19+
```
20+
Here ```category_name``` would be names such as -
21+
* Graph Theory
22+
* Dynamic Programming
23+
* Searching Algorithms
24+
25+
They are not something you would create by yourself. Inside these category folders, there's a folder for each post which comes into that category. The ```post_name``` folders would go by names such as -
26+
* Edit Distance
27+
* Kadane's Algorithm
28+
* Binary Heaps
29+
30+
They too are not something you would create by yourself. Under each post is the language specific implementation code, which is separately placed into the folder named by its language.
31+
32+
Suppose you wish to add the python implementation for the above example directory structure, then you would create a new folder named ```Python``` under the ```post_name``` directory. There you would add your ```.py``` files and the sample input and output files.
33+
34+
While this is the regular structure, some posts may have a structure such as -
35+
```
36+
category_name
37+
|------ post_name
38+
|------ C
39+
|------- algorithm.c
40+
|------ C++
41+
|------- algorithm.cpp
42+
|------ Test Cases
43+
|------- input1.txt
44+
|------- output1.txt
45+
|------- input2.txt
46+
|------- output2.txt
47+
```
48+
So, here the test cases are separated out into a separate folder. Example, have a look at the [Snakes and Ladders Game Code](https://github.com/VamsiSangam/theoryofprogramming/tree/master/Graph%20Theory/Snakes%20and%20Ladders%20Game%20Code) structure. The reason this is done for some posts is because, posts such as these, or say Snakes and Ladders are posted as problems in online judges such as Hackerrank, Spoj, LeetCode, etc. The test cases can be downloaded from there, and these are very well-crafted test cases. So, all the language implementations must follow these test cases for input and and must give the correct output.
49+
50+
If all this seems too overwhelming to you, don't worry! Make a new pull request/issue before you contribute and have your doubts cleared there!

0 commit comments

Comments
 (0)