• September 15th, 2012, 09:06 AM
Flyc
1. Insert in order Given a doubly linked list of integers sorted from smallest (at the head end) to largest, and a pointer to a single node containing an integer, insert the node in the doubly linked list so that it remains sorted.
2. Cumulative sum Given a null-terminated doubly linked list, in, create a new null-terminated linked, list out, of the same length, such that node i of out contains the sum of the data in in's nodes up to and including node i of list in. Detect heap exhaustion and report it by setting a boolean variable
3. Deal Given a null terminated doubly linked list, rearrange its nodes into two lists: <first node, third node, fifth node, ...> and <second node, fourth node, sixth node, ...>. Do not allocate any new nodes.
4. Rifle Shuffle Given two null terminated doubly linked lists, combine their nodes so that the nodes of the new list alternate between those of the two original nodes: <first node of first list, first node of second list, second node of first list, second node of second list, ... >. Do not allocate any new nodes.