SingleLinkedListApplication (1).java - To change this license header choose License Headers in Project Properties To change this template file choose

SingleLinkedListApplication (1).java - To change this...

This preview shows page 1 out of 1 page.

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package singlelinkedlistapplication; public class SingleLinkedListApplication { public static void main(String[] args) { SinglLinkedList sll = new SinglLinkedList(); //--------------------------------------------------------- // نيملا عبت لاؤسلا يف لا دوكلا اوبتكا انه /*---- اوقبط مث تنموكلا عبت ريخلا رطسلا و رطسلا اذه اوفذحا هوتقبط اذا دوكلا -------------------------------------------------------- sll.insertFirst(2); sll.insertLast(3); sll.insertLast(7); //////--------------------------------------------------------
Image of page 1

Unformatted text preview: SinglLinkedList sll1 = new SinglLinkedList(); sll1.insertFirst(5); sll1.insertLast(6); sll1.insertLast(7); sll1.insertLast(8); System.out.println("number of node in list 1 = " + sll1.count()); //display list 1; sll1.display_list(); //reverse list1 sll1.reverse(); //dispaly after reverse sll1.display_list(); //union sll and sll1 in sll2 SinglLinkedList sll2 = new SinglLinkedList(); sll2.Union(sll, sll1); //print ssl2 after union sll2.display_list(); //find intersect of sll and sll1 and store it in sll3 SinglLinkedList sll3= new SinglLinkedList(); sll3.Intersect(sll, sll1); //print intersect sll3.display_list(); *///------------------قوف لا عم رطسلا اذه اوفذحا } }...
View Full Document

  • Fall '10
  • Galvin

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes