Code Monkey home page Code Monkey logo

algo-js's People

Contributors

scotv avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

jbpextra

algo-js's Issues

the lable of vertex should apply some rules for representing different meanings

From Algo.js of Google Code on July 31, 2013 14:10:40

What steps will reproduce the problem?

  1. we label vertex using index of itself by default
  2. we may mark vertex as -1 when we visited it
  3. however, we can not mark vertex as -1 when we push it into stack during dfs
  4. we have to mark v as 'v' for visited, mark it as 'm' for marked

Please use labels and text to provide additional information.
try to find a better way to represent different meanings from different labels.

enumeration, 'v' | 'm' ..., or just some numbers, like below?
-1 for initial status, unmarked, unvisited;
0 for marked (has been in a stack)
1, 2, 3... for visited order

Original issue: http://code.google.com/p/algo-js/issues/detail?id=8

Dijkstra test failed after converting to ES 6

rev b206841

1) graph algorithm dijkstra on graph:

      AssertionError: expected Array [ 0, 28, 27, 7, 44, 96, 107, 4, 47, 58, 39, 124, 39, 38, 48 ] to equal Array [ 0, 22, 27, 7, 23, 11, 17, 4, 31, 36, 23, 35, 23, 38, 42 ] (at '1', A has 28 and B has 22)
      + expected - actual

       [
         0
      -  28
      +  22
         4
      -  47
      -  58
      -  39
      -  124
      -  39
      +  31
      +  36
      +  23
      +  35
      +  23
         38
      -  48
      +  42
         27
         7
      -  44
      -  96
      -  107
      +  23
      +  11
      +  17
       ]

      at Assertion.fail (node_modules/should/lib/assertion.js:92:17)
      at Assertion.Object.defineProperty.value (node_modules/should/lib/assertion.js:164:19)
      at Context.<anonymous> (test/q.js:28:94)

error should be thrown from where it occurs, instead of being constructed in constructor

From Algo.js of Google Code on August 09, 2013 14:47:54

What steps will reproduce the problem?

  1. in graph, or stack type...
  2. we create an instance of some errors in constructor
  3. we throw error instance from other code What is the expected output?

What do you see instead?
it is expected to see a correct error stack, instead of an error stack including just constructor address

Please use labels and text to provide additional information.
try to use const string for error message, instead of error instance.

Original issue: http://code.google.com/p/algo-js/issues/detail?id=15

potential out of range in WeightedQuickUnion

From Algo.js of Google Code on September 28, 2013 17:47:29

What steps will reproduce the problem?

  1. we create a union(n) which has an id array with index from 0 to n-1 (inclusive)
  2. we use it in our Kruskal MST algorithm, where the index of vertex we pass into the union is from 1 ton (inclusive)

What is the expected output? What do you see instead?
How it still works, without any out of index range error?

Please use labels and text to provide additional information.
run following codes may get some answers:

var find = new union(10);
find.union(3, 10);
find._id.length;
find._id[10];

Original issue: http://code.google.com/p/algo-js/issues/detail?id=19

graph properties should distinguish the number of vertex and the number of the valid vertex

From Algo.js of Google Code on July 31, 2013 14:01:15

What steps will reproduce the problem?

  1. we increase graph.v as number of vertex during pushing edge into graph,
  2. however, we may never increase the number to match the last vertex (sink vertex), since there is no edge from that vertex
  3. so, in topological sorting, we may label the sink vertex using a number which is less than the actual number of vertex

Please provide any additional information below.
we need two properties for n, the number of vertex, and for the number of valid vertex, which maybe mean how many vertex we haven't visited.

Original issue: http://code.google.com/p/algo-js/issues/detail?id=7

bad performance of merge sort

From Algo.js of Google Code on July 15, 2013 10:14:07

What steps will reproduce the problem?

  1. merge sort an array containing 100000 elements
  2. sort seems to be very slow What is the expected output?

What do you see instead?
merge sort should be finished in less than five seconds, at least.
no output after one minute.

What version of the product are you using? On what operating system?
it doesn't matter.

Please provide any additional information below.
nothing else.

Original issue: http://code.google.com/p/algo-js/issues/detail?id=1

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.