Skip to content
Snippets Groups Projects
Commit 2998defd authored by dst1m17's avatar dst1m17
Browse files

Added sed example file for delete

parent b040aadb
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
echo "Algorithm Array size, Time (ms)"
for i in {10..1000..10}; do
num=$(shuf -i 0-10 -n 1);
#echo "Bubble sort" $i,$(($num + $(($i * $i))));
if [[ $(shuf -i 0-5 -n 1) -gt 4 ]]
then
echo "Bubble sort" $i, $(($num + $(($i * $i))));
else
echo "Bubble sort" $i, $(($num + $(($i * $i))));
echo "DebugMsg: Bubble sort completed for array size " $i;
fi
if [[ $(shuf -i 0-5 -n 1) -gt 4 ]]
then
echo "Quicksort" $i,-----$(echo $i | awk '{printf "%1.4f\n",log($i)}')
else
#j=$(echo $i | awk '{printf "%1.4f\n",log($i)}')
#echo $(($j + 10))
echo "Quicksort" $i,$(echo $i | awk '{printf "%1.4f\n",$i*log($i)}')
echo "DebugMsg: Quick sort completed for array size " $i;
fi
#echo "Quicksort" $i,$(echo $i | awk '{printf "%1.4f\n",log($i)}')
done
Size Time
1, 556
2, 609
3, 463
Run completed.
4, 80
5, 8
6, 759
Run completed.
7, 843
8, 157
9, 943
10, 813
11, 502
12, 607
13, 65
14, 439
15, 817
16, 809
17, 937
18, 105
19, 568
20, 67
21, 594
22, 321
23, 877
24, 328
25, 755
26, 187
27, 684
Run completed.
28, 791
29, 451
30, 640
31, 344
32, 469
33, 554
34, 969
35, 486
36, 123
37, 270
38, 49
39, 633
40, 637
41, 843
42, 457
43, 885
Run completed.
44, 696
45, 687
46, 468
47, 652
48, 236
49, 165
50, 31
51, 882
52, 664
53, 216
54, 23
55, 529
56, 677
57, 260
58, 22
59, 340
60, 37
61, 763
62, 290
63, 29
64, 60
65, 946
66, 411
67, 340
68, 365
69, 528
70, 334
71, 689
72, 322
73, 277
74, 366
75, 311
76, 734
Run completed.
77, 277
78, 966
79, 765
80, 771
81, 716
82, 587
83, 833
84, 719
85, 423
86, 223
87, 795
88, 692
89, 4
90, 260
91, 116
92, 302
93, 837
94, 514
95, 959
96, 965
97, 443
98, 497
99, 223
Run completed.
100, 127
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment