Skip to content

Commit c0f0520

Browse files
committed
l
1 parent caaca9e commit c0f0520

File tree

1,694 files changed

+176440
-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.

1,694 files changed

+176440
-0
lines changed

src/main/java/com/ctci/treesandgraphs/CheckBalanced.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.ctci.treesandgraphs;
22

3+
4+
35
/**
46
* Implement a function to check if a binary tree is balanced. For the purposes of this question, a balanced
57
* tree is defined to be a tree such that the heights of the two subtrees of any node never differ by more than one.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
comment: false
2+
coverage:
3+
status:
4+
project:
5+
default:
6+
threshold: 1
7+
informational: true
8+
patch: off
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* text eol=lf
2+
*.bat text eol=crlf
3+
*.png binary
4+
*.key binary
5+
*.jar binary
6+
*.ttf binary
7+
release-notes-* merge=union
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
custom: https://junit.org/sponsoring
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Overview
2+
3+
_Replace the following bullet points with your issue description,
4+
after answering yourself: **"What kind of issue is this?"**_
5+
6+
- ( ) **Question.** This issue tracker is not the place for questions.
7+
If you want to ask how to do something, or to understand why
8+
something isn't working the way you expect it to, please first use Stack
9+
Overflow or Gitter.
10+
https://stackoverflow.com/questions/tagged/junit5
11+
12+
- ( ) **Bug report.** Please provide us the version of JUnit 5 you are
13+
using and, if possible, a failing unit test with your bug report. Don't
14+
forget to describe the rationale for this issue (e.g. expected vs.
15+
actual behavior).
16+
17+
- ( ) **Feature request.** Start by telling us what problem you’re trying
18+
to solve. Often a solution already exists! Please, don’t send pull requests
19+
to implement new features without first getting our support.
20+
21+
## Deliverables
22+
23+
- [ ] ...
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
<!-- Please provide us the version of JUnit 5 you are using and, if possible, a failing unit test with your bug report. Don't forget to describe the rationale for this issue (e.g. expected vs. actual behavior). -->
8+
9+
## Steps to reproduce
10+
11+
<!-- Please insert a code snippet or a link to another repo along with instructions how to reproduce the issue here. The example should be minimal, complete and verifiable (see https://stackoverflow.com/help/mcve). -->
12+
13+
## Context
14+
15+
- Used versions (Jupiter/Vintage/Platform):
16+
- Build Tool/IDE:
17+
18+
## Deliverables
19+
20+
- [ ] ...
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
<!-- Start by telling us what problem you’re trying to solve. Often a solution already exists! Please, don’t send pull requests to implement new features without first getting our support. -->
8+
9+
## Deliverables
10+
11+
- [ ] ...
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Question
3+
about: Please first ask on Gitter or StackOverflow before creating an issue
4+
---
5+
6+
This issue tracker is not the place for questions.
7+
If you want to ask how to do something, or to understand why
8+
something isn't working the way you expect it to, please use Gitter [1] or Stack Overflow [2].
9+
10+
[1] https://gitter.im/junit-team/junit5
11+
[2] https://stackoverflow.com/questions/tagged/junit5
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Overview
2+
3+
<!-- Please describe your changes here and list any open questions you might have. -->
4+
5+
---
6+
7+
I hereby agree to the terms of the [JUnit Contributor License Agreement](https://github.com/junit-team/junit5/blob/002a0052926ddee57cf90580fa49bc37e5a72427/CONTRIBUTING.md#junit-contributor-license-agreement).
8+
9+
---
10+
11+
### Definition of Done
12+
13+
- [ ] There are no TODOs left in the code
14+
- [ ] Method [preconditions](https://junit.org/junit5/docs/snapshot/api/org.junit.platform.commons/org/junit/platform/commons/util/Preconditions.html) are checked and documented in the method's Javadoc
15+
- [ ] [Coding conventions](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#coding-conventions) (e.g. for logging) have been followed
16+
- [ ] Change is covered by [automated tests](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#tests) including corner cases, errors, and exception handling
17+
- [ ] Public API has [Javadoc](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#javadoc) and [`@API` annotations](https://apiguardian-team.github.io/apiguardian/docs/current/api/org/apiguardian/api/API.html)
18+
- [ ] Change is documented in the [User Guide](https://junit.org/junit5/docs/snapshot/user-guide/) and [Release Notes](https://junit.org/junit5/docs/snapshot/user-guide/#release-notes)
19+
- [ ] All [continuous integration builds](https://github.com/junit-team/junit5#continuous-integration-builds) pass
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Main build
2+
description: Sets up JDKs and runs Gradle
3+
inputs:
4+
arguments:
5+
required: true
6+
description: Gradle arguments
7+
default: build
8+
runs:
9+
using: "composite"
10+
steps:
11+
- uses: ./.github/actions/setup-test-jdk
12+
- uses: ./.github/actions/run-gradle
13+
with:
14+
arguments: ${{ inputs.arguments }}
15+
- uses: actions/upload-artifact@v3
16+
if: ${{ always() }}
17+
with:
18+
name: Test Distribution trace files (${{ github.job }})
19+
path: '**/build/test-results/*/trace.json'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Run Gradle
2+
description: Sets up Gradle JDKs and runs Gradle
3+
inputs:
4+
arguments:
5+
required: true
6+
description: Gradle arguments
7+
default: build
8+
runs:
9+
using: "composite"
10+
steps:
11+
- uses: actions/setup-java@v3
12+
id: setup-gradle-jdk
13+
with:
14+
distribution: temurin
15+
java-version: 17
16+
- uses: gradle/gradle-build-action@v2
17+
env:
18+
JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
19+
with:
20+
arguments: |
21+
-Porg.gradle.java.installations.auto-download=false
22+
-PenablePredictiveTestSelection=${{ github.event_name == 'pull_request' }}
23+
"-Dscan.value.GitHub job=${{ github.job }}"
24+
javaToolchains
25+
${{ inputs.arguments }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Set up Test JDK
2+
description: Sets up the JDK required to run platform-tooling-support-tests
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: actions/setup-java@v3
7+
with:
8+
distribution: temurin
9+
java-version: 8
10+
- shell: bash
11+
run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
registries:
3+
gradle-plugin-portal:
4+
type: maven-repository
5+
url: https://plugins.gradle.org/m2
6+
username: dummy # Required by dependabot
7+
password: dummy # Required by dependabot
8+
updates:
9+
- package-ecosystem: "gradle"
10+
directory: "/"
11+
allow:
12+
- dependency-name: "com.gradle*"
13+
registries:
14+
- gradle-plugin-portal
15+
schedule:
16+
interval: "weekly"
17+
open-pull-requests-limit: 10
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
# Configuration options apply to both Issues and Pull Requests.
3+
# We configure those individually to match our workflow (see `pulls:` and `issues:`)
4+
5+
pulls:
6+
# Number of days of inactivity before a Pull Request becomes stale
7+
daysUntilStale: 60
8+
9+
# Number of days of inactivity before a Pull Request with the stale label is closed.
10+
# Set to false to disable. If disabled, Pull Request still need to be closed manually, but will remain marked as stale.
11+
daysUntilClose: 21
12+
13+
# Comment to post when marking as stale. Set to `false` to disable
14+
markComment: >
15+
This pull request has been automatically marked as stale because it has not had recent activity.
16+
Given the limited bandwidth of the team, it will be closed if no further activity occurs.
17+
If you intend to work on this pull request, please reopen the PR.
18+
Thank you for your contributions.
19+
# Comment to post when closing a stale Pull Request.
20+
closeComment: >
21+
This pull request has been automatically closed due to inactivity.
22+
If you are still interested in contributing this, please ensure that
23+
it is rebased against the latest branch (usually `main`), all review
24+
comments have been addressed and the build is passing.
25+
issues:
26+
daysUntilStale: 365
27+
28+
# Number of days of inactivity before an Issue with the stale label is closed.
29+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
30+
daysUntilClose: 21
31+
32+
# Comment to post when marking as stale. Set to `false` to disable
33+
markComment: >
34+
This issue has been automatically marked as stale because it has not had recent activity.
35+
Given the limited bandwidth of the team, it will be automatically closed if no further
36+
activity occurs.
37+
Thank you for your contribution.
38+
# Comment to post when closing a stale Issue.
39+
closeComment: >
40+
This issue has been automatically closed due to inactivity. If you have a good use case for this
41+
feature, please feel free to reopen the issue.
42+
43+
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
44+
#onlyLabels: []
45+
46+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
47+
exemptLabels: []
48+
49+
# Set to true to ignore issues in a project (defaults to false)
50+
exemptProjects: false
51+
52+
# Set to true to ignore issues in a milestone (defaults to false)
53+
exemptMilestones: false
54+
55+
# Set to true to ignore issues with an assignee (defaults to false)
56+
exemptAssignees: false
57+
58+
# Label to use when marking as stale
59+
staleLabel: "status: stale"
60+
61+
# Comment to post when removing the stale label.
62+
# unmarkComment: >
63+
# Your comment here.
64+
65+
# Limit the number of actions per hour, from 1-30. Default is 30
66+
limitPerRun: 30
67+
68+
# Limit to only `issues` or `pulls`
69+
# only: issues
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [main, releases/**]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [main, releases/**]
9+
schedule:
10+
- cron: '0 19 * * 3'
11+
12+
env:
13+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
14+
15+
jobs:
16+
analyze:
17+
name: Analyze
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language:
23+
- java
24+
- javascript
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v3
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v2
30+
with:
31+
languages: ${{ matrix.language }}
32+
tools: latest
33+
- name: Build
34+
uses: ./.github/actions/run-gradle
35+
with:
36+
arguments: |
37+
--no-build-cache
38+
-Dscan.tag.CodeQL
39+
allMainClasses
40+
- name: Perform CodeQL Analysis
41+
uses: github/codeql-action/analyze@v2
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Cross-Version
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/*'
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
env:
13+
ORG_GRADLE_PROJECT_enableTestDistribution: true
14+
ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }}
15+
ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }}
16+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
17+
18+
jobs:
19+
openjdk:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
jdk: [19, 20, 21]
24+
name: "OpenJDK ${{ matrix.jdk }}"
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Check out repository
28+
uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 1
31+
- name: Set up Test JDK
32+
uses: ./.github/actions/setup-test-jdk
33+
- name: 'Set up JDK ${{ matrix.jdk }}'
34+
uses: oracle-actions/setup-java@v1
35+
with:
36+
website: jdk.java.net
37+
release: ${{ matrix.jdk }}
38+
version: latest
39+
- name: 'Prepare JDK${{ matrix.jdk }} env var'
40+
shell: bash
41+
run: echo "JDK${{ matrix.jdk }}=$JAVA_HOME" >> $GITHUB_ENV
42+
- name: Build
43+
uses: ./.github/actions/run-gradle
44+
with:
45+
arguments: |
46+
-PjavaToolchainVersion=${{ matrix.jdk }}
47+
-Dscan.tag.JDK_${{ matrix.jdk }}
48+
build
49+
- name: Upload Test Distribution trace files
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: "Test Distribution trace files (OpenJDK ${{ matrix.jdk }})"
53+
path: '**/build/test-results/*/trace.json'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Validate Gradle Wrapper"
2+
on: [push, pull_request]
3+
4+
jobs:
5+
validation:
6+
name: "Validation"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out repository
10+
uses: actions/checkout@v3
11+
with:
12+
fetch-depth: 1
13+
- name: Validate Gradle wrapper
14+
uses: gradle/wrapper-validation-action@v1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Label new issues
2+
on:
3+
issues:
4+
types: ['opened']
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: Renato66/auto-label@69b3cbe79438b2079aed0a49474275d3e572cae5 # or v2
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}
12+
labels-synonyms: '{"3rd-party: Eclipse":["Eclipse"],"3rd-party: Gradle":["Gradle"],"3rd-party: IntelliJ IDEA":["IDEA","IntelliJ"],"3rd-party: Maven Surefire":["Failsafe","Maven","Surefire"],"3rd-party: Pioneer":["pioneer"],"component: Groovy":["Groovy"],"component: Test Kit":["Test Kit","TestKit"]}'
13+
labels-not-allowed: '["dependencies","status: blocked","status: declined","status: duplicate","status: in progress","status: invalid","status: stale","status: superseded","status: team discussion","status: waiting-for-feedback","status: waiting-for-interest","status: works-as-designed","up-for-grabs"]'
14+
default-labels: '["status: new"]'

0 commit comments

Comments
 (0)