Kotlin Algorithms and Design Patterns

Overview

Алгоритмы на Kotlin

Kotlin Algorithms and Design Patterns

This repository lists the most common algorithms, data structures, and design patterns written in the Kotlin programming language.

All code is divided into separate packages:

  1. sorting - sorting algorithms
  2. search - search algorithms
  3. structures - data structure (lists, arrays, stack, queue, binary trees, e.t.c)
  4. design-patterns - design patterns
  5. other - other algorithms (Levenshtein distance, Knut Morris Pratt algorithm, e.t.c)

For each code file, tests are made, which are located in the test/kotlin directory

Also, whenever possible, I add javadoc for each class, method, and file

Content:

  1. package design_patterns - design patterns

  2. package structures - data structure

  3. package sorting - sorting algorithms

  4. package search - search algorithms

  5. package other - other algorithms

Your wishes and ideas

If you are interested in my repository or you have ideas on how to improve it or add something, then let me know in telegram:

You might also like...
Demonstration of Object Pool Design Pattern using Kotlin language and Coroutine
Demonstration of Object Pool Design Pattern using Kotlin language and Coroutine

Object Pool Design Pattern with Kotlin Demonstration of Thread Safe Object Pool Design Pattern using Kotlin language and Coroutine. Abstract The objec

AbstractFactoryDesignPatternWithKotlin - Abstract Factory Design Pattern With Kotlin
AbstractFactoryDesignPatternWithKotlin - Abstract Factory Design Pattern With Kotlin

AbstractFactoryDesignPatternWithKotlin Abstract Factory Design Pattern With Kotl

AbstractFactoryDesignPatternWithKotlin - Abstract Factory Design Pattern With Kotlin
AbstractFactoryDesignPatternWithKotlin - Abstract Factory Design Pattern With Kotlin

AbstractFactoryDesignPatternWithKotlin Abstract Factory Design Pattern With Kotl

Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any type of design pattern

What is Kotlin Extension Function ? Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any ty

A simple demo project based on MVVM clean architecture and material design & animations.
A simple demo project based on MVVM clean architecture and material design & animations.

GithubFollows A simple demo project based on MVVM clean architecture and material design & animations. Architecture Specs & Open-source libraries Mini

 🗡️ Deddit demonstrates modern Android development with Hilt, Coroutines, Flow, Jetpack, and Material Design based on MVVM architecture
🗡️ Deddit demonstrates modern Android development with Hilt, Coroutines, Flow, Jetpack, and Material Design based on MVVM architecture

Deddit demonstrates modern Android development with Hilt, Coroutines, Flow, Jetpack (ViewModel,Paging3), and Material Design based on MVVM

Quiz Zone is a simple ✅ Quiz Android application 📱 using Firbase Firestore Database and Material Design.
Quiz Zone is a simple ✅ Quiz Android application 📱 using Firbase Firestore Database and Material Design.

Quiz Zone Quiz Zone is a simple ✅ Quiz Android application 📱 using Firbase Firestore Database and Material Design. You can Install and test Quiz Zone

A tool to model and analyze the design of systems from .class files
A tool to model and analyze the design of systems from .class files

sift A tool to model and analyze the design of systems from java class files. Features CLI tool for building, querying and diff-ing "system models" fr

New style for app design Online Sunglasses Shop App UI made in Jetpack Compose.😉😎
New style for app design Online Sunglasses Shop App UI made in Jetpack Compose.😉😎

JetSunglassUI-Android New style for app design Online Sunglasses Shop App UI made in Jetpack Compose. 😉 😎 (Navigation Components, Dagger-Hilt, Mater

Comments
  • Naive factorial implementation

    Naive factorial implementation

    The current implementation of factorial has two problems:

    1. It demonstrates literally nothing except the factorial's definition. To be meaningful it should contain some optimizations like prime factorization.
    2. It uses Int, hence it is correct only in [ 0 .. 12 ] range. image Even using ULong will allow values only from 0 to 20 inclusively, so only long arithmetic can have any practical value because for standard integer types the optimal algorithm is just to access array:
    val factorials: ULongArray = ulongArrayOf(1uL, 1uL, 2uL ...)
    
    opened by CommanderTvis 6
  • Palindrome algorithm

    Palindrome algorithm

    https://github.com/KiberneticWorm/Kotlin-Algorithms-and-Design-Patterns/blob/master/src/main/kotlin/other/Palindrome.kt I don't think this is an algorithm.

    opened by yamin8000 1
  • observers must be declared as set

    observers must be declared as set

    private val observers = mutableListOf() // in this line use of mutableSetOf is needed

    override fun observe(observer: Observer) { observers.add(observer)//'cause you can add same observer many times }

    opened by RubberBigPepper 1
  • sortAlgo -> sortInPlace

    sortAlgo -> sortInPlace

    https://github.com/KiberneticWorm/Kotlin-Algorithms-and-Design-Patterns/blob/b96f19350f2d70a159eb3310acd31697a73d0ac9/src/main/kotlin/en/sorting/SortAlgo.kt#L10

    it would be be better to call it sortInPlace.

    opened by altavir 1
Owner
Dmitry
Android developer, Java/Kotlin coder, author, blogger and just a good person
Dmitry
Algorithms and data structures in Kotlin.

Here you can find the most common algorithms and data structures written in Kotlin. The goal of this project is to create the most eloquent implementa

Boris Maslakov 805 Dec 26, 2022
Collection of various algorithms in mathematics, computer science etc implemented in Kotlin for educational purposes.

The Kotlin Algorithms Implementation of different algorithms and data structures using Kotlin lang Overview The repository is a collection of open-sou

Oleksii Shtanko 9 Aug 1, 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
Bring together all of the remarkable Computer Graphics Algorithms in one place 🚀

Compose Computer Graphics Playground ?? "There was an idea to bring together all of the remarkable Computer Graphics Algorithms in one place. And keep

Jaseemakhtar 162 Dec 27, 2022
Kotlin Example of how to organize your code using MVC and some patterns seen in class

Kotlin Example of how to organize your code using MVC and some patterns seen in class

José Luis González Sánchez 3 Mar 23, 2022
A project to learn about Reactive Microservices experimenting with architectures and patterns

reactive-microservices-workshop Copyright © 2021 Aleix Morgadas - Licenced under CC BY-SA 4.0 A project to learn about Reactive Microservices experime

Aleix Morgadas 7 Feb 21, 2022
This project explores the saga architecture for two patterns. The Choreograhy and the Orchestration

Newscast Explorer Technologies used Introduction In this project are going to explore a known EIP known as Saga. A saga is in its essence, a way to de

João Filipe Sabino Esperancinha 2 Dec 15, 2022
TheMovies 🎬 A demo project for The Movie DB based on Kotlin MVVM architecture and material design & animations.

A simple project for The Movie DB based on Kotlin MVVM clean architecture and material design & animations. How to build on your environment

Jaewoong Eum 420 Nov 29, 2022
Spring Boot Example with Kotlin and Domain Driven Design

Spring Boot Kotlin Domain Driven Design Example Just an example project where ddd is implemented with some other great patterns and architecture from

Fernando Guevara Sanchez 16 Jun 29, 2022
DesignLogin-Register - Design Login and Register With Kotlin

Diseños de Login en XML En esta ocasión vengo a presentar diseños de inicio de s

Paul Guillen Acuña 0 Apr 21, 2022