Skip to content

Commit 843085a

Browse files
committed
Cleanup Class AllPathsFromSourceToTarget
1 parent 440f3ce commit 843085a

File tree

866 files changed

+64846
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

866 files changed

+64846
-0
lines changed

Java/.clang-format

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
Language: Java
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: DontAlign
5+
AlignConsecutiveMacros: false
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlines: Right
9+
AlignOperands: false
10+
AlignTrailingComments: false
11+
AllowAllArgumentsOnNextLine: true
12+
AllowAllConstructorInitializersOnNextLine: true
13+
AllowAllParametersOfDeclarationOnNextLine: true
14+
AllowShortBlocksOnASingleLine: Never
15+
AllowShortCaseLabelsOnASingleLine: false
16+
AllowShortFunctionsOnASingleLine: false
17+
AllowShortLambdasOnASingleLine: All
18+
AllowShortIfStatementsOnASingleLine: true
19+
AllowShortLoopsOnASingleLine: true
20+
AlwaysBreakAfterDefinitionReturnType: None
21+
AlwaysBreakAfterReturnType: None
22+
AlwaysBreakBeforeMultilineStrings: false
23+
AlwaysBreakTemplateDeclarations: MultiLine
24+
BinPackArguments: true
25+
BinPackParameters: true
26+
BraceWrapping:
27+
AfterCaseLabel: false
28+
AfterClass: false
29+
AfterControlStatement: false
30+
AfterEnum: false
31+
AfterFunction: false
32+
AfterNamespace: false
33+
AfterObjCDeclaration: false
34+
AfterStruct: false
35+
AfterUnion: false
36+
AfterExternBlock: false
37+
BeforeCatch: false
38+
BeforeElse: false
39+
IndentBraces: false
40+
SplitEmptyFunction: true
41+
SplitEmptyRecord: true
42+
SplitEmptyNamespace: true
43+
BreakBeforeBinaryOperators: All
44+
BreakBeforeBraces: Custom
45+
BreakBeforeInheritanceComma: false
46+
BreakInheritanceList: BeforeColon
47+
BreakBeforeTernaryOperators: true
48+
BreakConstructorInitializersBeforeComma: false
49+
BreakConstructorInitializers: BeforeComma
50+
BreakAfterJavaFieldAnnotations: false
51+
BreakStringLiterals: true
52+
ColumnLimit: 300
53+
CommentPragmas: '^ IWYU pragma:'
54+
CompactNamespaces: false
55+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
56+
ConstructorInitializerIndentWidth: 4
57+
ContinuationIndentWidth: 4
58+
Cpp11BracedListStyle: true
59+
DeriveLineEnding: true
60+
DerivePointerAlignment: false
61+
DisableFormat: false
62+
ExperimentalAutoDetectBinPacking: false
63+
FixNamespaceComments: false
64+
ForEachMacros:
65+
- foreach
66+
- Q_FOREACH
67+
- BOOST_FOREACH
68+
IncludeBlocks: Preserve
69+
IncludeCategories:
70+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
71+
Priority: 2
72+
SortPriority: 0
73+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
74+
Priority: 3
75+
SortPriority: 0
76+
- Regex: '.*'
77+
Priority: 1
78+
SortPriority: 0
79+
IncludeIsMainRegex: '(Test)?$'
80+
IncludeIsMainSourceRegex: ''
81+
IndentCaseLabels: false
82+
IndentGotoLabels: true
83+
IndentPPDirectives: None
84+
IndentWidth: 4
85+
IndentWrappedFunctionNames: false
86+
InsertNewlineAtEOF: true
87+
JavaScriptQuotes: Leave
88+
JavaScriptWrapImports: true
89+
KeepEmptyLinesAtTheStartOfBlocks: true
90+
MacroBlockBegin: ''
91+
MacroBlockEnd: ''
92+
MaxEmptyLinesToKeep: 1
93+
NamespaceIndentation: Inner
94+
ObjCBinPackProtocolList: Auto
95+
ObjCBlockIndentWidth: 4
96+
ObjCSpaceAfterProperty: true
97+
ObjCSpaceBeforeProtocolList: true
98+
PenaltyBreakAssignment: 2
99+
PenaltyBreakBeforeFirstCallParameter: 19
100+
PenaltyBreakComment: 300
101+
PenaltyBreakFirstLessLess: 120
102+
PenaltyBreakString: 1000
103+
PenaltyBreakTemplateDeclaration: 10
104+
PenaltyExcessCharacter: 1000000
105+
PenaltyReturnTypeOnItsOwnLine: 60
106+
PointerAlignment: Left
107+
ReflowComments: true
108+
SortIncludes: true
109+
SortUsingDeclarations: true
110+
SpaceAfterCStyleCast: true
111+
SpaceAfterLogicalNot: false
112+
SpaceAfterTemplateKeyword: true
113+
SpaceBeforeAssignmentOperators: true
114+
SpaceBeforeCpp11BracedList: false
115+
SpaceBeforeCtorInitializerColon: true
116+
SpaceBeforeInheritanceColon: true
117+
SpaceBeforeParens: ControlStatements
118+
SpaceBeforeRangeBasedForLoopColon: true
119+
SpaceInEmptyBlock: false
120+
SpaceInEmptyParentheses: false
121+
SpacesBeforeTrailingComments: 1
122+
SpacesInAngles: false
123+
SpacesInConditionalStatement: false
124+
SpacesInContainerLiterals: false
125+
SpacesInCStyleCastParentheses: false
126+
SpacesInParentheses: false
127+
SpacesInSquareBrackets: false
128+
SpaceBeforeSquareBrackets: false
129+
Standard: Latest
130+
StatementMacros:
131+
- Q_UNUSED
132+
- QT_REQUIRE_VERSION
133+
TabWidth: 8
134+
UseCRLF: false
135+
UseTab: Never
136+
...

