How to search an element in a Singly Linked List in Java ?

preview_player
Показать описание

Watch all my playlist here:

Want to land a software engineering job in the IT industry? This course - 'Visualizing Data Structures and Algorithms' is here to help. The course walks you through multiple Java algorithms, data structures problems, and their solutions with step by step visualizations, so that you are actually learning instead of blindly memorizing solutions.

The course covers in and outs of Data Structures and Algorithms in Java. Java is used as the programming language in the course. Students familiar with Javascript, Python, C#, C++, C, etc will also get to learn concepts without any difficulty. The implementation of various Algorithms and Data Structures have been demonstrated and implemented through animated slides. It covers many interview room questions on Algorithms and Data Structures. The questions and solutions are demonstrated by -

1. Animated slide. (To make visualization of algorithms faster)
2. Coding algorithm on IDE.

The course covers topics such as -
0. Algorithm Analysis
1. Arrays
2. Matrix
3. Singly Linked List
4. Doubly Linked List
5. Circular Singly Linked List
6. Stacks
7. Queues
8. Binary Tree
9. Binary Search Tree
10. Graphs
11. Priority Queues and Heaps
12. Recursion
13. Searching
14. Sorting
15. Strings
16. Trie Data Structure
17. Dynamic Programming
and many more ...

#dsa #algorithms #coding
Рекомендации по теме
Комментарии
Автор

more courage to him please he is the best 1 who explain the linked list

iraqbaghdad
Автор

Best series for DS & Algo. I am also 10 yrs java exp guy. Was looking for DS & Algo free course over YouTube with java implementation and found this. Hats Off To You Man...Excellent Work. GOD BLESS YOU :)

shubhamagarwal
Автор

its second day of watching ds video from your channel still im not facing any difficulty to understand linked list concept great job this will definetly help in my campus placement drive

ChetanMishra-ider
Автор

Thank you, sir. Your DS series are the best.

ИтгэлсайханЭ
Автор

:) brother what u have done is so helpful but plz keep with the clear and slow voice

alisxbl
Автор

thank you a lot! your tutorials are helping me a lot for my project in university.

mimmykoch
Автор

Your tutorials are very helpful. Great job!! Can you do more tutorial videos for other Data Structure materials( binary tree, hash table, graphs, etc..). Pseudo code covering each line of the syntax were really Helpful.
Thank you Sir!

fahimn
Автор

Please like and share your love to this amazing channel . Thanks a lot for amazing tutorials . Happy Learning .

Abhishekk
Автор

Sir, why have you taken head as an parameter?

suryakiran
Автор

if someone is getting errors while implementing the main method try this:
Inside the main method write these lines of code:
public static void main(String []args){
singlylinkedlist sll=new singlylinkedlist();

sll.head=new ListNode(10);
ListNode second=new ListNode(1);
ListNode third=new ListNode(8);
ListNode fourth=new ListNode(11);

sll.head.next=second;
second.next=third;
third.next=fourth;


sll.display();


if(sll.find(sll.head, 10)){
System.out.println("search key found");
}
else{
System.out.print("not found!");

}
}

studyroy
Автор

sir is this code also valid?

public void search(int value){
if(head==null){
System.out.println("The Singly Linked List is Empty");
return;
}
ListNode current=head;
int count=1;
while(current!=null){
if(current.data==value){
System.out.printf("The element %d is present in the Singly Linked List at position %d\n", value, count);
return;
}
current=current.next;
count++;
}
System.out.printf("The element %d is not present in the Singly Linked List\n", value);
}

bruiciedoocie
Автор

Sir Plz Tell Me That Why You Gave Listnode Head As one Parameter In This Method i Couldn't Get That :(

StoicX
Автор

what is the difference between current and current.data?

faithreeves
Автор

sir when did you create the singlylinkedlist and how did you put the head in display()method?
kindlly explain sir

VivekYadav-rchv
Автор

sir is this series enough to prepare for placements, have u covered all ds and algo topics

divyanshumaheshwari
Автор

Another excellent video! Your accent is fine with me

juliemoore
Автор

Pls explain how : singlyLinkedList. display (head) ;
How head is passed as an argument

anubhavjoria
Автор

public boolean find(ListNode head, int saerchKey){
if (head == null){
return false;
}
ListNode current =head;
while(current != null){
if (current.data == saerchKey ){
return true;
}
current = current.next;
}
return false;
}


what is the problem?

alisxbl
Автор

Can you please use the previous voice.

rayeedamir
Автор

so here comes your original voice..lol

varunabhi