Find the largest node in Doubly linked list

Suppose that given linked list is combination of integer value. we are need to find largest node of this doubly linked list. We can solve this problem by using linked list traversal from front node to last node.

Process: When linked list is not empty then use one integer variable and assign front node value to this integer variable. Using of linked list pointer iterates linked list nodes are one by one visiting upcoming nodes. And check that linked list element value are greater than integer variable values. Then assign this value to resultant variable. This process are execute until not found last linked list node. This process are time complexity is O(n).

Suppose we are inserted the following (14, 31, 12, 15, 11, 25 ) node in a sequence.

Find the largest node

Here given code implementation process.

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment

© 2021,, All rights reserved