Package adt

Examples of adt.LinkedList


import adt.LinkedList;

public class Q040_Reverse_alternate_nodes_and_append_at_the_end {

  public static void main(String[] args) {
    LinkedList list = new LinkedList(6);
    ListNode head = rearrange(list.head);
    head.print();
  }
View Full Code Here


import adt.LinkedList;

public class Q019_Alternating_Split_of_A_Given_Singly_Linked_List {

  public static void main(String[] args) {
    LinkedList list = new LinkedList(new int[]{0, 1, 0, 1, 0, 1});
    splitList(list);
  }
View Full Code Here

import adt.LinkedList;

public class Q005_Delete_A_Linked_List {
 
  public static void main(String[] args) {
    LinkedList list = new LinkedList(10);
   
    deleteList(list.head);
   
    list.print();
  }
View Full Code Here

import adt.LinkedList;

public class Q011_Recursive_Function_To_Print_Reverse_Of_A_Linked_List {

  public static void main(String[] args) {
    LinkedList list = new LinkedList(10);
    reversePrint(list);
  }
View Full Code Here

import adt.LinkedList;

public class Q027_Union_and_Intersection_of_two_Linked_Lists {

  public static void main(String[] args) {
    LinkedList a = new LinkedList(new int[]{10, 15, 4, 20});
    LinkedList b = new LinkedList(new int[]{8, 4, 2, 10});
   
    ListNode intersection = getIntersection(a.head, b.head);
    ListNode union = getUnion(a.head, b.head);
   
    intersection.print();
View Full Code Here

import adt.LinkedList;

public class Q006A_Reverse_Singly_Linked_List {

  public static void main(String[] args) {
    LinkedList list = new LinkedList(10);
    // 1. reverse iteratively
    reverse(list);
   
    // 2. reverse recursively
    list.head = reverseR(list.head);
   
    list.print();
  }
View Full Code Here

TOP

Related Classes of adt.LinkedList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.