CS 2114 Lecture Notes - Lecture 16: Mobile Suit Gundam
Document Summary
March 19, 2018 full lists, empty lists, etc. (see lecture 14) Project v designs will be due sunday, march 25. Project iv will be released this week and is due monday, april 16. Lab ix is about debugging, so write very thorough test cases one off errors, likely be the largest program you"ve ever written. Regularly want to change both ends (know the front, back). Use circular array to reuse the empty space at the front. Circular array: use for project iv unused location before the front: full if backindex + 2 == frontindex, empty if backindex + 1 == frontindex, one element if backindex == frontindex. Cs-2114 frontindex = (frontindex + 1) % queue. length ; return front; } } Double the size if necessary; put frontindex in new front and backindex as the last entry. See ensurecapacity in the slides (week 9, monday).