Commit 12fbd8a4 authored by edmundszagars's avatar edmundszagars
Browse files

-Fixing issue where already sorted array was displayed for input data

parent f7fe451b
2, 1, 3
2, 1, 3, 484, 197, 380, 490, 896, 152, 348, 94, 368, 690, 148, 926, 823, 379, 984, 379, 571, 253, 569, 757, 138, 747, 25, 908, 893, 182, 886, 68, 998, 440, 762, 271, 295, 59, 196, 669, 262, 245, 452, 84, 864, 988, 956, 546, 579, 869, 945, 763, 822, 613, 505, 33, 434, 331, 497, 660, 759, 16, 223, 615, 171, 624, 576, 196, 975, 218, 391, 630, 59, 504, 792, 764, 216, 303, 265, 562, 891, 106, 776, 940, 128, 108, 244, 543, 924, 635, 950, 275, 199, 37, 905, 27, 133, 506, 196, 103, 525, 943, 889, 780, 473, 722, 513, 47, 374, 212, 215, 502, 381, 212, 773, 799, 459, 376, 501, 48, 549, 275, 770, 39, 720, 261, 552, 617, 210, 508, 629, 393, 351, 996, 213, 957, 471, 497, 205, 703, 485, 925, 591, 942, 24, 253, 253, 100, 539, 907, 654, 626, 252, 588, 397, 228, 126, 35, 33, 571, 405, 430, 899, 769, 164, 119, 966, 605, 782, 139, 330, 28, 333, 332, 924, 127, 951, 643, 672, 608, 508, 16, 907, 998, 520, 565, 726, 277, 879, 884, 755, 210, 84, 910, 213, 510, 254, 910, 779, 394, 482, 863, 972, 332, 803, 563, 273, 107, 907, 203, 323, 219, 519, 390, 234, 536, 500, 914, 789, 579, 992, 127, 84, 805, 209, 130, 829, 781, 456, 940, 304, 235, 789, 743, 346, 391, 173, 338, 466, 388, 137, 120, 674, 105, 494, 347, 335, 891, 731, 772, 990, 204, 22, 519, 61, 973, 318, 945, 866, 967, 834, 469, 148, 519, 806, 274, 658, 458, 391, 345, 781, 880, 163, 37, 954, 382, 656, 421, 71, 502, 229, 930, 398, 405, 52, 294, 353, 680, 293, 611, 106, 798, 646, 839, 212, 90, 563, 473, 686, 737, 436, 148, 179, 866, 997, 368, 912, 314, 460, 680, 561, 77, 235, 690, 878, 874, 974, 951, 432, 954, 955, 691, 952, 60, 35, 567, 411, 30, 671, 368, 781, 753, 294, 29, 213, 620, 75, 990, 844, 29, 281, 537, 454, 75, 615, 191, 859, 712, 506, 87, 289, 567, 545, 335, 525, 309, 345, 112, 591, 697, 789, 582, 817, 295, 897, 621, 185, 437, 817, 972, 720, 75, 913, 761, 279, 277, 947, 677, 546, 367, 435, 158, 237, 863, 433, 288, 986, 513, 439, 40, 786, 908, 740, 697, 143, 45, 67, 736, 926, 500, 903, 642, 447, 504, 897, 407, 568, 218, 364, 459, 242, 918, 324, 778, 935, 571, 395, 381, 476, 439, 444, 915, 702, 402, 899, 751, 923, 565, 338, 92, 64, 113, 19, 802, 575, 239, 759, 18, 886, 547, 407, 522, 292, 147, 356, 414, 445, 818, 72, 813, 182, 758, 341, 256, 938, 556, 986, 694, 671, 444, 980, 888, 77, 598, 825, 571, 108, 498, 605, 50, 31, 331, 201, 810, 154, 979, 854, 88, 560, 56, 332, 834, 881, 404, 71, 520, 866, 8, 828, 893, 454, 300, 814, 174, 522, 600, 778, 582, 44, 940, 880, 512, 559, 469, 505, 902, 171, 61, 471, 612, 539, 137, 327, 565, 403, 590, 488, 709, 174, 906, 45, 6, 242, 743, 102, 653, 698, 203, 295, 192, 926, 868, 985, 377, 807, 152, 876, 138, 251, 8, 89, 215, 973, 974, 179, 763, 595, 542, 870, 846, 201, 338, 402, 531, 584, 644, 356, 180, 150, 691, 38, 108, 288, 420, 84, 99, 481, 632, 812, 376, 40, 499, 252, 573, 616, 16, 258, 463, 526, 819, 334, 921, 701, 963, 304, 851, 916, 132, 917, 842, 727, 861, 694, 867, 937, 728, 169, 448, 501, 375, 688, 619, 700, 754, 727, 972, 223, 837, 757, 416, 743, 47, 949, 866, 486, 313, 163, 427, 826, 359, 436, 568, 541, 823, 844, 470, 608, 29, 736, 429, 787, 324, 272, 609, 573, 394, 599, 247, 229, 532, 221, 473, 139, 466, 531, 18, 263, 742, 551, 659, 577, 578, 663, 720, 13, 903, 576, 699, 407, 258, 194, 168, 362, 598, 635, 96, 317, 712, 274, 775, 50, 770, 503, 122, 446, 810, 49, 354, 355, 623, 647, 280, 795, 869, 462, 800, 721, 21, 319, 704, 743, 942, 511, 304, 313, 96, 217, 229, 936, 424, 906, 183, 124, 231, 739, 616, 274, 700, 960, 563, 461, 70, 495, 154, 876, 853, 171, 214, 36, 135, 50, 682, 477, 524, 241, 817, 270, 630, 187, 325, 989, 42, 816, 168, 651, 45, 752, 361, 406, 728, 645, 871, 652, 470, 949, 509, 33, 421, 989, 398, 534, 700, 36, 2, 861, 774, 878, 977, 785, 508, 95, 526, 980, 929, 62, 211, 805, 478, 747, 99, 493, 704, 516, 656, 48, 901, 533, 384, 690, 969, 315, 167, 570, 435, 671, 466, 25, 820, 837, 878, 72, 577, 143, 895, 663, 17, 943, 570, 63, 263, 610, 16, 688, 390, 873, 821, 396, 172, 859, 682, 41, 98, 435, 992, 652, 931, 1, 954, 898, 720, 149, 913, 994, 212, 646, 967, 720, 732, 516, 216, 793, 938, 879, 435, 992, 10, 288, 400, 220, 997, 523, 687, 879, 877, 247, 100, 435, 3, 444, 148, 588, 189, 117, 871, 191, 982, 304, 669, 423, 356, 282, 899, 806, 784, 194, 95, 405, 378, 308, 738, 401, 567, 681, 770, 593, 303, 947, 608, 664, 767, 638, 724, 961, 81, 71, 324, 103, 842, 469, 307, 511, 111, 50, 215, 332, 871, 790, 715, 427, 535, 710, 575, 231, 823, 395, 17, 905, 572, 391, 79, 24, 967, 767, 965, 617, 536, 127, 530, 952, 61, 632, 444, 731, 219, 829, 664, 860, 796, 831, 709, 981, 440, 293, 167, 987, 288, 984, 54, 217, 57, 225, 419, 395, 196, 166, 456, 46, 219, 438, 79, 197, 842, 340, 686, 332, 769, 903, 346, 219, 184, 928, 160, 820, 204, 293, 229, 749, 552, 407, 104, 854, 683, 681, 142, 659, 754, 165, 875, 584, 859, 305, 213, 501, 542, 108, 349, 426, 847, 763, 122, 143, 246, 37, 326, 977, 544, 874, 901, 30, 932, 895, 867, 402, 906
1, 2, 3, 4
\ No newline at end of file
......@@ -94,15 +94,15 @@ public class MainWindow extends Application {
Result anResult = new Result();
BubbleSort bs = new BubbleSort();
double[] ar = dataFromCSV.getDoubleArrayFromListItem((ArrayList) list.get(0));
anResult.setStartDataString(ar);
double[] resultArray = bs.bubbleSort(ar);
long tree = bs.getExecutionStart();
long end = bs.getExecutionEnd();
anResult.setStartDataString(ar);
anResult.setResultDataString(resultArray);
anResult.setExecutionResultTime(bs.getExecutionTime());
long free = bs.getExecutionTime();
anResult.setExecutionResultTime(free);
long tt = anResult.getExecutionResultTime();
table.getItems().add(anResult);
}
......
......@@ -18,7 +18,7 @@ public class BubbleSort implements ExecutionTime {
}
}
}
executionEnd = System.currentTimeMillis();
setExecutionEnd(System.currentTimeMillis() - executionStart);
return array;
}
......@@ -30,23 +30,23 @@ public class BubbleSort implements ExecutionTime {
}
public long getExecutionStart() {
return executionStart;
return this.executionStart;
}
private void setExecutionStart(long executionStart) {
executionStart = executionStart;
this.executionStart = executionStart;
}
public long getExecutionEnd() {
return executionEnd;
return this.executionEnd;
}
private void setExecutionEnd(long executionEnd) {
executionEnd = executionEnd;
this.executionEnd = executionEnd;
}
@Override
public long getExecutionTime() {
return this.getExecutionEnd() - this.getExecutionStart();
return executionEnd;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment