GithubHelp home page GithubHelp logo

treeset's Introduction

Treeset

TreeSetLearning

This project provides examples of using TreeSet in Java with different scenarios.

Description

The project demonstrates the usage of TreeSet and its various methods for storing and retrieving elements in sorted order. It includes examples of using TreeSet with built-in classes, user-defined classes implementing Comparable interface, and user-defined classes with a custom Comparator.

Usage

The project includes the following classes:

  • Person: A user-defined class implementing the Comparable interface. It represents a person with a name and an ID.
  • Student: A user-defined class representing a student with a name and an ID.
  • NameComparator: A custom Comparator implementation for sorting Student objects based on their names.
  • TreeSetLearning: The main class that demonstrates the usage of TreeSet and its methods.

To run the project:

  1. Clone the repository.
  2. Open the project in your preferred Java IDE.
  3. Run the TreeSetLearning class.

Features

The project showcases the following features:

  • Creating and adding elements to a TreeSet of built-in classes (Integer).
  • Using TreeSet methods such as ceiling, descendingSet, and descendingIterator.
  • Creating and adding elements to a TreeSet of user-defined class (Person) that implements the Comparable interface.
  • Creating and adding elements to a TreeSet of user-defined class (Student) using a custom Comparator (NameComparator).

Contributions

Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

treeset's People

Contributors

pavanreddy0604 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.