Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大家做的题该如何命名? #28

Open
tiankonguse opened this issue May 3, 2019 · 8 comments
Open

大家做的题该如何命名? #28

tiankonguse opened this issue May 3, 2019 · 8 comments

Comments

@tiankonguse
Copy link
Owner

目前,每道题的目录名是题目名,代码也是题目名。
例如:problems/two-sum/two-sum.cpp

我在想,要不要使用题号作为题的目录名。

@tiankonguse
Copy link
Owner Author

two-sum 这道题的编号是 1,则可以使用下面的格式:
格式1:
problems/two-sum/1.cpp
problems/two-sun/tiankonguse-1.cpp

格式2:
problems/1/two-sum.cpp
problems/1/tiankonguse-two-sum.cpp

格式3:
problems/1/1.cpp
problems/1/tiankonguse-1.cpp

@HiSunzhenliang
Copy link
Contributor

个人赞成格式2

@Skymemory
Copy link
Contributor

格式2

@zwkcoding
Copy link
Contributor

仅供参照
格式:
problems/0001-two-sum/tiankonguse-cpp-0001/main.cpp

ref to Play-Leetcode/main.cpp at master · liuyubobobo/Play-Leetcode

@zwkcoding
Copy link
Contributor

如果想归类题目,可以参照这样子:
algo/c-cpp at master · wangzheng0822/algo

@tiankonguse
Copy link
Owner Author

如果想归类题目,可以参照这样子:
algo/c-cpp at master · wangzheng0822/algo

关于分类,后面有规划

@tiankonguse
Copy link
Owner Author

仅供参照
格式:
problems/0001-two-sum/tiankonguse-cpp-0001/main.cpp

ref to Play-Leetcode/main.cpp at master · liuyubobobo/Play-Leetcode

那采用这种格式吧:

problems/0001-two-sum/main.cpp
problems/0001-two-sum/tiankonguse.cpp
problems/0001-two-sum/tiankonguse-dfs.cpp
problems/0001-two-sum/tiankonguse-dp.cpp
problems/0001-two-sum/tiankonguse-dp2.cpp

@tiankonguse
Copy link
Owner Author

考虑到文件名
也需要起到是那道题的作用,这里采用这样的格式:

假设是 1049 题

problemset-new/010/1049-last-stone-weight-ii/1049-main.cpp
problemset-new/010/1049-last-stone-weight-ii/1049-tiankonguse.cpp
problemset-new/010/1049-last-stone-weight-ii/1049-tiankonguse-dfs.cpp
problemset-new/010/1049-last-stone-weight-ii/1049-tiankonguse-dp.cpp
problemset-new/010/1049-last-stone-weight-ii/1049-tiankonguse-dp2.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants