GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - juraj67/SplayTree: Splay tree is a binary search tree with splay operation.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
splay_tree
splay_tree
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

SplayTree

Splay tree is a binary search tree with a Splay operation, that uses rotations. The Splay operation moves the element to the root of the tree after each search, insert and delete.

How to use it

Copy the package "splay_tree" into your project, import it and create new SplayTree object:

import splay_tree.*;

SplayTree<Integer> splayTree = new SplayTree<>();

Example

import splay_tree.*;
import java.util.LinkedList;

public class TestClass {
  public static void main(String[] args) {
    SplayTree<Integer> splayTree = new SplayTree<>();
    
    //insert 
    splayTree.insert(2);
    splayTree.insert(1);
    splayTree.insert(3);
    
    //find 
    System.out.println(splayTree.find(2)); //prints 2
    
    //delete 
    splayTree.delete(2); //removes 2 

    //inorder traversal
    LinkedList<Integer> linked = splayTree.inOrder();
    for(Integer i: linked) {
      System.out.println(i); //prints 1 and 3
    }
  }
}

Author

Juraj Pavlech, 2019

About

Splay tree is a binary search tree with splay operation.

Topics

algorithmsbinarybinary-search-treedata-structuresjavasplaysplay-treesplay-treestreetree-structuretrees

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.