{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSC-113-Tutorial11

# CSC-113-Tutorial11 - Write a method public List...

This preview shows page 1. Sign up to view the full content.

KSU / CCIS / CS DEPARTMENT CSC-113, SPRING 2010 TUTORIAL 11 Linked-List Exercise-1 : Write a method public List intersection(List L1, List L2) that receives two linkedList L1 and L2, and returns the intersection between L1 and L2. Example: L1 = (2, 50, 60, 17, 23, 12, 7, 15, 10) L2 = (18, 10, 4, 23, 10, 5, 20, 17) The intersection between L1 and L2 is L3=(17, 23, 10) Exercise-2 :
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: : Write a method public [ ] List splitIntoTwoLists( ) that splits the current linkedList L into two sub-lists L1 and L2 . One for the first front half of L , and one for the back half of L . If the number of elements is odd, the extra element should go in the front list. Example: L = (2, 3, 5, 7, 11), After splitting we will have two list s: L1 = (2, 3, 5) and L1 = (7,11)...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online