Data structures in kotlin that maintain order

Overview

Ordered Data Structures


I came from C++ and fell in love with kotlin. I used the C++ stdlib a lot. I have really been wanted to reach for map and unordered_map and set that I know and love from the std template library.

Kotlin has list, set, and map, and they all preserve the order of insertion. Which those are nice and do what you need most of the time, but I need data structures that maintain order. I also don't really like kotlin's map interface. iterators of the map convert the whole thing to a set and then iterate over the set.

Right now I have a tree interface I am much more happy with. It provides a collection, so it can be iterated over without being converted to a set. The only implementation is a basic unbalanced binary search tree that is not thread safe (so I have some work to do) . The next one I am going to work on is a red black tree. then I will make a tree that is a set, so no keys, just values. Then an ordered list. Actually I have already done an ordered list once. Kotlin stdlibrary already provides most of the implementation. I really confuses me why they didn't just make an ordered list collection. So I might do that one soon.

Install

Maybe later I will try hooking up jitpack, but for now. Just clone the repo. Build the library with gradle and then use gradle's publish to mavenlocal. Then in a project you want to consume the library with. Add MavenLocal() repo. And add a dependency on the library with
implementation("com.xingpeds.dataStructures:DataStructures:1.0-SNAPSHOT")

You might also like...
Use Android Data Binding wih Live Data to glue View Model and Android

Gruop-C Spliff Summary Use Android Data Binding wih Live Data to glue View Model and Android. Asynchronous communications implemented with KotlinX Cor

Small kotlin library for persisting _single instances_ of kotlin data classes
Small kotlin library for persisting _single instances_ of kotlin data classes

PerSista Small library for persisting single instances of kotlin data classes. NB: PerSista uses typeOf() internally which is marked as @ExperimentalS

DS-for-Kotlin - Some classic data sturctures write in kotlin for fun

DS-for-Kotlin Just write some classic data structure by kotlin during my leisure

Multi-thread ZX0 data compressor in Kotlin

ZX0-Kotlin ZX0-Kotlin is a multi-thread implementation of the ZX0 data compressor in Kotlin. Requirements To run this compressor, you must have instal

An AutoValue extension that generates binary and source compatible equivalent Kotlin data classes of AutoValue models.
An AutoValue extension that generates binary and source compatible equivalent Kotlin data classes of AutoValue models.

AutoValue Kotlin auto-value-kotlin (AVK) is an AutoValue extension that generates binary-and-source-compatible, equivalent Kotlin data classes. This i

FirestoreCleanArchitectureApp is an app built with Kotlin and Firestore that displays data in real-time using the MVVM Architecture Pattern. For the UI it uses Jetpack Compose,  Android's modern toolkit for building native UI.
FirestoreCleanArchitectureApp is an app built with Kotlin and Firestore that displays data in real-time using the MVVM Architecture Pattern. For the UI it uses Jetpack Compose, Android's modern toolkit for building native UI.

FirestoreCleanArchitectureApp FirestoreCleanArchitectureApp is an app built with Kotlin and Cloud Firestore that displays data in real-time using Andr

Solution code for Android Kotlin Fundamentals Codelab 8.1 Getting data from the internet

MarsRealEstateNetwork - Solution Code Solution code for Android Kotlin Fundamentals Codelab 8.1 Getting data from the internet Introduction MarsRealEs

KotlinForDS - An exploration of data science using Kotlin

Kotlin Jupyter Notebook An example notebook can be found here: https://mybinder.

Android Data Managment System Android UI - Kotlin- Firebase
Android Data Managment System Android UI - Kotlin- Firebase

DataManagmentSystem Data Managment System Android UI - Kotlin- Firebase Android Data Managment System App Design And Kotlin with Firebase The project

Owner
Kyle McBurnett
Software engineer
Kyle McBurnett
BindsAdapter is an Android library to help you create and maintain Adapter class easier via ksp( Kotlin Symbol Processing).

BindsAdapter BindsAdapter is an Android library to help you create and maintain Adapter class easier via ksp( Kotlin Symbol Processing). Installation

Jintin 5 Jul 30, 2022
This repo contains my solutions to some data structures and algorithms problems on leetcode.

DSA Playground This repository contains solutions to dsa problems in kotlin. NOTE: This file will get long, please consider using <Ctrl>F DSA With Kun

Hardik Sachan 2 Dec 9, 2021
Scaloid makes your Android code easy to understand and maintain.

Simpler Android Scaloid is a library that simplifies your Android code. It makes your code easy to understand and maintain by leveraging Scala languag

Sung-Ho Lee 2.1k Dec 27, 2022
A Kotlin library used to analyse discrete Markov chains, in order to generate plausible sequences

Markov Markov is a Kotlin library used to analyse discrete Markov chains, in order to generate plausible sequences. Using This project is still under

Xavier F. Gouchet 0 Nov 14, 2021
🔥The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.

??The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.

Rouse 1.3k Dec 30, 2022
Project created in order to handle account management

Account Service App Aplicação responsável em receber dados de uma conta, validá-los e retornar mensagem de sucesso ou erro. Tecnologias utilizadas - L

Rafael Alberto 0 Dec 14, 2021
The app contains an order flow for cupcakes with options for quantity, flavor, and pickup date

Cupcake app This app contains an order flow for cupcakes with options for quantity, flavor, and pickup date. The order details get displayed on an ord

null 0 Nov 13, 2021
An e-commerce app which provide a new platform to order food items from various restaurants

Food_App_Internshala An e-commerce app which provide a new platform to order food items from various restaurants. Splash and Login Page Opening of the

Partha Sarathi Sahu 0 Apr 26, 2022
Demo Spting REST Service on Kotlin. Works with PostgreSQL via Spring Data. Data initialization provided by liquibase

Spring Boot REST API with Kotlin Spring Boot REST API service. Spring Data with PostgreSQL. Data initialization with Liquibase. Swagger UI Reference D

null 0 Jun 10, 2022
Detailing about the data provided (Data Visualization Application)

Detailing about the data provided (Data Visualization Application): • In the application, the data provided in the CSV is used for the Scatter plot cr

Neha Sharma 0 Nov 20, 2021