extra-sorted-array

A sorted array is a collection of values, arranged in an order.

https://github.com/nodef/extra-sorted-array

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.4%) to scientific vocabulary

Keywords

array chunk clear compare count count-each cut cut-at cut-at-right cut-right deep-clone difference drop drop-right drop-while drop-while-right entries every extra sorted
Last synced: 4 months ago · JSON representation ·

Repository

A sorted array is a collection of values, arranged in an order.

Basic Info
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
array chunk clear compare count count-each cut cut-at cut-at-right cut-right deep-clone difference drop drop-right drop-while drop-while-right entries every extra sorted
Created over 5 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

A sorted array is a collection of values, arranged in an order.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs, 📘 Wiki.


This package includes comprehensive set of functions that operate on a sorted array with which you can search a value using binary search, merge multiple sorted arrays, or perform set operations upon it.

We use a consistent naming scheme that helps you quickly identify the functions you need. All functions except from*() take array as 1st parameter. Some functions operate on a specified range in the array and are called ranged*(), such as rangedMerge(). Functions like slice() are pure and do not modify the array itself, while functions like slice$() do modify (update) the array itself. Some functions accept a map function in addition to a compare function. Further, functions which return an iterable instead of an array are prefixed with i, such as isubsequences(). We borrow some names from other programming languages such as Haskell, Python, Java, and Processing.

With this package, you can simplify the implementation of complex algorithms, and be able to achieve your goals faster, regardless of your level of expertise. Try it out today and discover how it can transform your development experience! This package is available in Node.js and Web formats. To use it on the web, simply use the extra_sorted_array global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.


```javascript const xsortedArray = require('extra-sorted-array'); // import * as xsortedArray from "extra-sorted-array"; // import * as xsortedArray from "https://unpkg.com/extra-sorted-array/index.mjs"; (deno)

var x = [10, 20, 20, 40, 40, 80]; xsortedArray.searchValue(x, 40); // → 3

var x = [10, 20, 20, 40, 40, 80]; var y = [20, 50, 70]; xsortedArray.merge(x, y); // → [ 10, 20, 20, 20, 40, 40, 50, 70, 80 ]

var x = [10, 20, 20, 40, 40, 80]; var y = [20, 50, 70]; var z = [30, 60, 90]; xsortedArray.mergeAll([x, y, z]); // → [ 10, 20, 20, 20, 30, 40, 40, 50, 60, 70, 80, 90 ]

var x = [10, 20, 20, 40, 40, 80]; var y = [20, 50, 70]; xsortedArray.isDisjoint(x, y); // → false

var x = [10, 20, 20, 40, 40, 80]; var y = [20, 50, 80]; xsortedArray.intersection(x, y); // → [ 20, 80 ] ```



Index

| Property | Description | | ---- | ---- | | includes | Check if sorted array has a value using binary search. | | hasValue | Check if sorted array has a value using binary search. | | indexOf | Find first index of value using binary search. | | lastIndexOf | Find last index of value using binary search. | | searchValue | Find first index of value using binary search. | | searchValueRight | Find last index of a value using binary search. | | searchValueAny | Find any index of a value using binary search. | | searchClosestValue | Find index of closest value using binary search. | | | | | merge | Merge values from two sorted arrays. | | mergeAll | Merge values from sorted arrays. | | | | | isUnique | Examine if there are no duplicate values. | | isDisjoint | Examine if arrays have no value in common. | | unique | Remove duplicate values. | | union | Obtain values present in any sorted array. | | intersection | Obtain values present in both sorted arrays. | | difference | Obtain values not present in another sorted array. | | symmetricDifference | Obtain values present in either sorted array but not both. |



References




ORG Coverage Status Test Coverage <!-- DOI -->

Owner

  • Name: nodef
  • Login: nodef
  • Kind: organization

A summary of programs made with Node.js.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Sahu
    given-names: Subhajit
    orcid: https://orcid.org/0000-0001-5140-6578
title: "nodef/extra-sorted-array: A sorted array is a collection of values, arranged in an order"
version: 1.0.0
doi: 10.5281/zenodo.7919743
date-released: 2023-05-10

GitHub Events

Total
  • Issues event: 2
  • Issue comment event: 2
  • Push event: 3
Last Year
  • Issues event: 2
  • Issue comment event: 2
  • Push event: 3

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 23
  • Total Committers: 1
  • Avg Commits per committer: 23.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Subhajit Sahu w****7@g****m 23

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 4
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 2 months
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 3 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jnachtigall (1)
Pull Request Authors
  • dependabot[bot] (4)
Top Labels
Issue Labels
Pull Request Labels
dependencies (4)

Dependencies

package-lock.json npm
  • 103 dependencies
package.json npm
  • extra-build ^1.1.28 development