in Programming in C
143 views
0 votes
0 votes
How can we find the highest element in a singly linked list in O(1)?

We are free to use any extra space.
in Programming in C
143 views

1 Answer

2 votes
2 votes
i dont think so we can do it in O(1) no matter any extra space u'll use or not u have to traverse the linked list either to store elements of the ll or if u'll do with taking any variable  then also u have to traverse .

Related questions