13.07.2015 Views

Linked List Problems

Linked List Problems

Linked List Problems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14// Append 'b' onto the end of 'a', and then set 'b' to NULL.void Append(struct node** aRef, struct node** bRef) {// Your code...9 — FrontBackSplit()Given a list, split it into two sublists — one for the front half, and one for the back half. Ifthe number of elements is odd, the extra element should go in the front list. SoFrontBackSplit() on the list {2, 3, 5, 7, 11} should yield the two lists {2, 3, 5} and {7,11}. Getting this right for all the cases is harder than it looks. You should check yoursolution against a few cases (length = 2, length = 3, length=4) to make sure that the listgets split correctly near the short-list boundary conditions. If it works right for length=4,it probably works right for length=1000. You will probably need special case code to dealwith the (length

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!