Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
cca981b
Setting up GitHub Classroom Feedback
github-classroom[bot] Mar 21, 2023
878d075
feat: added .gitignore, license and pull request template
tepa46 Mar 26, 2023
5814e3d
Merge pull request #2 from spbu-coding-2022/developing
tepa46 Mar 26, 2023
eb597c1
feat: init build system gradle
tepa46 Mar 26, 2023
b3c07a1
Merge pull request #3 from spbu-coding-2022/developing
tepa46 Mar 26, 2023
be022f7
feat: Added trees architecture
tepa46 Mar 26, 2023
4df4b06
Merge pull request #4 from spbu-coding-2022/developing
tepa46 Mar 26, 2023
422d4e0
feat: updateHeight function is implemented
LeonidElkin Mar 26, 2023
c54a2e6
feat: find function is implemented
LeonidElkin Mar 26, 2023
7651f79
fix: codestyle in the Node class
LeonidElkin Mar 26, 2023
6810c11
Merge pull request #5 from spbu-coding-2022/AbstractTree
LeonidElkin Mar 26, 2023
5854aca
fix: Changed type of node. It can't be null now
LeonidElkin Mar 26, 2023
ad90bd5
Merge pull request #7 from spbu-coding-2022/AbstractTree
LeonidElkin Mar 26, 2023
7caf5ee
feat: Added left rotate
LeonidElkin Mar 26, 2023
0a9523c
feat: Added right rotate
LeonidElkin Mar 26, 2023
5dca011
feat: Added auxiliary function balance factor
LeonidElkin Mar 26, 2023
70c9e60
Merge pull request #8 from spbu-coding-2022/balancer
LeonidElkin Mar 26, 2023
6cc17bf
feat: Added TREE_TYPE in BTree abstract class
tepa46 Mar 26, 2023
d3c2ffc
Merge pull request #9 from spbu-coding-2022/AbstractTree
tepa46 Mar 26, 2023
9873b12
fix: Added generics to balancer due to changes in BTree
LeonidElkin Mar 26, 2023
299070e
fix: Changed tree access modifier from private to protected
LeonidElkin Mar 27, 2023
f7f7630
Merge pull request #10 from spbu-coding-2022/Balancer
LeonidElkin Mar 27, 2023
b6f26d1
feat: BSBalancer is implemented
LeonidElkin Mar 27, 2023
a4d3e20
fix: Codestyle
LeonidElkin Mar 27, 2023
3a616f4
fix: Added last line
LeonidElkin Mar 27, 2023
2b8afe4
Merge pull request #11 from spbu-coding-2022/BSBalancer
LeonidElkin Mar 27, 2023
c03f962
fix: Fixed a bug in rightRotate
tepa46 Mar 27, 2023
3254920
fix: Changed NODE_TYPE to nullable type
LeonidElkin Apr 3, 2023
566f431
Merge pull request #13 from spbu-coding-2022/AbstractTree
LeonidElkin Apr 3, 2023
3daf43c
fix: Changing Balancers constructors and a small fix in leftRotate, r…
tepa46 Apr 6, 2023
ca5a9da
feat: Added tests for Balancer class
tepa46 Apr 6, 2023
39e52ea
Merge pull request #14 from spbu-coding-2022/Balancer
tepa46 Apr 6, 2023
d6b41ca
feat: Changing the architecture.
tepa46 Apr 6, 2023
cad6529
feat: Added implementation of the 'add' method in RBTree
tepa46 Apr 6, 2023
5aebc83
fix: leftRotate and rightRotate methods have been rewritten
tepa46 Apr 9, 2023
156e902
feat: added balance implementation for RBTree
tepa46 Apr 9, 2023
2e97568
feat: Implemented the TreesInvariants class to check all types of tre…
tepa46 Apr 9, 2023
297a5cd
feat: Added the "insert" function
LeonidElkin Apr 10, 2023
a75f9b7
feat: Added the "delete" function. Added the "size" field to Node to …
LeonidElkin Apr 10, 2023
112dc31
Merge pull request #15 from spbu-coding-2022/BSTree_newArchitecture
tepa46 Apr 10, 2023
1baac84
Merge pull request #16 from spbu-coding-2022/changing_the_architecture
LeonidElkin Apr 10, 2023
78eca03
feat: added implementation of the "delete" method
tepa46 Apr 11, 2023
9cd57c1
feat: AvlBalancer is implemented
LeonidElkin Apr 10, 2023
369703f
feat: insert function is implemented
LeonidElkin Apr 10, 2023
fec8091
feat: delete function is implemented
LeonidElkin Apr 11, 2023
f360d79
feat: Code comments were added and code refactoring was performed
tepa46 Apr 11, 2023
cb1be6c
Merge pull request #19 from spbu-coding-2022/RBTree_on_the_new_archit…
tepa46 Apr 11, 2023
e851984
feat: Added mergeable file
tepa46 Apr 15, 2023
7ade6da
feat: Added CI file
tepa46 Apr 15, 2023
b62e9e5
fix: Some fixes in mergeable file
tepa46 Apr 15, 2023
c41a41f
fix: CI file moved to the correct directory
tepa46 Apr 15, 2023
f59a905
Merge pull request #20 from spbu-coding-2022/git_settings
tepa46 Apr 16, 2023
44a5a92
fix: Fixed the path to the jar file
tepa46 Apr 16, 2023
00f3a38
Merge pull request #21 from spbu-coding-2022/git_settings
tepa46 Apr 16, 2023
2470aad
feat: Added new tests for RBTree
tepa46 Apr 16, 2023
445ce51
Merge pull request #22 from spbu-coding-2022/RBTree_test
tepa46 Apr 16, 2023
1e0343f
feat: The invariants of the AVL and BS trees can now be tested using …
LeonidElkin Apr 16, 2023
0241de4
feat: Added insert tests for BSTree
LeonidElkin Apr 16, 2023
7d7b647
feat: Added find and deleting tests for BSTree
LeonidElkin Apr 18, 2023
4ad44d8
feat: Added AvlTests
LeonidElkin Apr 18, 2023
172ed55
fix: BSTree parent updating is fixed, recursive bug in TreeInvariants…
LeonidElkin Apr 18, 2023
878fc22
fix: BSTree size update
LeonidElkin Apr 18, 2023
499d1e5
fix: AvlTree add and delete bugs with parents and some misspells
LeonidElkin Apr 18, 2023
4ba0b56
feat: Added some tests
LeonidElkin Apr 18, 2023
aa5d4da
fix: All "!!" have been replaced with safer designs
tepa46 Apr 18, 2023
8296351
feat: Added some comments
LeonidElkin Apr 18, 2023
c0234d7
Merge pull request #23 from spbu-coding-2022/BS&AVLTreeTests
LeonidElkin Apr 18, 2023
d1abf3a
fix: Unnecessary information is pushed out from Node to AvlNode and B…
LeonidElkin Apr 18, 2023
02c5065
Merge pull request #24 from spbu-coding-2022/Refactoring
LeonidElkin Apr 18, 2023
da3329b
feat: Added the ability to store AVLTree in SQLite
tepa46 Apr 18, 2023
3958446
fix: The files have been moved to the correct directory
tepa46 Apr 18, 2023
d2c3889
Merge pull request #25 from spbu-coding-2022/RBTree
LeonidElkin Apr 18, 2023
8456c11
Merge pull request #26 from spbu-coding-2022/bd-sqllite
LeonidElkin Apr 18, 2023
76dd979
feat: New implementation of tree storage in sql
tepa46 Apr 19, 2023
bdc49df
fix: Removed the extra part of the code
tepa46 Apr 19, 2023
cf5bfec
Create README.md
tepa46 Apr 19, 2023
05b540d
fix: Added creation of tables in the getTree method
tepa46 Apr 19, 2023
21009a6
Merge pull request #27 from spbu-coding-2022/bd-sql-v2
tepa46 Apr 19, 2023
92a5be5
fix: Fixed a bug with adding equal keys. Fixed the test which checks it
LeonidElkin Apr 19, 2023
1fabfec
Merge pull request #28 from spbu-coding-2022/bugFix
LeonidElkin Apr 19, 2023
1396e09
feat: added a parameterized test
LeonidElkin Apr 19, 2023
517d82f
Merge pull request #29 from spbu-coding-2022/test
tepa46 Apr 19, 2023
9b0fdb4
fix: a small correction of the placement of brackets
tepa46 Apr 19, 2023
d1e34e9
feat: Added project build check on 3 types of os
tepa46 Apr 20, 2023
e66609a
fix: Fixed infinite recursion when saving and taking from the databas…
tepa46 Apr 20, 2023
a01a7a9
Merge pull request #30 from spbu-coding-2022/RBTree-test
tepa46 Apr 20, 2023
cfc7549
Merge pull request #31 from spbu-coding-2022/bd-sql-v2
tepa46 Apr 20, 2023
f08bf5b
feat: Added Jacoco code coverage report
tepa46 Apr 22, 2023
ff0b711
fix: Fixed Jacoco code coverage report file
tepa46 Apr 22, 2023
316e356
feat: Added gradle.properties file
tepa46 Apr 23, 2023
c68c107
Merge pull request #32 from spbu-coding-2022/git-settings
tepa46 Apr 23, 2023
bdcce72
feat: Added tree repository interface
tepa46 Apr 23, 2023
364b0d0
feat: Added Json tree repository implementation
tepa46 Apr 23, 2023
bfe5ce4
fix: Files have been moved to the desired directory
tepa46 Apr 23, 2023
742741a
fix: Removed an unnecessary field in the SerializableNode class
tepa46 Apr 23, 2023
77b86d7
fix: The signature of the deleteTree method has been changed
tepa46 Apr 23, 2023
7139d92
fix: Fixed a bug closing a non-existent file
tepa46 Apr 23, 2023
ccba1ff
Merge pull request #33 from spbu-coding-2022/bd-json
tepa46 Apr 23, 2023
424c1f5
fix: Big changes in privacy of variables, classes and functions. Chan…
LeonidElkin Apr 24, 2023
57a0a2d
feat: Added a lot of comments to abstract classes and to AVL classes
LeonidElkin Apr 24, 2023
2c57bf4
feat: Added Neo4jTreeRepo implementation and renamed some variables
tepa46 Apr 24, 2023
e5faceb
Merge pull request #34 from spbu-coding-2022/bd-neo4j
tepa46 Apr 24, 2023
f84201e
feat: Added logging of databases
tepa46 Apr 24, 2023
25262e6
feat: Added config files for neo4j
tepa46 Apr 24, 2023
fabc86c
feat: DB files added to .gitignore
tepa46 Apr 24, 2023
becf0ef
feat: db objects -> db classes. Database configuration is done using …
tepa46 Apr 24, 2023
4396f2b
fix: Fixed a typo in BSTreeUtil
tepa46 Apr 24, 2023
a3e91e7
fix: Fixed a bug in Json when writing trees with the same names
tepa46 Apr 24, 2023
c55626a
feat: Added a lot of comments to RBTree
LeonidElkin Apr 24, 2023
34ec394
fix: changed the name of the project
LeonidElkin Apr 24, 2023
53a52b8
fix: CI fixed due to the latest changes
LeonidElkin Apr 24, 2023
12726ad
Merge branch 'codeRefactoring'
LeonidElkin Apr 24, 2023
7c8eb7f
fix: Resolved merge conflict
LeonidElkin Apr 24, 2023
1f3c18a
feat: a small refactoring of build.gradle
tepa46 Apr 24, 2023
5513510
feat: Added dbConfig.properties file
tepa46 Apr 24, 2023
051cf0e
Merge branch 'logging' into db-config
tepa46 Apr 24, 2023
6b6ee4b
Merge branch 'db-config'
tepa46 Apr 25, 2023
92c7b97
fix: Added PathsUtil and dbConfig.properties
tepa46 Apr 25, 2023
73208f9
Delete extra directory
tepa46 Apr 25, 2023
33b9e5a
Merge pull request #37 from spbu-coding-2022/bugfix
tepa46 Apr 25, 2023
463c489
feat: Added new database class constructor
tepa46 Apr 25, 2023
a2463b0
Merge pull request #38 from spbu-coding-2022/db-config
tepa46 Apr 25, 2023
d6a946a
feat: Preparing repository for ui. Implemented BsStrategy
LeonidElkin Apr 25, 2023
546cbf4
feat: All strategies were implemented
LeonidElkin Apr 26, 2023
21b8ac4
Merge branch 'main' into strategyImplementation
LeonidElkin Apr 26, 2023
470ce49
fix: Resolved merge conflict
LeonidElkin Apr 26, 2023
5129675
Merge pull request #39 from spbu-coding-2022/strategyImplementation
LeonidElkin Apr 26, 2023
9843e26
feat: UI implementing is started. The sketch is ready in a very raw form
LeonidElkin Apr 28, 2023
13b1493
feat: Tree and Node view is implemented in a very raw form
LeonidElkin Apr 28, 2023
3204ae6
feat: Added support for node coordinates to work with UI
tepa46 Apr 26, 2023
2bac120
feat: Added DataBasePresenter and TreePresenter implementation
tepa46 Apr 30, 2023
38263bf
feat: Changed Tree view. Added Json support
LeonidElkin Apr 30, 2023
0abdd1a
feat: Improved navigation. Added animation :). Changed NodeView. Drop…
LeonidElkin Apr 30, 2023
785137f
feat: Added keyType and valueType storage in databases
tepa46 Apr 30, 2023
8464935
fix: Github actions JDK version was updated
LeonidElkin May 1, 2023
ccd9222
feat: CI set up JDK 17
tepa46 May 1, 2023
ad9cdba
Merge pull request #40 from spbu-coding-2022/composeImplementation
LeonidElkin May 1, 2023
6a340b1
Merge branch 'main' into trees-arrangement
tepa46 May 1, 2023
2415e54
fix: Added the necessary parameters to the treePresenter.createTree()…
tepa46 May 1, 2023
9053aa6
Merge pull request #41 from spbu-coding-2022/trees-arrangement
tepa46 May 1, 2023
d91f676
fix: Added ChosingTypesScreen
LeonidElkin May 1, 2023
20c1046
feat: Added the ability to add and delete a node from SerializableTree
tepa46 May 1, 2023
bf77f09
fix: Fixed the error of searching and deleting the tree in Neo4j.
tepa46 May 1, 2023
da5d5f0
feat: Added new comments to the RBTree code
tepa46 May 1, 2023
2b0360c
fix: TreesInvariants is divided into several parts: AVLTreeInvariants…
tepa46 May 1, 2023
228dd5b
fix: @ValueSource replaced with @MethodSource for parameterized tests
tepa46 May 1, 2023
8019e53
feat: Added a test checking that the tree is balanced and contains al…
tepa46 May 1, 2023
4a5f08c
Merge pull request #42 from spbu-coding-2022/fixup
tepa46 May 1, 2023
c7b123a
Merge branch 'main' into composeImplementation
LeonidElkin May 1, 2023
72cfdfd
Merge pull request #43 from spbu-coding-2022/composeImplementation
LeonidElkin May 1, 2023
b5e31ad
Merge pull request #44 from spbu-coding-2022/ui-presenter
tepa46 May 1, 2023
7d2b08e
feat: Now the test coverage is considered only for model trees
tepa46 May 1, 2023
5bf27b8
Merge pull request #45 from spbu-coding-2022/build.gradle
tepa46 May 1, 2023
cf989f2
fix: GUI moved to the app directory
tepa46 May 1, 2023
8347c78
Merge pull request #46 from spbu-coding-2022/GUI-refactor
tepa46 May 1, 2023
638a24b
feat: Added LayoutPresenter implementation
tepa46 May 1, 2023
89e1afc
Merge pull request #47 from spbu-coding-2022/Presenter-layout
tepa46 May 1, 2023
679bc87
feat: Added a new treeToDataConverter and made some structural changes
tepa46 May 2, 2023
b01a426
Merge pull request #48 from spbu-coding-2022/presenter-string-converter
tepa46 May 2, 2023
c10747a
fix: The names of some model files have been changed
tepa46 May 2, 2023
3d5fa3a
feat: Added tests for the database and converters
tepa46 May 2, 2023
84db1c5
Merge pull request #49 from spbu-coding-2022/model-refactoring
tepa46 May 2, 2023
ccb6e38
fix: Small changes in the code before starting work on tree output
tepa46 May 2, 2023
6ed6571
feat: UI add node implementation
tepa46 May 2, 2023
9e9959e
feat: UI delete node implementation
tepa46 May 2, 2023
6580b64
fix: Updating `key` and `value` to the default value before adding an…
tepa46 May 2, 2023
22c3117
feat: Fixed app size added
tepa46 May 2, 2023
77b53a0
feat: Added tree saving to the database
tepa46 May 2, 2023
d2b6de4
feat: Added the first version of the tree with moving vertices
tepa46 May 2, 2023
40831eb
feat: Now the screen with the tree can be moved
tepa46 May 2, 2023
af8d375
Updated README
LeonidElkin May 2, 2023
61de148
feat: Added an adequate mapping for small graphs
tepa46 May 2, 2023
d0f13a6
fix: A lot of appearance changes
LeonidElkin May 2, 2023
16e1e67
Merge pull request #50 from spbu-coding-2022/screen-change
LeonidElkin May 2, 2023
52b1b2c
feat: Small code refactoring
tepa46 May 2, 2023
f1d6669
fix: Some appearance changes. Added enum classes for databases names …
LeonidElkin May 2, 2023
28db694
fix: Changed directories
LeonidElkin May 2, 2023
9bb834c
fix: Renamed files
LeonidElkin May 2, 2023
915b0aa
feat: Added an algorithm for drawing a tree
tepa46 May 2, 2023
8cea258
Merge pull request #51 from spbu-coding-2022/ui-tree-layout
LeonidElkin May 2, 2023
0dde14d
Update README.md
tepa46 May 2, 2023
12b651e
feat: Added a coordinate check that allows you not to move the node b…
tepa46 May 4, 2023
e1bf258
feat: Added tree display with coordinates from the database when opening
tepa46 May 4, 2023
e9aac73
fix: Fixed a tree saving bug in Neo4j
tepa46 May 4, 2023
4a20ea5
fix: Another small fix for saving the tree in neo4j
tepa46 May 4, 2023
78d27e0
Merge pull request #52 from spbu-coding-2022/ui-layout
tepa46 May 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
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

