Searching a node in a singly linked list | Time complexity analysis | Data Structure Visualization

preview_player
Показать описание
#searchElementLinkedList #dataStructures #linkedList
In this animated tutorial, we will learn how to search an element in a singly linked list. And also learn to analyze the best case and worst case time complexity.

Learn Programming in Animated Way. Visualizing data structures.

You may also like us on
Рекомендации по теме
Комментарии
Автор

send more lactures on youtube this is helpful for us

mramzanali
Автор

Can we say that linked list will at least take 0(n) atleast in the worst case....is this the most effecient algo for searching in linked list?

yashsrivastava
Автор

What is a time complexity of second node for any operation

hariharans
Автор

If we apply binary search in sorted linked list. Will it reduce time complexity?

dharmeshdubey
Автор

Very nice explainatio
I have doubt in searching in LL
I have different code for searching
Int val, count, x=0;
Struct node *temp;
Pf("enter value "), ;
Sf() ;
count=1;/* here I have doubt why it(count) has been declared as 1, we can declare 0 also
Plz sir help in this*/
while loop
If loop
Elsee loop
Else loop/*two times else loop*/

aparnachavan
Автор

Good one. Here you've used the search based on value not by index, so the time complexity is O(n). What if we search based on index, as LinkedList is an ordered list..will it be O(1)?

ravitejac
Автор

Why can't we use the head directly instead of temp?!?

kaoutarru