This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: it is present in the second list. Question 9. (10 points) (b) We can create a new List (call it result list), then each time compare the rst element of the currnet list and given list, and puts the smaller to the next empty slot of the result List, after that, we should remove that element from its original List. After one of the lists becomes empty, we just copy the remaining contents of the other list to the result list. Note that adding elements to the result list just adds them to the end of the list and we do not need to search for the appropriate place because we are coping element in the increasing order. Question 10. (15 points) We have to iterate throught all elements anyways becasue we do not have the linke of the node in the middile of the list and inorder to get it we need to iterate through the elements before it. 2...
View Full Document
This note was uploaded on 10/02/2009 for the course CS 20 taught by Professor Agrawal during the Spring '08 term at UCSB.
- Spring '08