8000 GitHub - Israel77/Bisect: Array bisection algorithm for Dart. Translated from Python's bisect library. · GitHub
[go: up one dir, main page]

Skip to content
Israel77Public

About

Array bisection algorithm for Dart. Translated from Python's bisect library.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Array bisection algorithm for Dart.

Simple array bisection algorithm translated from Python's default library and implemented as extension methods for the class.

These methods are used to insert an element in a sorted list, without needing to sort it again.

Usage

A simple usage example:

import 'package:bisect/bisect.dart';

main() {
  final sortedList = [1, 3, 4, 6, 8, 23, 75];

  // Get the index where to insert an element
  final index = sortedList.bisect(7);
  print(index); // 4

  // Inserts an element to the list while keeping sorting
  sortedList.insort(7);
  print(sortedList); // [1, 3, 4, 6, 7, 8, 23, 75]

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

Array bisection algorithm for Dart. Translated from Python's bisect library.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0