Giter VIP home page Giter VIP logo

visualization-tool'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  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  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  avatar  avatar

Watchers

 avatar  avatar  avatar

visualization-tool's Issues

Rabin-Karp fails to find matches with base constants other than 1

As seen here, the Rabin-Karp algorithm erroneously skips over matches when the base constant is set to a number other than one. See the image for an example (a match occurs in the last sequence but is skipped due to differing obtained hashes):

image

As seen in the side view, the last hash calculation appears to be incorrect. Assuming a = 0, b = 1, c = 2 when base = 17, one can easily verify that cba has a hash of 2 * 289 + 1 * 17 + 0 * 1 = 595, which is dramatically different from either 27763 or 30083 as seen in the picture.

Interestingly, the algorithm works properly when a base constant of 1 is set.

ArrayDeque

Doesn't resize after reaching maximum capacity - sure implementation is similar to the Queue Array one :octocat:

ClosedHash: getEmptyIndex() may loop endlessly

To reproduce (there are probably simpler ways):

  1. set CLOSED_HASH_TABLE_SIZE = 7
  2. activate Hash Strings
  3. insert A
  4. insert H (same hash code as A)
  5. insert O (same hash code as A)
  6. delete A
  7. delete H
  8. insert H

At this point, getEmptyIndex() enters into an endless loop.

Moveover, I observed confusions between empty and deleted cells in the explanations given by ExplainLabel, also in this method.

Skip Back in Array Queues

Using "Skip Back" button in Array-backed queues messes stuff up. Reproducible by enqueueing [0,1,2], skip back * 2, then enqueueing 1:

image

Max-Heap Sorted Incorrectly for BuildHeap

When BuildHeap Max-Heap is selected for Heaps/PQs, only some swaps are made correctly. Seems that sometimes it is working as a max heap and other times as a min heap. Has happened with more than one input list.

License

What license do the source code here and the resulting visualizations fall under? Would it be compatible with CC BY-SA 3.0? I'm wondering if it would be okay to reuse the visualizations on Wikipedia. Apparently the David Galles visualization tool code is licensed under FreeBSD.

HashMap (Probing) doesn't handle delete flags correctly

Setup: Add 1, add 30, delete 1

Reproduce: Add 30

Expect: Adding 30 should check the delete flag, store it, then continue to the next index and see the duplicate 30

Actual: 30 gets added as soon as it sees the delete flag

KMP: highlight active failure table entry

An key feature of the KMP algorithm is the consultation of f[k] on encountering a mismatch following one or more matches, where f is the failure table and k is the last-matched index into the pattern. This is not currently visualized, and the role of f[k] in advancing the pattern is not obvious.

I implemented such a visualization in #110.

BST Levelorder Traversal

First of all, thanks for a great tool for visualizing data structures. It is very helpful to solidify the concepts.

When creating a Binary Search Tree with data 15,2,26,1,9,19,30,7,12,17,20,22, performing a Levelorder Traversal correctly visits the nodes. However, when the entire traversal is completed, the sequence of visited nodes displayed in the bottom left corner of the canvas is not retained.

The other traversal types do retain the returned sequence correctly so it can be viewed after completion.

LSDRadix Sort - Step Back Missing Buckets

Hello, I'm having issues skipping back using the LSD radix sort. I tried to add the data: 100, 10, 1. I paused the animation, but I couldn't step back to the beginning. The linked lists did not appear when stepping back. To reproduce this issue, you may add whatever data you please. Once you allow the first iteration of LSD to complete and the data from the buckets are placed back into the array, you are unable to put the data back into the buckets when stepping back. I thank all the TAs who worked on the visualization tool. It has been beneficial to my peers and me.

Search in HashMap (Probing) gives up on deleted entries

To reproduce:

  1. Insert two elements that hash to the same entry.
  2. Delete the first.
  3. Find the second.

It is not found.

Fix: In ClosedHash.js, in getElemIndex(index, elem), remove || this.deleted[candidateIndex] from the else if condition.

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.