Skip to content

Commit 162f9a8

Browse files
Merge pull request #11 from CatalinAnt/Almu
Almu
2 parents ec2ea92 + 7c2276a commit 162f9a8

File tree

8 files changed

+33
-36
lines changed

8 files changed

+33
-36
lines changed

README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Screenshot of branch measurement (0%, was untested):<br>
4242
#### Catalin Antonescu
4343

4444
##### Function 1: strong_password
45-
45+
4646
Link to commit:
4747
[https://github.com/CatalinAnt/algorithms-SEP-95/commit/eaad6d32ecd73bb8fde876a4d4852cb522aea6f8](https://github.com/CatalinAnt/algorithms-SEP-95/commit/2b0b9187c1c040e4476b1ca14f2c2249273566b7)
4848

@@ -91,6 +91,24 @@ https://github.com/CatalinAnt/algorithms-SEP-95/commit/c16f26e952322b2c1729778a4
9191
![first_unique_char_hits](https://github.com/CatalinAnt/algorithms-SEP-95/assets/114078193/10d7c45c-398e-4408-8f11-6771f51fa95c)
9292

9393

94+
#### Almuthana Almustafa
95+
96+
##### Function 1: stoogsort in stoog_sort.py
97+
98+
[Link to the commit in the founction files](https://github.com/CatalinAnt/algorithms-SEP-95/commit/57b66879c6ae0f82712c55528f540dfdb3c3ddd3)
99+
100+
result:
101+
102+
![alt text](result_image-2.png)
103+
104+
##### Function 2: word_break in word_break.py
105+
106+
link to commit in founction:
107+
[Link to the commit in the founction files](https://github.com/CatalinAnt/algorithms-SEP-95/commit/57b66879c6ae0f82712c55528f540dfdb3c3ddd3 )
108+
109+
result:
110+
111+
![alt text](result_image_2.png)
94112

95113
#### Ayman Errahmouni
96114

@@ -286,55 +304,34 @@ The coverage is improved by 13%, the code only hit three out of five branches an
286304

287305
## Almuthana Almustafa
288306

289-
stoogsort in stoog_sort.py
307+
### Test 1: stoogsort
290308

291-
[Link to the commit in the founction files](https://github.com/CatalinAnt/algorithms-SEP-95/commit/57b66879c6ae0f82712c55528f540dfdb3c3ddd3)
292309

293-
result:
294-
295-
![alt text](ts.png)
296-
297-
word_break in word_break.py
298-
299-
link to commit in founction:
300-
[Link to the commit in the founction files](https://github.com/CatalinAnt/algorithms-SEP-95/commit/57b66879c6ae0f82712c55528f540dfdb3c3ddd3 )
301-
302-
result:
303-
304-
![alt text](ts.png)
305-
306-
Almuthana Almustafa
307-
308-
Test 1:
309-
310-
stoogsort function
311310

312311
link to commit in test files:
313312
[Link to the commit in the test files](https://github.com/CatalinAnt/algorithms-SEP-95/commit/157de36fd4c373b67cd03e3b3713be9ba5cf0d97)
314313

315314
existing tool result before:
316315

317-
![alt text](ss2.png)
316+
![alt text](stoog_sort_image1.png)
318317

319318
existing tool result after:
320319

321-
![alt text](ss.png)
320+
![alt text](stoog_sort_image2.png)
322321

323322
The coverage increased by 89%, largely attributable to the implementation of new tests.
324323

325-
Test 2:
326-
327-
word_break function
324+
### Test 2: word_break
328325

329326
[Link to the commit in the test files](https://github.com/CatalinAnt/algorithms-SEP-95/commit/157de36fd4c373b67cd03e3b3713be9ba5cf0d97)
330327

331328
existing tool result before:
332329

333-
![alt text](wk1.png)
330+
![alt text](word_break_image1.png)
334331

335332
existing tool result after:
336333

337-
![alt text](wk2.png)
334+
![alt text](word_break_image2.png)
338335

339336
The coverage improved by 86% due to the creation of new tests.
340337

algorithms/dp/word_break.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
# TC: O(N^2) SC: O(N)
2121
branch_coverage = {
22-
"check_1": False,
23-
"check_2": False,
24-
"check_3": False,
25-
"check_4": False,
22+
"check_5": False,
23+
"check_6": False,
24+
"check_7": False,
25+
"check_8": False,
2626

2727
}
2828
# TC: O(N^2) SC: O(N)
@@ -35,14 +35,14 @@ def word_break(word, word_dict):
3535
dp_array = [False] * (len(word)+1)
3636
dp_array[0] = True
3737
for i in range(1, len(word)+1):
38-
branch_coverage["check_1"] = True
38+
branch_coverage["check_5"] = True
3939
for j in range(0, i):
40-
branch_coverage["check_2"] = True
40+
branch_coverage["check_6"] = True
4141
if dp_array[j] and word[j:i] in word_dict:
42-
branch_coverage["check_3"] = True
42+
branch_coverage["check_7"] = True
4343
dp_array[i] = True
4444
break
45-
branch_coverage["check_4"] = True
45+
branch_coverage["check_8"] = True
4646
return dp_array[-1]
4747

4848

result_image-2.png

3.61 KB
Loading

result_image_2.png

3.47 KB
Loading

stoog_sort_image1.png

2.51 KB
Loading

stoog_sort_image2.png

2.48 KB
Loading

word_break_image1.png

2.62 KB
Loading

word_break_image2.png

2.76 KB
Loading

0 commit comments

Comments
 (0)