Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 3 README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
A p5 javascript project to visualise different Algorithms in action during execution.
Can be seen at
https://rajduino.github.io/Visualiser/index.html
1 change: 0 additions & 1 deletion 1 index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<script src="./insertion.js"></script>
<script src="./merge.js"></script>
<script src="./quickLomuto.js"></script>
<script src="./quickHoare.js"></script>
<script src="./sketch.js"></script>
</body>
</html>
54 changes: 0 additions & 54 deletions 54 quickHoare.js

This file was deleted.

4 changes: 2 additions & 2 deletions 4 quickLomuto.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function QuickSortLomuto() {
this.name = 'Quick sort (Lomuto)';
function QuickSort() {
this.name = 'Quick sort';
this.count = 40;
this.representation = 1;
this.sorter = function* (arr, colors, start = 0, end = arr.length - 1, self = this) {
Expand Down
18 changes: 8 additions & 10 deletions 18 sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const selectionSortMax = new SelectionSortMax();
const selectionSortMin = new SelectionSortMin();
const insertionSort = new InsertionSort();
const mergeSort = new MergeSort();
const quickSortLomuto = new QuickSortLomuto();
const quickSortHoare = new QuickSortHoare();
const quickSort = new QuickSort();
const DOT = 0,
LINE = 1;

Expand All @@ -36,8 +35,7 @@ const algorithms = {
selectionSortMin,
insertionSort,
mergeSort,
quickSortLomuto,
quickSortHoare,
quickSort,
auxualary: {
name: 'And a lot more coming soon!!',
count: 0,
Expand Down Expand Up @@ -181,9 +179,9 @@ function setup() {
function init(algo, length) {
paused = true;
w = width / length;
passes=0;
swaps=0;
compares=0;
passes = 0;
swaps = 0;
compares = 0;
representation = algo['representation'];

// Generation of array
Expand Down Expand Up @@ -232,9 +230,9 @@ function draw() {
stroke(0);
rect(i * w, height - array[i], w, array[i]);
textAlign(LEFT, TOP);
textSize(map(array.length,1,100,40,12));
textSize(map(array.length, 1, 100, 40, 12));
fill(0);
text(int(array[i]/10),(i+0.1)*w,height-array[i]+(height*.005));
text(int(array[i] / 10), (i + 0.1) * w, height - array[i] + (height * .005));
} else if (representation === DOT) {
ellipse(i * w, height - array[i], w, w)
}
Expand All @@ -244,7 +242,7 @@ function draw() {
stroke(0);
fill(255);
textSize(40);
text("Passes="+passes+" Swaps="+swaps+" Compares="+compares,width*0.2,50);
text("Passes=" + passes + " Swaps=" + swaps + " Compares=" + compares, width * 0.2, 50);
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.