14 changes: 14 additions & 0 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
mergeable:
- when: pull_request.*, pull_request_review.*
validate:
- do: description
no_empty:
enabled: true
message: "Description should not be empty."

- do: approvals
min:
count: 1
required:
assignees: true
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Title (hint)

Describe what you've changed or added in terms of functionality.

For example:

> Added the `update` function to RBTree

> Fixed an error updating the left subtree

## Description

Fixes ...

Add more info _if needed_:
* context/purpose for implementing changes
* detailed description of the changes made

## How to test

### Automated tests

Please specify the _automated tests_ for your code changes: you should either mention the existing tests or add the new ones.

### Manual tests

If it is impossible to provide the automated tests, please reason why. Usually, it is relevant only for UI- or documentation-related PRs.
If this is your case, share the detailed _manual scenarios_ that help to verify your changes.

## Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

- [ ] PR **title** and **description** are clear and intelligible.
- [ ] I've added enough **comments** to my code, particularly in hard-to-understand areas.
- [ ] The functionality I've repaired, changed or added is covered with **automated tests**.
- [ ] **Manual tests** have been provided optionally.
45 changes: 45 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run build project

on:
push:
jobs:
build-gradle-project:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]

steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: zulu

- name: Checkout project sources
uses: actions/checkout@v3

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run build with Gradle Wrapper
run: ./gradlew build

