CSCI H343 Data Structures Fall 2025

Segment Intersection (Part 2, AVL)

[Note] This is a group project. Students may work in groups of 3 ~ 4 people, or by themselves. After completion, every group member submits their solutions on Autograder individually.

Before We Start (Optional)

Description

Last week you completed a Binary Search Tree class to execute the line sweep algorithm.

This week you will write an AVL tree class to achieve the desired $n \log n$ time complexity, thanks to keeping the tree balanced.

Your task is to complete the implementation of the AVLTree class. ⚠️You are NOT supposed to modify any code outside the class (marked as “read-only” in the project structure below). Implement all of the methods marked TODO according to their descriptions in the comments. DO NOT change their function signatures.

Submission

As usual, this project contains a programming part and a testing part. You are expected to test your code locally as you develop the program.

You will submit both the code you wrote last week and this week together to the autograder, so that you have access to any helper methods you may have written in BinarySearchTree.java

.
├── SegmentIntersection.iml
├── src
│   ├── AVLTree.java             // your code
│   ├── BinarySearchTree.java    // your code
│   ├── Constants.java
│   ├── Driver.java
│   ├── GUI.java
│   ├── LineSegment.java
│   ├── Node.java
│   ├── OrderedSet.java
│   └── Sweeper.java
└── test
    └── StudentTest.java         // your tests

Troubleshooting

Here are a few common issues and things to remember as you complete the project 🙂