Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp1204-grep-sed-awk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dst1m17
comp1204-grep-sed-awk
Commits
2998defd
Commit
2998defd
authored
3 years ago
by
dst1m17
Browse files
Options
Downloads
Patches
Plain Diff
Added sed example file for delete
parent
b040aadb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
generate-data.sh
+27
-0
27 additions, 0 deletions
generate-data.sh
sed-example-delete.txt
+107
-0
107 additions, 0 deletions
sed-example-delete.txt
with
134 additions
and
0 deletions
generate-data.sh
0 → 100755
+
27
−
0
View file @
2998defd
#!/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
This diff is collapsed.
Click to expand it.
sed-example-delete.txt
0 → 100644
+
107
−
0
View file @
2998defd
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment