Skip to content

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
wants to merge 89 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
8772eb9
Setting up GitHub Classroom Feedback
github-classroom[bot] Mar 23, 2023
41eff22
docs: Added license file.
gryaznovasoffshore Mar 29, 2023
c0550ad
docs: Changed copyright contributors.
gryaznovasoffshore Mar 30, 2023
3c3a394
docs: Added README file.
gryaznovasoffshore Apr 3, 2023
f0d0ee2
docs: Added CONTRIBUTING file.
gryaznovasoffshore Apr 3, 2023
5865654
docs: Deleted JUnit-Installation block in README.
gryaznovasoffshore Apr 5, 2023
395f5be
struct: Added .gitignore for filtering files.
Arsene-Baitenov Apr 4, 2023
993bd8c
feat: Inited build tool Gradle.
Arsene-Baitenov Apr 4, 2023
a87b195
ci: Added script for GitHub Actions.
Arsene-Baitenov Apr 4, 2023
484844a
feat: Added forgotten gradle-wrapper.jar
Arsene-Baitenov Apr 4, 2023
6f3764b
feat: Added interface describing bst functions.
Arsene-Baitenov Apr 11, 2023
7ec522c
feat: Added class that implements bst interface.
Arsene-Baitenov Apr 11, 2023
3d96795
feat: Added search operation.
Arsene-Baitenov Apr 11, 2023
4721843
feat: Added delete and add operations.
Arsene-Baitenov Apr 11, 2023
079c25f
feat: Added initializing and extension functions for BST.
Arsene-Baitenov Apr 11, 2023
f97bb39
test: Added tests for put function.
Arsene-Baitenov Apr 11, 2023
6a93179
feat: Added iterator and set operation.
Arsene-Baitenov Apr 16, 2023
2a06776
fix: Deleted extension functions for BST.
Arsene-Baitenov Apr 16, 2023
4572a67
test: Changed test for put function.
Arsene-Baitenov Apr 16, 2023
ee8c6d7
test: Added test for iterator exceptions.
Arsene-Baitenov Apr 16, 2023
914e6ce
test: Added tests for get, remove and clear functions.
Arsene-Baitenov Apr 16, 2023
6cc95a4
fix: Added increment/decrement of size in put/remove functions, chang…
Arsene-Baitenov Apr 18, 2023
af174f6
test: Added size checks.
Arsene-Baitenov Apr 18, 2023
ce87a54
test: Added another test for remove operation.
Arsene-Baitenov Apr 18, 2023
6f79357
feat: Added interface describing rbt functions.
Arsene-Baitenov Apr 18, 2023
c0c9cbb
feat: Added abstract class that implements bst interface and iterator.
Arsene-Baitenov Apr 18, 2023
717a4db
feat: Added search(get), delete(remove) and add(set, put) operations.
Arsene-Baitenov Apr 18, 2023
09bf28d
feat: Added initializing functions for RBT.
Arsene-Baitenov Apr 18, 2023
847918f
fix: Changed receiving of leaf for deletion.
Arsene-Baitenov Apr 18, 2023
fbeee00
test: Added tests for RBT.
Arsene-Baitenov Apr 18, 2023
c87f546
fix: Fixed orientation bug in leaf removal function.
Arsene-Baitenov Apr 18, 2023
a0f69fa
test: Added another test for remove operation.
Arsene-Baitenov Apr 18, 2023
c9fbb63
test: Changed invariant checker in root removal test.
Arsene-Baitenov Apr 18, 2023
6ad0691
struct: Files removed due to architecture change.
Arsene-Baitenov Apr 24, 2023
d1e71ad
fix: Vertex interfaces moved to a separate file.
Arsene-Baitenov Apr 24, 2023
06f1e41
feat: Added simple BST implementation.
Arsene-Baitenov Apr 24, 2023
4c9845b
test: Added tests for simple BST.
Arsene-Baitenov Apr 24, 2023
fc0b804
feat: Added RBT implementation.
Arsene-Baitenov Apr 24, 2023
e426e79
test: Added tests for RBT.
Arsene-Baitenov Apr 24, 2023
780e9d4
feat: Added initializing functions for BST interface.
Arsene-Baitenov Apr 24, 2023
1a9855c
fix: Changed RBT size getter visibility modifier to protected.
Arsene-Baitenov Apr 28, 2023
5872711
feat: Added a dependencies to use org.neo4j.ogm.
Arsene-Baitenov Apr 28, 2023
919c1b1
feat: Added a dependency for SLF4J providers.
Arsene-Baitenov Apr 28, 2023
e7ce16f
feat: Added Compose file with neo4j for Docker Compose.
Arsene-Baitenov Apr 28, 2023
04cdd65
feat: Added RBT repository to save RBT to neo4j database.
Arsene-Baitenov Apr 28, 2023
2bb8908
refactor: Renamed RBT repository class.
Arsene-Baitenov Apr 29, 2023
3c03266
fix: Changed BST size getter visibility modifier to protected.
Arsene-Baitenov Apr 28, 2023
066be9a
feat: Added a dependency to use kotlinx.serialization.
Arsene-Baitenov Apr 28, 2023
34af52d
feat: Added BST repository to save BST to flat files.
Arsene-Baitenov Apr 28, 2023
5aa174c
Merge branch 'main' into feat/rbt-database
Arsene-Baitenov Apr 30, 2023
0e5c53b
Merge pull request #9 from spbu-coding-2022/feat/rbt-database
Arsene-Baitenov Apr 30, 2023
e9f1750
refactor: Renamed RBT repository implementation file.
Arsene-Baitenov Apr 30, 2023
78096b1
refactor: Renamed RBT and BST checkers implementation files.
Arsene-Baitenov Apr 30, 2023
6fa3828
test: Added exclusion from Jacoco Report
Arsene-Baitenov Apr 30, 2023
6394415
ci: Added mergeable.yml file for pull requests.
gryaznovasoffshore Apr 30, 2023
169a585
fix: Deleted invalid rule for title.
gryaznovasoffshore Apr 30, 2023
7f51195
fix: Added ignore rule for feedback.
gryaznovasoffshore Apr 30, 2023
21b226a
Updated logo in README.md file.
gryaznovasoffshore May 1, 2023
aa97ab0
docs: Updated -Getting Started- block.
gryaznovasoffshore May 2, 2023
b904f48
docs: Updated -App Usage- block.
gryaznovasoffshore May 2, 2023
c4deb82
docs: Added start window to -App Usage- block.
gryaznovasoffshore May 2, 2023
a1947e5
docs: Changed start window size in -App Usage- block.
gryaznovasoffshore May 2, 2023
af1c202
docs: Added main draw window to -App Usage- block.
gryaznovasoffshore May 2, 2023
3e5996c
feat: Added AVL-Vertex class.
gryaznovasoffshore May 2, 2023
df26d30
feat: Developed tests for AVL-Tree.
gryaznovasoffshore May 2, 2023
7dc6ca4
feat: Developed AVL-Tree model.
gryaznovasoffshore May 2, 2023
636887d
feat: Added AVL-InvariantChecker for tests.
gryaznovasoffshore May 2, 2023
c7f5ece
fix: Refactored AVL-Tree & tests.
gryaznovasoffshore May 2, 2023
680419b
fix: Fixed avl-tree architecture.
gryaznovasoffshore Jun 4, 2023
c324664
fix: Fixed AVLTreeTest issue.
gryaznovasoffshore Jun 4, 2023
2f6fba5
feat: Added dependencies for using Jetpack Compose.
Arsene-Baitenov May 1, 2023
07614b8
feat: Added function for drawing main window.
Arsene-Baitenov May 1, 2023
a34329b
feat: Added edge view.
Arsene-Baitenov May 2, 2023
212f353
feat: Added vertex view.
Arsene-Baitenov May 2, 2023
84dfb14
feat: Added ScrollDelta for detecting scroll.
Arsene-Baitenov May 2, 2023
9332f3b
feat: Added Position that stores the coordinates of the vertex.
Arsene-Baitenov May 2, 2023
83d03f7
feat: Added file with the constants.
Arsene-Baitenov May 2, 2023
1db2235
feat: Added tree view.
Arsene-Baitenov May 2, 2023
8dd3aa4
fix: Changed app logo.
Arsene-Baitenov May 2, 2023
e8b4e83
feat: Added MainWindow that draws editor.
Arsene-Baitenov May 2, 2023
1adc59b
feat: Added logotype-zone in main-draw window.
gryaznovasoffshore May 2, 2023
8c7fc6f
feat: Changed default text styles.
Arsene-Baitenov May 2, 2023
543bb93
fix: Removed debug output to console.
Arsene-Baitenov May 2, 2023
cce7ef5
feat: Added Position and ScrollDelta serialization and deserializatio…
Arsene-Baitenov May 2, 2023
a64df3c
feat: Added wrapper on the tree repositories for working with the db.
Arsene-Baitenov May 2, 2023
5affca4
fix: Fixed minor flaws.
gryaznovasoffshore May 2, 2023
156de3b
fix: Centralized required vertex.
gryaznovasoffshore May 2, 2023
8cf2191
feat: Added tree selection window.
Arsene-Baitenov May 2, 2023
005a826
fix: Fixed bug with drag of vertex and mistake of vertex text output.
Arsene-Baitenov Jun 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