Java/.devcontainer/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/java/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster
4+
ARG VARIANT="21-bullseye"
5+
FROM mcr.microsoft.com/vscode/devcontainers/java:1.1.0-${VARIANT}
6+
7+
# [Option] Install Maven
8+
ARG INSTALL_MAVEN="false"
9+
ARG MAVEN_VERSION=""
10+
# [Option] Install Gradle
11+
ARG INSTALL_GRADLE="false"
12+
ARG GRADLE_VERSION=""
13+
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
14+
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
15+
16+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
17+
ARG NODE_VERSION="none"
18+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
19+
20+
# [Optional] Uncomment this section to install additional OS packages.
21+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
22+
# && apt-get -y install --no-install-recommends <your-package-list-here>
23+
24+
# [Optional] Uncomment this line to install global node packages.
25+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

Java/.devcontainer/devcontainer.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/java
3+
{
4+
"name": "Java",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update the VARIANT arg to pick a Java version: 11, 17
9+
// Append -bullseye or -buster to pin to an OS version.
10+
// Use the -bullseye variants on local arm64/Apple Silicon.
11+
"VARIANT": "21-bullseye",
12+
// Options
13+
"INSTALL_MAVEN": "true",
14+
"INSTALL_GRADLE": "true",
15+
"NODE_VERSION": "lts/*"
16+
}
17+
},
18+
19+
// Configure tool-specific properties.
20+
"customizations": {
21+
// Configure properties specific to VS Code.
22+
"vscode": {
23+
// Set *default* container specific settings.json values on container create.
24+
"settings": {
25+
},
26+
27+
// Add the IDs of extensions you want installed when the container is created.
28+
"extensions": [
29+
"vscjava.vscode-java-pack",
30+
"GitHub.copilot",
31+
]
32+
}
33+
},
34+
35+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
36+
// "forwardPorts": [],
37+
38+
// Use 'postCreateCommand' to run commands after the container is created.
39+
"postCreateCommand": "java -version",
40+
41+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
42+
"remoteUser": "vscode",
43+
"features": {
44+
"git": "os-provided",
45+
"github-cli": "latest"
46+
}
47+
}

