Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions avl-tree/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# <img src="https://raw.githubusercontent.com/bobocode-projects/resources/master/image/logo_transparent_background.png" height=50/>AVL tree exercise :muscle:
Improve your TDD skill implementing AVL tree

### Task
**AVL tree** is a self-balancing binary search tree. You job is to implement the interface `AVLTree`
by practicing TDD discipline

### Pre-conditions :heavy_exclamation_mark:
You're supposed to know [The Three laws of TDD](https://github.com/bobocode-projects/tdd-exercises#the-three-laws-of-tdd),
be familiar with Java, TDD, AVL tree, and recursion

### How to start :question:
* Just clone the repository and start implementing `AVLTree` interface following *three laws of TDD*
* If you don't have enough knowladge about this domain, check out the [links below](#related-materials-information_source)
* Don't worry if you got stuck, checkout the [exercise/completed](https://github.com/bobocode-projects/tdd-exercises/tree/exercise/completed/avl-tree) branch and see the final implementation

### Related materials :information_source:
* [Як виробити звичку писати тести? (Bobocode channel <img src="https://raw.githubusercontent.com/bobocode-projects/resources/master/image/logo_transparent_background.png" height=20/>)](https://youtu.be/L_CiX9C51BI)
* [AVL tree](https://en.wikipedia.org/wiki/AVL_tree)
* [The Three Laws of TDD](https://www.youtube.com/watch?v=qkblc5WRn-U&t=3476s)

15 changes: 15 additions & 0 deletions avl-tree/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>tdd-exercises</artifactId>
<groupId>com.bobocode</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>avl-tree</artifactId>


</project>
12 changes: 12 additions & 0 deletions avl-tree/src/main/java/com/bobocode/avl/AVLTree.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.bobocode.avl;

/**
* AVL tree should have an API that allow provides the following functionality:
* - insert an element and return true if it was inserted successfully
* - search an element and return true it element exists
* - get tree size
* - get tree height
* - perform in-order traversal by passing element @{@link java.util.function.Consumer} as a parameter
*/
public interface AVLTree {
}
8 changes: 8 additions & 0 deletions avl-tree/src/test/java/com/bobocode/avl/AVLTreeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.bobocode.avl;

import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class AVLTreeTest {
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<module>stack</module>
<module>linked-list</module>
<module>avl-tree</module>
<module>avl-tree</module>
</modules>

<properties>
Expand Down