29 changes: 29 additions & 0 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
mergeable:
- when: pull_request.*, pull_request_review.*
filter:
- do: payload
pull_request:
title:
must_exclude:
regex: ^Feedback$
regex_flag: none
validate:
- do: title
no_empty:
enabled: true
message: "The title should not be empty."
begins_with:
match: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
message: "The name must begin with a capital letter."

- do: description
no_empty:
enabled: true
message: "The description should not be empty."

- do: approvals
min:
count: 1
required:
assignees: true
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test with coverage
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: current
gradle-home-cache-cleanup: true
- name: Run test
run: |
./gradlew clean
./gradlew test
- name: JaCoCo Coverage Report
env:
report_path: BinarySearchTrees/build/jacoco/report.csv
run: |
awk -F"," '{ instructions += $4 + $5; covered += $5; branches += $6 + $7; branches_covered +=$7 } END { print "Instructions covered:", covered"/"instructions, "--", 100*covered/instructions"%"; print "Branches covered:", branches_covered"/"branches, "--", 100*branches_covered/branches"%" }' $report_path
- uses: actions/upload-artifact@v3
with:
name: binarysearchtree-test-and-coverage-reports
path: |
BinarySearchTrees/build/reports
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# Out Package #
/out/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.idea
44 changes: 44 additions & 0 deletions BinarySearchTrees/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id("org.jetbrains.kotlin.jvm") version "1.8.10"
jacoco
}

