sample_midtermSolutions

# sample_midtermSolutions - SOLUTIONS SAMPLE MIDTERM 1 a...

This preview shows pages 1–3. Sign up to view the full content.

SOLUTIONS : SAMPLE MIDTERM 1. a. Palindromes Simple test case I: i) pass ‘noon’ as an argument. ii) should return true. Simple test case II: i) pass ‘data’ as an argument. ii) should return false. Boundary test case: i) pass an empty string. ii) should return true. iii) empty string is an extreme case – checks whether it has been handled appropriately or not b. isLonger Simple test case I: i) pass l1 = {1,2,3} and l2 = {1,2,3,4} ii) should return false. Simple test case II: i) pass l1 = {1,2,3,4} and l2 = {1,2,3} ii) should return true. Boundary test case I: i) pass l1 as an empty list and l2 = {1,2,3,4} ii) should return false. iii) checks for empty list handling. Boundary test case II: i) pass l1 = {1, 2, 3} and l2 as an empty list. ii) should return true. iii) checks for empty list handling. Boundary test case III: i) pass l1 = {6,5,7,2} and l2 = {1,2,3,4} ii) should return false. iii) equality is the boundary between true and false.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
c. findDepth Simple test case I: i) pass a tree which has the element which is to be checked for being the member of the tree. ii) should return the depth of this element.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

sample_midtermSolutions - SOLUTIONS SAMPLE MIDTERM 1 a...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online