Design a non recursive algonthin for finding by link


1.Design a non recursive algonthin for finding by link hopping d e., traverse the int by following links), ow middle node of a doubly linked list with header and trader cent nets. (Note. This method must only use Ink hopping; it cannot use • counter.)
What is the running tine of yOUr algorithm? Why) 

2. Design a recursive algontNn for Ceding the maximum element in an array A of n elements. What is the sunning time of your algorithm? Why? 

3.. Design an algorithm to count the number of nodes in a circularly linked list. What is the running time of your algorithm? Why? 

4.. Let A be an array of site n72 containing integers from 1 to n-1, inclusive, with exactly one repeated. Design an algorithm for fInceng the Integer en A that is repeated. What is the runniry; time of your algorithm? Why? 

5. Design an algorithm for concatenating two doubly linked lists L and M, with header and trader sentinel nodes, Into a single list L'. What is the running time of your algorithm? Why?

6.. Design an algorithm to swap two nodes x and y and not Just their contents) in a singly linked list t. given references only to x and y. Repeat this to design an algorithm for the case when L is a doubly linked Int. What is the running tine for each algorithm that you have SOPS? Wtry7 Which algorithm takes more time?

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Design a non recursive algonthin for finding by link
Reference No:- TGS01509409

Now Priced at $30 (50% Discount)

Recommended (97%)

Rated (4.9/5)