repositories {
mavenCentral()
}

dependencies {
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

testImplementation(platform("org.junit:junit-bom:5.9.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
}

tasks.test {
finalizedBy("jacocoTestReport")
useJUnitPlatform()
maxHeapSize = "2G"
testLogging {
events("passed", "skipped", "failed")
}
reports.html.outputLocation.set(file("${buildDir}/reports/test"))
}

tasks.named<JacocoReport>("jacocoTestReport") {
dependsOn(tasks.test)

classDirectories.setFrom(files(classDirectories.files.map {
fileTree(it) {
exclude("**/binarysearchtrees/TreesKt.*")
}
}))

reports {
xml.required.set(false)
html.required.set(true)
html.outputLocation.set(file("${buildDir}/reports/jacoco"))
csv.required.set(true)
csv.outputLocation.set(file("${buildDir}/jacoco/report.csv"))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package binarysearchtrees

interface BinarySearchTree<K : Comparable<K>, V> {
val size: Int

fun isEmpty(): Boolean

fun clear()

fun getRoot(): MutableVertex<K, V>?

operator fun get(key: K): V?

fun put(key: K, value: V): V?

operator fun set(key: K, value: V)

fun remove(key: K): V?

fun remove(key: K, value: V): Boolean

operator fun iterator(): Iterator<MutableVertex<K, V>>
}
19 changes: 19 additions & 0 deletions BinarySearchTrees/src/main/kotlin/binarysearchtrees/Trees.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package binarysearchtrees

import binarysearchtrees.redblacktree.RedBlackTree

// initializing functions

fun <K : Comparable<K>, V> binarySearchTreeOf(): BinarySearchTree<K, V> {
return RedBlackTree<K, V>()
}

fun <K : Comparable<K>, V> binarySearchTreeOf(
vararg args: Pair<K, V>
): BinarySearchTree<K, V> {
val tree = RedBlackTree<K, V>()
for (it in args) {
tree.put(it.first, it.second)
}
return tree
}
Comment on lines +7 to +19

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему при вызове binarySearchTreeOf() возвращается экземпляр RedBlackTree?

16 changes: 16 additions & 0 deletions BinarySearchTrees/src/main/kotlin/binarysearchtrees/Vertices.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package binarysearchtrees

//for extension functions like all, any, ...
interface Vertex<K, V> {
val key: K
val value: V
val left: Vertex<K, V>?
val right: Vertex<K, V>?
}

interface MutableVertex<K, V> : Vertex<K, V> {
override val left: MutableVertex<K, V>?
override val right: MutableVertex<K, V>?

fun setValue(newValue: V): V
}
Loading