Java: Create LinkedList using GUI

Veröffentlicht am: 09 Dezember 2020
auf dem Kanal: CODE ZERO
4,627
78

i this video i'll be creating a linked list using gui in java its implementation will include add first, delete first and delete at any place and display . linked list is a very use full data structure that is dynamic in nature.
implementation of linkedlist is not the scope of the video we only created a gui based linkedlist using netbeans and java.

code to be copied is shown below:

class Node{
int d;
Node next=null;

public Node(int data){
d = data;
}
}

class LinkedList{
Node first=null;
public void addFirst(int data){
Node node = new Node(data);
if(first==null)
first=node;
else{
node.next=first;
first=node;
}
}

public void removeFirst(){
first=first.next;
}

public void delete(int value){
Node temp=first;
Node temp1=first;

if(first.d==value){
first=temp.next;
temp=null;
}
else{
while(temp.next!=null){
if(temp.next.d==value){
break;
}
temp = temp.next;
if(temp.next.next==null){
temp1=temp;
}
}
if(temp.next == null&&temp.d == value){
temp1.next=null;
temp=temp1;
}
else{
Node current=temp;
Node center=temp.next;
current.next=center.next;
center.next=null;
}
}
}


public String Display(){
Node current=first;
String output = "Head --- ";
while(current!=null)
{
output += current.d;
if(current.next != null)
output += " --- ";
current=current.next;
}

return output;
}
}


Auf dieser Seite können Sie das Online-Video Java: Create LinkedList using GUI mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer CODE ZERO 09 Dezember 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 4,627 Mal angesehen und es wurde von 78 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!