Java/.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @yanglbme @vil02 @BamaCharanChhandogi
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Bug report"
2+
description: "Create a report to help us improve"
3+
title: "[BUG] <title>"
4+
labels: ["bug"]
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: "Description"
10+
description: "A clear and concise description of what the bug is."
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: steps
15+
attributes:
16+
label: "Steps to reproduce"
17+
description: "Steps to reproduce the behavior (if applicable)"
18+
placeholder: |
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
validations:
24+
required: false
25+
- type: textarea
26+
id: exceptedbhv
27+
attributes:
28+
label: "Excepted behavior"
29+
description: "A clear and concise description of what you expected to happen."
30+
validations:
31+
required: true
32+
- type: textarea
33+
id: screenshots
34+
attributes:
35+
label: "Screenshots"
36+
description: "If applicable, add screenshots to help explain your problem."
37+
validations:
38+
required: false
39+
- type: textarea
40+
id: context
41+
attributes:
42+
label: "Additional context"
43+
description: "Is there anything else we should know about this bug report?"
44+
validations:
45+
required: false
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Discord community
4+
url: https://the-algorithms.com/discord/
5+
about: Have any questions or found any bugs? Please contact us via Discord
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Feature Request"
2+
description: "Suggest an idea for this project"
3+
title: "[FEATURE REQUEST] <title>"
4+
labels: ["enhancement"]
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: What would you like to Propose?
10+
description: Provide a clear and concise explanation of your Proposal.
11+
validations:
12+
required: true
13+
- type: markdown
14+
attributes:
15+
value: |
16+
For new implementations, please specify the name and problem statement for the algorithm.
17+
For algorithm enhancements, specify what needs to be changed and why. For example:
18+
- Adding tests.
19+
- Optimizing logic.
20+
- Refactoring the file and folders for better structure.
21+
- type: textarea
22+
id: needdetails
23+
attributes:
24+
label: "Issue details"
25+
description: "Write down all the issue/algorithm details description mentioned above."
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: extrainfo
30+
attributes:
31+
label: "Additional Information"
32+
description: "Add any other information or screenshots about the request here."
33+
validations:
34+
required: false

Java/.github/ISSUE_TEMPLATE/other.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Other
2+
description: Use this for any other issues. Do NOT create blank issues
3+
title: "[OTHER]"
4+
labels: ["awaiting triage"]
5+
body:
6+
- type: textarea
7+
id: issuedescription
8+
attributes:
9+
label: What would you like to share?
10+
description: Provide a clear and concise explanation of your issue.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: extrainfo
15+
attributes:
16+
label: Additional information
17+
description: Is there anything else we should know about this issue?
18+
validations:
19+
required: false

Java/.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: "docker"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/.github/workflows/"
11+
schedule:
12+
interval: "daily"
13+
14+
- package-ecosystem: "maven"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
...

Java/.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--
2+
Thank you for your contribution!
3+
In order to reduce the number of notifications sent to the maintainers, please:
4+
- create your PR as draft, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests,
5+
- make sure that all of the CI checks pass,
6+
- mark your PR as ready for review, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review
7+
-->
8+
9+
<!-- For completed items, change [ ] to [x] -->
10+
11+
- [ ] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Java/blob/master/CONTRIBUTING.md).
12+
- [ ] This pull request is all my own work -- I have not plagiarized it.
13+
- [ ] All filenames are in PascalCase.
14+
- [ ] All functions and variable names follow Java naming conventions.
15+
- [ ] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
16+
- [ ] All new code is formatted with `clang-format -i --style=file path/to/your/file.java`

Java/.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Set up JDK
10+
uses: actions/setup-java@v4
11+
with:
12+
java-version: 21
13+
distribution: 'adopt'
14+
- name: Build with Maven
15+
run: mvn --batch-mode --update-snapshots verify
16+
- name: Upload coverage to codecov (tokenless)
17+
if: >-
18+
github.event_name == 'pull_request' &&
19+
github.event.pull_request.head.repo.full_name != github.repository
20+
uses: codecov/codecov-action@v4
21+
with:
22+
fail_ci_if_error: true
23+
- name: Upload coverage to codecov (with token)
24+
if: >
25+
github.repository == 'TheAlgorithms/Java' &&
26+
(github.event_name != 'pull_request' ||
27+
github.event.pull_request.head.repo.full_name == github.repository)
28+
uses: codecov/codecov-action@v4
29+
with:
30+
token: ${{ secrets.CODECOV_TOKEN }}
31+
fail_ci_if_error: true
32+
- name: Checkstyle
33+
run: mvn checkstyle:check
34+
- name: SpotBugs
35+
run: mvn spotbugs:check
36+
- name: PMD
37+
run: mvn pmd:check

0 commit comments

Comments
 (0)