Alan Hwang Report –Project 4 There was a problem with the mingle function. It worked fine except for the last value, it did not know how to put it in. The problem was fixed by adding two more while loops to account for when the code reads to the end of an array. There was also one instance where I was stuck for the longest time, but then realized that I need two = signs instead of one when I was doing a bool statement. Another problem that encountered was that in removeDups and divide, it would do the right action but return the wrong number. This problem was due to my usage of moveToEnd in these functions. It took a while to realize that when the function is used, you have to account for the fact that the string that is thrown to the end has already been examined, and this was achieved with the statement i--; n--;. For disagree, it didn’t return the number when they were equal. I fixed it by adding the line if (a1[n1-1 ] == a2[n1-1 ]) return n1; Some of the test cases I tested were:
This is the end of the preview. Sign up
access the rest of the document.