-
Notifications
You must be signed in to change notification settings - Fork 0
Feedback #1
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
Open
github-classroom
wants to merge
91
commits into
feedback
Choose a base branch
from
main
base: feedback
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feedback #1
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
0de1819
Setting up GitHub Classroom Feedback
github-classroom[bot] 3cbfea0
first commit, add .gitignore, README.md, init Gradle
RoketFlame c008b4a
feat: add Deployment paragraph in README.md, add basic structure for …
RoketFlame 117df44
feat: add CONTRIBUTING.md
RoketFlame f7a83f8
fix: fix generics in interface Tree
RoketFlame d5751e5
fix: fix interface Node
RoketFlame f17f3b8
fix: add .idea files (trash)
RoketFlame fe3d134
feat: change generics in Tree, now it has more clear structure
RoketFlame 6898fb5
fix: change interface Tree, root in ABSTree is protected
RoketFlame 1ca3445
fix: fix compareTo for Node and BSNode
RoketFlame c7ee8b5
feat: add early BSTree
RoketFlame 86a611e
fix: delete .idea
RoketFlame 3749a5f
fix: add .idea to .gitignore
RoketFlame caa7bb2
feat: add fun get for BSTree
RoketFlame 064af09
feat: add filed parent for interface Node
RoketFlame c5c003b
fix: fix version of gradle
RoketFlame 0a84450
feat: add funs simpleDelete, getMinimal and getMaximal
RoketFlame b13cc6d
fix: change contains function to be compatible with simpleContains
RoketFlame 3a81f3d
feat: add copyright header for source files
RoketFlame 79de548
feat: add workflows for github, it has to check project build on crea…
RoketFlame e6f0ee6
fix: change platform for build and tests
RoketFlame 542a092
struct: change struct project for gradle building
RoketFlame a299c66
feat: init correct build project
RoketFlame 740e220
feat: add build directory
RoketFlame c0f3561
feat: init correct gradle project
RoketFlame c135272
fix: refactor fun get, now it uses simpleContains from ABSTree
RoketFlame b4e7919
fix: fix funs getMinimal nad getMaximal
RoketFlame 5a945fd
fix: huge refactoring of methods, now it are more simple and clear
RoketFlame ab537d2
fix: minor changes in the use of ABSTree functions
RoketFlame c5f45a3
feat: add conversion KeyValue to string
RoketFlame ac10c0b
feat: add functions rotateLeft and rotateRight
RoketFlame 4a5e5dc
fix: simple fix avoid null exception
RoketFlame 651e56e
fix: minor class BSTree initialization fix
RoketFlame d41ad0d
struct: split all files into files for each class/interface
RoketFlame 32aaf55
struct: add modules for trees and nodes
RoketFlame 5ebeade
refactor: sort funs in BSTree, rename fun "rebalance" to "balance"
RoketFlame 373a15f
feat(AVLNode): add AVLNode with methods "compareTo", "equals", "getKe…
Lesh79 97fc2ee
feat(AVLTree): add AVLTree implementing methods "balaceFactor", "upda…
Lesh79 669e0df
feat(AVLTree): add AVLTree implementing methods "balaceFactor", "upda…
Lesh79 ce39186
feat: add early RBTree and RBNode
77e56b0
Realized all types of trees (#10)
RoketFlame d1d875f
Merge remote-tracking branch 'origin/main' into dev-wokuparalyzed
a455232
feat: add early BSTreeTest
0480a42
fix: small fix BSTreeTest. Add list of random integers for test binar…
5fb1fda
feat: row commit, change struct of balance and refactor code
RoketFlame 42ba4a5
fix: fix adding already existing value
RoketFlame 2e29d1c
fix: hu-u-uge refactor, change access modifier most of the methods
RoketFlame 9650516
struct: move abstract class MyNode into Nodes folder
RoketFlame 47b17c8
fix: change private access modifier on internal
Lesh79 7de5e53
feat: add early AVLTreeTest
Lesh79 fab3467
fix: one of the invariants
Lesh79 a62958f
feat: add tests for all types of trees with InvariantTest
RoketFlame 45fd11a
feat: add tests for function "contains"
RoketFlame b209b00
fix: simple fix classes of nodes (data class now, add hashCode())
RoketFlame 3080f2f
fix: add information about value in tests when test failed
RoketFlame a85c0ae
fix: fix dependencies
RoketFlame 7310c8a
struct: restructure code (preparation for adding storage database)
RoketFlame 9d5ed2a
feat: add way to save trees to neo4j database
RoketFlame 1323217
fix:
RoketFlame 754cf9c
refactor: standardize the names of functions and fields in classes
RoketFlame 0c36518
feat:
RoketFlame a5afc9e
fix: fix github-actions.yml, set versions in settings.gradle.kts
RoketFlame 4094933
fix: fix settings.gradle.kts
RoketFlame efcb5dd
struct: move classes of trees in root
RoketFlame 020f46d
test: add test for deleting
RoketFlame 72742c9
test: add test for using KeyValue as data in node
RoketFlame acdd6ad
feat: add dependencies for jetbrains.compose
RoketFlame 83a6aeb
feat: add way to store trees with .json file
RoketFlame bca7503
feat: add a way to store trees in SQL database
RoketFlame 8d216c7
feat: add field typeOfTree in JsonRepository
RoketFlame 4f019e6
fix: fix AVLNode
RoketFlame 86ff2c0
feat: implement getNames for Neo4jRepo
RoketFlame 297ad58
feat: implement very early visualizer for trees
RoketFlame 05f8fa6
feat: update version of gradle, add building project on macOS and ubu…
RoketFlame 445c8fa
feat: update properties for gradle, prepare for restructure of project
RoketFlame 1c3d41a
struct: huge refactor, now project include lib (with trees and reposi…
RoketFlame 934d808
feat: add comments to code to `repository` part
RoketFlame 2b6eb36
feat: add comments to code to `trees` package
RoketFlame 17c8217
fix: update CI script
RoketFlame ead2d74
hotfix: update README
RoketFlame f25ab8a
feat: simplify work with JsonRepository, update dependencies
RoketFlame 868ae7a
feat: first version of App, so dirty code (sorry)
RoketFlame 32e3c97
feat: first version of App, so dirty code (sorry)
RoketFlame 2cb077d
feat: simplify some cast expressions
RoketFlame 9672f88
feat: add some checks for correct opening tree
RoketFlame 97f923f
feat: add a button to return to the home screen
RoketFlame c99838f
fix: fix name of text fields
RoketFlame f276c79
feat: update CONTRIBUTING.md, DOCS.md, LICENSE and README.md
RoketFlame 8d4c82d
feat: update README.md, add tips for using viewer
RoketFlame cf27697
fix: fix bug with empty key field
RoketFlame 0b7e482
fix: Change licence of stolen files
RoketFlame File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # | ||
| # https://help.github.com/articles/dealing-with-line-endings/ | ||
| # | ||
| # Linux start script should use lf | ||
| /gradlew text eol=lf | ||
|
|
||
| # These are Windows script files and should use crlf | ||
| *.bat text eol=crlf | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| version: 2 | ||
| mergeable: | ||
| - when: pull_request.*, pull_request_review.* | ||
| filter: | ||
| # ignore 'Feedback' PR | ||
| - do: payload | ||
| pull_request: | ||
| title: | ||
| must_exclude: | ||
| regex: ^Feedback$ | ||
| regex_flag: none | ||
| validate: | ||
| - do: description | ||
| no_empty: | ||
| enabled: true | ||
| message: "Description matter and should not be empty. Provide detail with **what** was changed, **why** it was changed, and **how** it was changed." | ||
| - do: approvals | ||
| min: | ||
| count: 1 | ||
| required: | ||
| assignees: true | ||
|
|
||
| - when: pull_request.opened | ||
| name: "Remind about contributing guidelines" | ||
| validate: [ ] | ||
| pass: | ||
| - do: comment | ||
| payload: | ||
| body: > | ||
| Thanks for creating a pull request! Please, check that your pull request meets the [CONTRIBUTING](./CONTRIBUTING.md) requirements. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Build CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - release | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| strategy: | ||
| matrix: | ||
| os: [ macos-latest, ubuntu-latest, windows-latest ] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| distribution: zulu | ||
| - name: Build & test with Gradle | ||
| uses: gradle/gradle-build-action@v2 | ||
| with: | ||
| arguments: build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| .gradle | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
| ### IntelliJ IDEA ### | ||
| .idea/modules.xml | ||
| .idea/jarRepositories.xml | ||
| .idea/compiler.xml | ||
| .idea/libraries/ | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
| out/ | ||
| !**/src/main/**/out/ | ||
| !**/src/test/**/out/ | ||
|
|
||
| ### Eclipse ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
| bin/ | ||
| !**/src/main/**/bin/ | ||
| !**/src/test/**/bin/ | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| ### Mac OS ### | ||
| .DS_Store | ||
| /.idea/.name | ||
| /.idea/gradle.xml | ||
| /.idea/kotlinc.xml | ||
| /.idea/misc.xml | ||
| /.idea/vcs.xml | ||
| /.idea/ | ||
|
|
||
| # Ignore Gradle build output directory | ||
| build | ||
| /app/build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Making edits | ||
|
|
||
| ## Basic Tips | ||
|
|
||
| 1. Don't use merge, only rebase (to keep a linear commit history) | ||
| 2. Do not change other people's branches unless absolutely necessary | ||
| 3. Recheck your commit history before creating a pull request | ||
| 4. **Check you're on the right branch**, never commit directly in main | ||
|
|
||
| ## Rules for adding commits | ||
|
|
||
| Commits are added according to conventional commits. Those | ||
| `<type>(<scope>): <body>`. | ||
|
|
||
| The `<type>` field must take one of these values: | ||
|
|
||
| * `feat` to add new functionality | ||
| * `fix` to fix a bug in the program | ||
| * `refactor` for code refactoring, such as renaming a variable | ||
| * `test` to add tests, refactor them | ||
| * `struct` for changes related to a change in the structure of the project (BUT NOT CODE), for example, changing | ||
| folder locations | ||
| * `ci` for various ci/cd tasks | ||
|
|
||
| The `<body>` field contains the gist of the changes in the present imperative in English without the dot in | ||
| at the end, the first word is a verb with a small letter. | ||
| Examples: | ||
|
|
||
| * Good: "feat: Add module for future BST implementations" | ||
| * Bad: "Added module for future BST implementations." | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Вся остальная документация на английском, почему здесь не так? |
||
| ## Rules for pull requests | ||
|
|
||
| **Forbidden** to merge your pull request into the branch yourself. | ||
|
|
||
| If you click on the green button, then **make sure** that it says `REBASE AND MERGE` | ||
|
|
||
| The review takes place in the form of comments to pull requests, discussions in the team chat and personal | ||
| communication. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| ## Getting started | ||
|
|
||
| To build the library run | ||
|
|
||
| ```bash | ||
| ./gradlew build | ||
| ``` | ||
|
|
||
| ## Using Trees | ||
|
|
||
| Any `Comparable` data can be stored in trees. | ||
| We also provide access to the `KeyValue` class, which allows you to store a key-value pair in the nodes of the tree. | ||
|
|
||
| ```kotlin | ||
| import lib.trees.AVLTree | ||
| import lib.trees.RBTree | ||
| import lib.trees.BSTree | ||
| import lib.trees.KeyValue | ||
|
|
||
| val alvTree = AVLTree<Int>() // instantiate empty AVL tree | ||
| val bsTree = BSTree<String>() // instantiate empty simple tree | ||
| val rbTree = RBTree<KeyValue<Int, String>>() // instantiate empty red-black tree with key-value | ||
| ``` | ||
|
|
||
| Each tree supports 3 basic operations: `add`, `contain`, `delete` and `get` (if you need to get value by key using | ||
| KeyValue) | ||
|
|
||
| ```kotlin | ||
| avlTree.add(42) | ||
| bsTree.add("42") | ||
| rbTree.add(KeyValue(42, "42")) | ||
| bsTree.contain("42") // returns true | ||
| avlTree.contain(1) // returns false | ||
| rbTree.get(KeyValue(42, null))?.getValue() // returns "42" | ||
| ``` | ||
|
|
||
| Trees' nodes can be read-only accessed by `root` property. | ||
|
|
||
| ```kotlin | ||
| avlTree.add(10) | ||
| avlTree.add(5) | ||
| avlTree.add(20) | ||
| avlTree.add(30) | ||
| avlTree.add(42) | ||
| // avlTree after balancing: | ||
| // 10 | ||
| // ┌─────────┴─────────┐ | ||
| // 5 30 | ||
| // ┌──┴──┐ | ||
| // 20 42 | ||
|
|
||
| avlTree.root?.data // 10 | ||
| avlTree.root?.left?.data // 5 | ||
| avlTree.root?.right?.data // 30 | ||
| avlTree.root?.right?.right?.data // 42 | ||
| avlTree.root?.right?.left?.data // 20 | ||
| ``` | ||
|
|
||
| ## Storing Trees | ||
|
|
||
| `teemEight` provides `JsonRepository`, `SqlRepository` and `Neo4jRepository` to save & load trees. | ||
|
|
||
| Each instance of repository is used to store exactly 1 tree type. To store different tree types several repositories can | ||
| be instantiated. | ||
| Repository must be provided with `Serialization` which describes how to serialize & deserialize any particular | ||
| type of tree. | ||
|
|
||
| `bstrees` is shipped with `AVLStrategy`, `RBStrategy` and `SimpleStrategy` to serialize & deserialize AVL trees, | ||
| Red-black trees and Simple BSTs respectively. As these strategies don't know anything about the data type stored in | ||
| trees' nodes, user must provide `serializeData` and `deserializeData` functions to them. | ||
|
|
||
| Different tree types can be stored in the same database (directory) by creating several repositories and passing them | ||
| same databases (directory paths). | ||
|
|
||
| ### Using Neo4j | ||
|
|
||
| Before using this, you must have [Docker](https://www.docker.com/) (also see [docs](https://docs.docker.com/)) | ||
|
|
||
| #### Before started | ||
|
|
||
| 1. Run docker container with `docker-compose.yml` | ||
| 2. Open http://localhost:7474 | ||
| 3. Create new user (default password: neo4j) | ||
| 4. Change the password | ||
| 5. You got this | ||
|
|
||
| #### Example | ||
|
|
||
| ```kotlin | ||
| val username = "neo4j" | ||
| val password = "" // insert password to database here | ||
| val conf = Configuration.Builder() | ||
| .uri("bolt://localhost") | ||
| .credentials(username, password) | ||
| .build() | ||
|
|
||
| fun serializeInt(data: Int) = SerializableValue(data.toString()) | ||
|
|
||
| fun deserializeInt(data: SerializableValue) = data.value.toInt() | ||
|
|
||
| val avlRepo = Neo4jRepo(AVLStrategy(::serializeInt, ::deserializeInt), conf) | ||
|
|
||
|
|
||
| val tree = AVLTree<Int>() | ||
| val randomizer = Random(42) | ||
| val lst = List(15) { randomizer.nextInt(1000) } | ||
| lst.forEach { tree.add(it) } | ||
| avlRepo.save("test", tree) | ||
| val testTree = avlRepo.loadByName("test") | ||
| println(testTree.preOrder()) // output pre-order traversal of tree | ||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. В доках обязательно нужно добавить раздел с приложением. |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не говорите что НЕ нужно делать, лучше предоставьте примерный пайплайн человеку, который хочет контрибьютить. Можно сказать, что вы используете Github Flow, поэтому все изменения принимаются через ПР'ы, расскажите о возможных требованиях к названию ветки из мастера. Если новый код требует тестов, нужно ли добавить тесты, если изменилось API, нужно ли обновить документацию? Попросите человека проверить, что его код удовлетворяет принятому в проекте codestyle и приложите ссылку, если таковой имеется.