c) Create Main class • Create a new List of type MyLinkedList • Insert some alphabets of the English Language to the list • Display all the alphabets in the List • Search for a particular alphabet in the List and print true or false • Sort the List and display it • Delete a node in the List and display the list • Insert alphabet to a particular position in the List and display it • Delete the List
(java )
import java.util.*;
class Main{
public static void main(String args[]){
ArrayList<Character> alist=new ArrayList<Character>();
alist.add("f");
alist.add("d");
alist.add("c");
alist.add("b");
alist.add("a");
alist.add("e");
//displaying elements
System.out.println(alist);
System.out.println( list.contains("b") );
Collections.sort(alist);
//displaying elements
System.out.println(alist);
alist.remove("f");
System.out.println(alist);
alist.add(3, "n");
System.out.println(alist);
alist.clear();
System.out.println("list was deleted");
} }
c) Create Main class • Create a new List of type MyLinkedList • Insert some alphabets...