File tree Expand file tree Collapse file tree 5 files changed +6
-9
lines changed
Expand file tree Collapse file tree 5 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ img.bracket {
7373}
7474
7575img # leftBracket {
76- left : 20 px ;
76+ left : 150 px ;
7777}
7878
7979img # rightBracket {
80- left : 1110 px ;
80+ left : 980 px ;
8181}
8282
8383img # paused {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var n = 10;
1111 * Check if an algorithm is already running - if that is the case reset the view
1212 */
1313function checkIfAlreadyRunning ( ) {
14+ k . hide ( ) ;
1415 var arr = setRandomArray ( ) ;
1516 setArray ( viewer . serializeArray ( arr ) ) ;
1617 manager . clear ( ) ;
@@ -21,7 +22,6 @@ function checkIfAlreadyRunning() {
2122 */
2223function startInsertionSort ( ) {
2324 checkIfAlreadyRunning ( ) ;
24- viewer . setPause ( ) ;
2525 control . hideK ( ) ;
2626 control . setHeadText ( "Insertion Sort" ) ;
2727 var j ; // Elements sorted, starting on second position
@@ -45,7 +45,6 @@ function startInsertionSort() {
4545 control . setJElement ( i + 1 , false ) ;
4646 control . setElementBeingComparedTo ( j - 1 , false ) ;
4747 }
48- manager . start ( ) ;
4948}
5049function startShellSort ( ) {
5150 checkIfAlreadyRunning ( ) ;
@@ -79,7 +78,6 @@ function startShellSort() {
7978 control . setKValue ( k ) ;
8079 }
8180 control . hideK ( ) ;
82- manager . start ( ) ;
8381}
8482/**
8583 * Fill the array with random integers
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const n = 10;
1414 * Check if an algorithm is already running - if that is the case reset the view
1515 */
1616function checkIfAlreadyRunning ( ) {
17-
17+ k . hide ( ) ;
1818 let arr = setRandomArray ( ) ;
1919 setArray ( viewer . serializeArray ( arr ) ) ;
2020 manager . clear ( ) ;
@@ -26,7 +26,6 @@ function checkIfAlreadyRunning() {
2626 */
2727function startInsertionSort ( ) {
2828 checkIfAlreadyRunning ( ) ;
29- viewer . setPause ( ) ;
3029 control . hideK ( ) ;
3130 control . setHeadText ( "Insertion Sort" ) ;
3231 let j : number ; // Elements sorted, starting on second position
@@ -50,7 +49,6 @@ function startInsertionSort() {
5049 control . setJElement ( i + 1 , false ) ;
5150 control . setElementBeingComparedTo ( j - 1 , false ) ;
5251 }
53- manager . start ( ) ;
5452}
5553
5654function startShellSort ( ) {
@@ -91,7 +89,6 @@ function startShellSort() {
9189 control . setKValue ( k ) ;
9290 }
9391 control . hideK ( ) ;
94- manager . start ( )
9592}
9693
9794/**
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ function setArray(serializedArray) {
77 $ ( "#arrayUl li, #indices p" ) . each ( function ( ) {
88 $ ( this ) . remove ( ) ;
99 } ) ;
10+ $ ( "#arrayUl" ) . remove ( ) ;
1011 // Insert new elements
1112 array = serializedArray . split ( '|' ) ; // Deserialize array
1213 $ ( "#array" ) . append ( "<ul id='arrayUl' class='insElements'></ul>" ) ; // TODO: this adds arrayUl without deleting it
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ function setArray(serializedArray: any) {
88 $ ( "#arrayUl li, #indices p" ) . each ( function ( ) {
99 $ ( this ) . remove ( ) ;
1010 } ) ;
11+ $ ( "#arrayUl" ) . remove ( ) ;
1112 // Insert new elements
1213 array = serializedArray . split ( '|' ) ; // Deserialize array
1314 $ ( "#array" ) . append ( "<ul id='arrayUl' class='insElements'></ul>" ) ; // TODO: this adds arrayUl without deleting it
You can’t perform that action at this time.
0 commit comments