Question: 1. Suppose you are given two circularly linked lists, L and M. Describe an algorithm for telling if L and M 2. Give a fast

 1. Suppose you are given two circularly linked lists, L and

1. Suppose you are given two circularly linked lists, L and M. Describe an algorithm for telling if L and M 2. Give a fast algorithm for concatenating two doubly-linked lists L and M, with header and trailer sentinel 3 Given a singly-linked list L containing integer values, describe an algorithm that removes all nodes that 4. Implement a function that counts the number of nodes in a circularly linked list. store the same sequence of elements (but perhaps with different starting points). nodes, into a single list L'. What is the running time of this algorithm? contain odd integers 5. Describe a non-recursive method for finding, by link hopping (ie, traversal/walking the list), the middle node of a doubly-linked list with header and trailer sentinels. (Note: This method must only use link hopping; it cannot use a counter.) What is the running time of this method? 6. Describe a recursive algorithm that counts the number of nodes in a singly-linked list. 7. Describe a fast recursive algorithm for reversing a singly linked list L, so that the ordering of the nodes becomes opposite of what it was before

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!