Coder Social home page Coder Social logo

sularome / typescript-algorithms-and-data-structures Goto Github PK

View Code? Open in Web Editor NEW
32.0 5.0 10.0 825 KB

Useful algorithms and Data structures written in TypeScript.

License: MIT License

TypeScript 100.00%
algorithms data-structrues typescript javascript

typescript-algorithms-and-data-structures's Introduction

TypeScript algorithms and data structures

Useful algorithms and Data structures written in typescript.

Build Status Code Climate Test Coverage Issue Count

typescript-algorithms-and-data-structures's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

typescript-algorithms-and-data-structures's Issues

Getting RangeError: Column index is incorrect. when using BitMatrix.getIndexes(true)

I am trying to use the getIndexes function of BitMatrix where the number of rows > number of columns. When calling getIndexes(true) the function fails with the error RangeError: Column index is incorrect.

Is it required that the dimensions of the BitMatrix be equal?

I ran the test below (based on exiting test that verifies getIndexes(true) and reproduced the error.

    it("be able to get set bits per column when column count < row count", function () {
        const bm = new BitMatrix(100, 10);
        bm.set(2, 1, true);
        bm.set(3, 10, true);
        expect(bm.getIndexes(true)[0]).toEqual([]);
        expect(bm.getIndexes(true)[1]).toEqual([2]);
        expect(bm.getIndexes(true)[10]).toEqual([3]);
        bm.set(4, 9, true);
        expect(bm.getIndexes(true)[0]).toEqual([]);
        expect(bm.getIndexes(true)[1]).toEqual([2]);
        expect(bm.getIndexes(true)[9]).toEqual([4]);
        expect(bm.getIndexes(true)[10]).toEqual([3]);
        bm.set(4, 9, false);
        expect(bm.getIndexes(true)[0]).toEqual([]);
        expect(bm.getIndexes(true)[1]).toEqual([2]);
        expect(bm.getIndexes(true)[9]).toEqual([]);
        expect(bm.getIndexes(true)[10]).toEqual([3]);
    });

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.