diff --git a/animations/doubly_lists/insert/index.html b/animations/doubly_lists/insert/index.html new file mode 100644 index 0000000..f6df6c1 --- /dev/null +++ b/animations/doubly_lists/insert/index.html @@ -0,0 +1,24 @@ + + +
+ +This animation shows the insert operation in Doubly-Linked List. Click the "next step" button to run the animation. Note: in this animation, we will insert a new node containing the value 15 following the node containing the value 1.
+ + + + + + + + + + + + + diff --git a/animations/doubly_lists/insert/insert.js b/animations/doubly_lists/insert/insert.js new file mode 100644 index 0000000..7352aac --- /dev/null +++ b/animations/doubly_lists/insert/insert.js @@ -0,0 +1,408 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows the remove operation in Doubly-Linked List. Click the "next step" button to run the animation. Note: in this animation, we will remove a node containing the value 1, and we have a pointer p points to this node.
+ + + + + + + + + + + + + diff --git a/animations/doubly_lists/remove/remove.js b/animations/doubly_lists/remove/remove.js new file mode 100644 index 0000000..120b7a2 --- /dev/null +++ b/animations/doubly_lists/remove/remove.js @@ -0,0 +1,383 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 1. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/dynamic_memory/example2/example2.js b/animations/dynamic_memory/example2/example2.js new file mode 100644 index 0000000..3b13e91 --- /dev/null +++ b/animations/dynamic_memory/example2/example2.js @@ -0,0 +1,560 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 2. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/dynamic_memory/two_d_array/index.html b/animations/dynamic_memory/two_d_array/index.html new file mode 100644 index 0000000..08a61b2 --- /dev/null +++ b/animations/dynamic_memory/two_d_array/index.html @@ -0,0 +1,18 @@ + + + + +This is an animation of dynamic allocation of two-dimensional arrays. Click the "next step" button to run the animation. Note: we assume rows is 2 and cols is 3.
+ + + + + + + diff --git a/animations/dynamic_memory/two_d_array/two_d_array.js b/animations/dynamic_memory/two_d_array/two_d_array.js new file mode 100644 index 0000000..3cdc6f7 --- /dev/null +++ b/animations/dynamic_memory/two_d_array/two_d_array.js @@ -0,0 +1,651 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows how to delete a node of value 20 in a Min Heap. Click the "next step" button to run the animation.
+ +This animation shows how to insert a node of value 10 in a Min Heap. Click the "next step" button to run the animation.
+ +This animation shows how we implement and create a list. Click the "next step" button to run the animation.
+ + + + + + + + + diff --git a/animations/lists/erase/erase.js b/animations/lists/erase/erase.js new file mode 100644 index 0000000..267103d --- /dev/null +++ b/animations/lists/erase/erase.js @@ -0,0 +1,431 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows why erasing an element in a vector is more expensive than in a list. Click the "next step" button to run the animation. Note: in this animation, we assume we are going to erase the element which has the value 5.
+ + + + + + + + + + diff --git a/animations/lists/insert/index.html b/animations/lists/insert/index.html new file mode 100644 index 0000000..f14bb35 --- /dev/null +++ b/animations/lists/insert/index.html @@ -0,0 +1,20 @@ + + + + +This animation shows the insert operation in List. Click the "next step" button to run the animation. Note: in this animation, we will insert a node in between 5 and 8, and we assume the new node's value (i.e., x) is 4.
+ + + + + + + + + diff --git a/animations/lists/insert/insert.js b/animations/lists/insert/insert.js new file mode 100644 index 0000000..431c4be --- /dev/null +++ b/animations/lists/insert/insert.js @@ -0,0 +1,359 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows why erasing an element in a vector is more expensive than in a list. Click the "next step" button to run the animation. Note: in this animation, we assume we are going to erase the element which has the value 5.
+ + + + + + + + + + diff --git a/animations/lists/iterator/iterator.js b/animations/lists/iterator/iterator.js new file mode 100644 index 0000000..03ed68b --- /dev/null +++ b/animations/lists/iterator/iterator.js @@ -0,0 +1,597 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows how the push_back() method works in List. Click the "next step" button to run the animation. Note: In this animation, we assume value is 4.
+ + + + + + + + + diff --git a/animations/lists/push_back/push_back.js b/animations/lists/push_back/push_back.js new file mode 100644 index 0000000..f957577 --- /dev/null +++ b/animations/lists/push_back/push_back.js @@ -0,0 +1,588 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows how the push_front() method works in List. Click the "next step" button to run the animation. Note: In this animation, we only consider the general case where the list is not empty. Also, we assume value is 4.
+ + + + + + + + + diff --git a/animations/lists/push_front/push_front.js b/animations/lists/push_front/push_front.js new file mode 100644 index 0000000..03af9b9 --- /dev/null +++ b/animations/lists/push_front/push_front.js @@ -0,0 +1,408 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 1. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/pointers/example2/example2.js b/animations/pointers/example2/example2.js new file mode 100644 index 0000000..7df527c --- /dev/null +++ b/animations/pointers/example2/example2.js @@ -0,0 +1,262 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 2. Click the "next step" button to run the animation. Note: this animation makes an unrealistic assumption, which is it takes 8 bytes to store each of the following: an int object, an int pointer, a float object, a float pointer.
+ + + + + + + diff --git a/animations/pointers/example3/example3.js b/animations/pointers/example3/example3.js new file mode 100644 index 0000000..6b84f1a --- /dev/null +++ b/animations/pointers/example3/example3.js @@ -0,0 +1,309 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 3 in which we try to find out what the values of x and y are at the end. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/pointers/example4/example4.js b/animations/pointers/example4/example4.js new file mode 100644 index 0000000..cb23bf0 --- /dev/null +++ b/animations/pointers/example4/example4.js @@ -0,0 +1,360 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 4. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/pointers/example_arrays_1/array1.js b/animations/pointers/example_arrays_1/array1.js new file mode 100644 index 0000000..ddd5e7c --- /dev/null +++ b/animations/pointers/example_arrays_1/array1.js @@ -0,0 +1,455 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 1. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/pointers/example_arrays_2/array2.js b/animations/pointers/example_arrays_2/array2.js new file mode 100644 index 0000000..d04a68b --- /dev/null +++ b/animations/pointers/example_arrays_2/array2.js @@ -0,0 +1,443 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of example 2. Click the "next step" button to run the animation.
+ + + + + + + diff --git a/animations/recursion/factorial/factorial.js b/animations/recursion/factorial/factorial.js new file mode 100644 index 0000000..03a23c3 --- /dev/null +++ b/animations/recursion/factorial/factorial.js @@ -0,0 +1,608 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis is the animation of a recursive implementation of the factorial computation. Click the "next step" button to run the animation. Note: we assume the user calls fact(4).
+ + + + + + + diff --git a/animations/recursion/fibonacci/fibonacci.js b/animations/recursion/fibonacci/fibonacci.js new file mode 100644 index 0000000..125ddc4 --- /dev/null +++ b/animations/recursion/fibonacci/fibonacci.js @@ -0,0 +1,253 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows the time complexity of the recursive implementation of the fibonacci computation. Click the "next step" button to run the animation. Note: we assume each add operation takes constant time, and we use C to denote this constant time.
+ + + + + + + diff --git a/animations/trees/delete_node/delete_node.js b/animations/trees/delete_node/delete_node.js new file mode 100644 index 0000000..de43949 --- /dev/null +++ b/animations/trees/delete_node/delete_node.js @@ -0,0 +1,405 @@ +// Author: Jidong Xiao +// first we need to create a stage +var stage = new Konva.Stage({ + container: 'container', // id of containerThis animation shows how to delete a node in a binary search tree. Click the "next step" button to run the animation. Note: This animation as of now doesn't support the deletion of node 5.
+ + +