- name: Upload lib jar
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: BSTrees lib
path: lib/build/libs/lib.jar

- if: matrix.os == 'ubuntu-latest'
name: Run Test Coverage
run: ./gradlew jacocoTestReport

- if: matrix.os == 'ubuntu-latest'
name: Jacoco Code Coverage Report
uses: cicirello/jacoco-badge-generator@v2.8.0
with:
generate-branches-badge: true
jacoco-csv-file: lib/build/jacoco/jacocoCsv
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Gradle #
.gradle

# Compiled Class Files #
build/
.idea
*.class

# Log Files #
*.log

# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
*.jar
!gradle-wrapper.jar

# Out Package #
/out/

# MacOS #
*.DS_Store
.AppleDouble

# db files
*.json
*/SQLTrees
3 changes: 3 additions & 0 deletions CONTAINER.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONTAINER_NAME=neo4j-db
PASSWORD="qwertyui"
EXAMPLE_DIR="/example"
201 changes: 201 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 2 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Trees-6
Copyright 2023 Kirill Shishin, Leonid Elkin, Rostislav Borisov
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# trees-6
`BSTrees` is a library that allows you to use 3 types of binary search trees: randomized BSTree, AVLTree, RBTree.

## How to use

To build the library run
```bash
./gradlew build
```
To create each of the tree views, you can use:
```kotlin
val rbTree = RBTree<Int, Int>() // instantiate empty red-black tree
val avlTree = AvlTree<Int, String>() // instantiate empty AVL tree
val bsTree = BSTree<String, Int>() // instantiate empty simple tree
```
The first type parameter is a comparable key. \
The second type parameter is a stored value. It can be anything

Each tree supports 3 basic operations: `insert`, `find`, `delete`.
```kotlin
val bsTree = BSTree<String, Int>()

bsTree.insert("bruh", 5)
bsTree.find("bruh") // 5
bsTree.delete("bruh")
```

## Storing BSTs
You can store any tree in any of the three databases presented. These are `Neo4j`, `SQLite` and `Json`. You can choose the types of key and value on wich the tree is built, but supported only string and int if you want to store it

To use `Neo4j`, you need to install the desktop application `Doсker`, open it and perform `neo4j_up.sh` with with the necessary configurations, which are in the `CONTAINER.conf` file

# User Interface

You can interact with the trees directly using the provided user interface. It allows you to choose the database, the types of keys and values on which the tree is built, as well as save and unload trees from databases. Again, you can create and load any trees to any data bases.



## License
Distributed under the Apache 2.0 License. See [LICENSE](https://github.com/spbu-coding-2022/trees-6/blob/main/LICENSE) for more information.
Loading