SlideShare une entreprise Scribd logo
1  sur  1
class MyLinkedList2 // copy of MyLinkedList in Fig. 15.4 {
private class Node // inner class { private Node
link; private int x; } //----------------------------------
private Node first = null; // initial value is null //------------
---------------------- public void addFirst(int d) { Node
newNode = new Node(); // create new node newNode.x = d;
// init data field in new node newNode.link = first;
// new node points to first node first = newNode; //
first now points to new node } //--------------------------------
-- private void traverse(Node p) { if (p != null) {
System.out.println(p.x); // display data
traverse(p.link); // move p to next node } }
public void traverse() { traverse(first); } public void
reverseTest(); { Node p = first; if (p != null) {
System.out.println(p.x); traverse(p.link); //
move p to next node } } reverse(p); }
//==============================================
class TestMyLinkedList2 { public static void main(String[]
args) { MyLinkedList2 list2 = new MyLinkedList2();
list2.addFirst(1); list2.addFirst(2); list2.addFirst(3);
System.out.println("Numbers on list"); list2.traverse(); }
}

Contenu connexe

Similaire à class MyLinkedList2   copy of MyLinkedList in Fig. 15.4 {    priv.docx

C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdfC++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdfrohit219406
 
C++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdfC++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdfarjunenterprises1978
 
I need help coding a doubly linked list from this unfinished code- Eve.docx
I need help coding a doubly linked list from this unfinished code- Eve.docxI need help coding a doubly linked list from this unfinished code- Eve.docx
I need help coding a doubly linked list from this unfinished code- Eve.docxPaulntmMilleri
 
Program to insert in a sorted list #includestdio.h#include.pdf
 Program to insert in a sorted list #includestdio.h#include.pdf Program to insert in a sorted list #includestdio.h#include.pdf
Program to insert in a sorted list #includestdio.h#include.pdfsudhirchourasia86
 
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfPlease do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfaioils
 
Below is a depiction of a doubly-linked list implementation of the bag.docx
Below is a depiction of a doubly-linked list implementation of the bag.docxBelow is a depiction of a doubly-linked list implementation of the bag.docx
Below is a depiction of a doubly-linked list implementation of the bag.docxgilliandunce53776
 
I need help completing this C++ code with these requirements.instr.pdf
I need help completing this C++ code with these requirements.instr.pdfI need help completing this C++ code with these requirements.instr.pdf
I need help completing this C++ code with these requirements.instr.pdfeyeonsecuritysystems
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfJamesPXNNewmanp
 
A)B) C++ program to create a Complete Binary tree from its Lin.pdf
A)B) C++ program to create a Complete Binary tree from its Lin.pdfA)B) C++ program to create a Complete Binary tree from its Lin.pdf
A)B) C++ program to create a Complete Binary tree from its Lin.pdfanton291
 
How to do insertion sort on a singly linked list with no header usin.pdf
How to do insertion sort on a singly linked list with no header usin.pdfHow to do insertion sort on a singly linked list with no header usin.pdf
How to do insertion sort on a singly linked list with no header usin.pdfarihantelehyb
 
Implement a priority queue using a doublyLinked-cpp where the node wit.pdf
Implement a priority queue using a doublyLinked-cpp where the node wit.pdfImplement a priority queue using a doublyLinked-cpp where the node wit.pdf
Implement a priority queue using a doublyLinked-cpp where the node wit.pdfBlakeY8lBucklandh
 
C code on linked list #include stdio.h #include stdlib.h.pdf
 C code on linked list #include stdio.h #include stdlib.h.pdf C code on linked list #include stdio.h #include stdlib.h.pdf
C code on linked list #include stdio.h #include stdlib.h.pdfdeepua8
 
Write a program to implement below operations with both singly and d.pdf
Write a program to implement below operations with both singly and d.pdfWrite a program to implement below operations with both singly and d.pdf
Write a program to implement below operations with both singly and d.pdfthangarajarivukadal
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdfConint29
 
Exception to indicate that Singly LinkedList is empty. .pdf
  Exception to indicate that Singly LinkedList is empty. .pdf  Exception to indicate that Singly LinkedList is empty. .pdf
Exception to indicate that Singly LinkedList is empty. .pdfaravlitraders2012
 
Templated Binary Tree implementing function help I need to im.pdf
Templated Binary Tree implementing function help I need to im.pdfTemplated Binary Tree implementing function help I need to im.pdf
Templated Binary Tree implementing function help I need to im.pdfmanjan6
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfkingsandqueens3
 
#include <stdio.h> #include <malloc.h> #define ISEMP.pdf
#include <stdio.h> #include <malloc.h> #define ISEMP.pdf#include <stdio.h> #include <malloc.h> #define ISEMP.pdf
#include <stdio.h> #include <malloc.h> #define ISEMP.pdfharihelectronicspune
 
write recursive function that calculates and returns the length of a.pdf
write recursive function that calculates and returns the length of a.pdfwrite recursive function that calculates and returns the length of a.pdf
write recursive function that calculates and returns the length of a.pdfarpitcomputronics
 
Help to implement delete_node get_succ get_pred walk and.pdf
Help to implement delete_node get_succ get_pred walk and.pdfHelp to implement delete_node get_succ get_pred walk and.pdf
Help to implement delete_node get_succ get_pred walk and.pdfcontact32
 

Similaire à class MyLinkedList2   copy of MyLinkedList in Fig. 15.4 {    priv.docx (20)

C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdfC++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
 
C++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdfC++Write a method Node Nodereverse() which reverses a list..pdf
C++Write a method Node Nodereverse() which reverses a list..pdf
 
I need help coding a doubly linked list from this unfinished code- Eve.docx
I need help coding a doubly linked list from this unfinished code- Eve.docxI need help coding a doubly linked list from this unfinished code- Eve.docx
I need help coding a doubly linked list from this unfinished code- Eve.docx
 
Program to insert in a sorted list #includestdio.h#include.pdf
 Program to insert in a sorted list #includestdio.h#include.pdf Program to insert in a sorted list #includestdio.h#include.pdf
Program to insert in a sorted list #includestdio.h#include.pdf
 
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfPlease do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
 
Below is a depiction of a doubly-linked list implementation of the bag.docx
Below is a depiction of a doubly-linked list implementation of the bag.docxBelow is a depiction of a doubly-linked list implementation of the bag.docx
Below is a depiction of a doubly-linked list implementation of the bag.docx
 
I need help completing this C++ code with these requirements.instr.pdf
I need help completing this C++ code with these requirements.instr.pdfI need help completing this C++ code with these requirements.instr.pdf
I need help completing this C++ code with these requirements.instr.pdf
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
 
A)B) C++ program to create a Complete Binary tree from its Lin.pdf
A)B) C++ program to create a Complete Binary tree from its Lin.pdfA)B) C++ program to create a Complete Binary tree from its Lin.pdf
A)B) C++ program to create a Complete Binary tree from its Lin.pdf
 
How to do insertion sort on a singly linked list with no header usin.pdf
How to do insertion sort on a singly linked list with no header usin.pdfHow to do insertion sort on a singly linked list with no header usin.pdf
How to do insertion sort on a singly linked list with no header usin.pdf
 
Implement a priority queue using a doublyLinked-cpp where the node wit.pdf
Implement a priority queue using a doublyLinked-cpp where the node wit.pdfImplement a priority queue using a doublyLinked-cpp where the node wit.pdf
Implement a priority queue using a doublyLinked-cpp where the node wit.pdf
 
C code on linked list #include stdio.h #include stdlib.h.pdf
 C code on linked list #include stdio.h #include stdlib.h.pdf C code on linked list #include stdio.h #include stdlib.h.pdf
C code on linked list #include stdio.h #include stdlib.h.pdf
 
Write a program to implement below operations with both singly and d.pdf
Write a program to implement below operations with both singly and d.pdfWrite a program to implement below operations with both singly and d.pdf
Write a program to implement below operations with both singly and d.pdf
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
 
Exception to indicate that Singly LinkedList is empty. .pdf
  Exception to indicate that Singly LinkedList is empty. .pdf  Exception to indicate that Singly LinkedList is empty. .pdf
Exception to indicate that Singly LinkedList is empty. .pdf
 
Templated Binary Tree implementing function help I need to im.pdf
Templated Binary Tree implementing function help I need to im.pdfTemplated Binary Tree implementing function help I need to im.pdf
Templated Binary Tree implementing function help I need to im.pdf
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
 
#include <stdio.h> #include <malloc.h> #define ISEMP.pdf
#include <stdio.h> #include <malloc.h> #define ISEMP.pdf#include <stdio.h> #include <malloc.h> #define ISEMP.pdf
#include <stdio.h> #include <malloc.h> #define ISEMP.pdf
 
write recursive function that calculates and returns the length of a.pdf
write recursive function that calculates and returns the length of a.pdfwrite recursive function that calculates and returns the length of a.pdf
write recursive function that calculates and returns the length of a.pdf
 
Help to implement delete_node get_succ get_pred walk and.pdf
Help to implement delete_node get_succ get_pred walk and.pdfHelp to implement delete_node get_succ get_pred walk and.pdf
Help to implement delete_node get_succ get_pred walk and.pdf
 

Plus de needhamserena

Class type History since 1945Paper type Reaearch paper L.docx
Class type History since 1945Paper type Reaearch paper L.docxClass type History since 1945Paper type Reaearch paper L.docx
Class type History since 1945Paper type Reaearch paper L.docxneedhamserena
 
Class,One of the areas we will be discussing this week is .docx
Class,One of the areas we will be discussing this week is .docxClass,One of the areas we will be discussing this week is .docx
Class,One of the areas we will be discussing this week is .docxneedhamserena
 
Class type History since 1945Paper type Reaearch paper Length-.docx
Class type History since 1945Paper type Reaearch paper Length-.docxClass type History since 1945Paper type Reaearch paper Length-.docx
Class type History since 1945Paper type Reaearch paper Length-.docxneedhamserena
 
Class type History since 1945Paper type Reaearch paper Len.docx
Class type History since 1945Paper type Reaearch paper Len.docxClass type History since 1945Paper type Reaearch paper Len.docx
Class type History since 1945Paper type Reaearch paper Len.docxneedhamserena
 
Class Transportation EconomicsQuestionDescribe the major com.docx
Class Transportation EconomicsQuestionDescribe the major com.docxClass Transportation EconomicsQuestionDescribe the major com.docx
Class Transportation EconomicsQuestionDescribe the major com.docxneedhamserena
 
Class type History since 1945Paper type Reaearch paper Lengt.docx
Class type History since 1945Paper type Reaearch paper Lengt.docxClass type History since 1945Paper type Reaearch paper Lengt.docx
Class type History since 1945Paper type Reaearch paper Lengt.docxneedhamserena
 
Class Project build a data warehouse and to do a presentation of t.docx
Class Project build a data warehouse and to do a presentation of t.docxClass Project build a data warehouse and to do a presentation of t.docx
Class Project build a data warehouse and to do a presentation of t.docxneedhamserena
 
Class Exercise – Module 6 (Workplace Law)Hardie is a printer w.docx
Class Exercise – Module 6 (Workplace Law)Hardie is a printer w.docxClass Exercise – Module 6 (Workplace Law)Hardie is a printer w.docx
Class Exercise – Module 6 (Workplace Law)Hardie is a printer w.docxneedhamserena
 
Class Exercise – Module 8 – Real PropertyHarvey sold his house.docx
Class Exercise – Module 8 – Real PropertyHarvey sold his house.docxClass Exercise – Module 8 – Real PropertyHarvey sold his house.docx
Class Exercise – Module 8 – Real PropertyHarvey sold his house.docxneedhamserena
 
Class is Social Responsibility Write a 2-page analysis connectin.docx
Class is Social Responsibility Write a 2-page analysis connectin.docxClass is Social Responsibility Write a 2-page analysis connectin.docx
Class is Social Responsibility Write a 2-page analysis connectin.docxneedhamserena
 
Class Exercise – Module 5 - CorporationsKelly is a director of I.docx
Class Exercise – Module 5 - CorporationsKelly is a director of I.docxClass Exercise – Module 5 - CorporationsKelly is a director of I.docx
Class Exercise – Module 5 - CorporationsKelly is a director of I.docxneedhamserena
 
Class EDU 160 Child Developement and HealthPEAssignment Colle.docx
Class EDU 160 Child Developement and HealthPEAssignment Colle.docxClass EDU 160 Child Developement and HealthPEAssignment Colle.docx
Class EDU 160 Child Developement and HealthPEAssignment Colle.docxneedhamserena
 
Class Ethical Decision Making Through FilmAssignment 1500 WORD.docx
Class Ethical Decision Making Through FilmAssignment 1500 WORD.docxClass Ethical Decision Making Through FilmAssignment 1500 WORD.docx
Class Ethical Decision Making Through FilmAssignment 1500 WORD.docxneedhamserena
 
Clarify the differences between referential and expressive language..docx
Clarify the differences between referential and expressive language..docxClarify the differences between referential and expressive language..docx
Clarify the differences between referential and expressive language..docxneedhamserena
 
Class INF220Each discussion must be at least 200 words.docx
Class  INF220Each discussion must be at least 200 words.docxClass  INF220Each discussion must be at least 200 words.docx
Class INF220Each discussion must be at least 200 words.docxneedhamserena
 
CJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docx
CJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docxCJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docx
CJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docxneedhamserena
 
CJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docx
CJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docxCJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docx
CJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docxneedhamserena
 
CJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docx
CJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docxCJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docx
CJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docxneedhamserena
 
CJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docx
CJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docxCJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docx
CJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docxneedhamserena
 
CJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docx
CJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docxCJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docx
CJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docxneedhamserena
 

Plus de needhamserena (20)

Class type History since 1945Paper type Reaearch paper L.docx
Class type History since 1945Paper type Reaearch paper L.docxClass type History since 1945Paper type Reaearch paper L.docx
Class type History since 1945Paper type Reaearch paper L.docx
 
Class,One of the areas we will be discussing this week is .docx
Class,One of the areas we will be discussing this week is .docxClass,One of the areas we will be discussing this week is .docx
Class,One of the areas we will be discussing this week is .docx
 
Class type History since 1945Paper type Reaearch paper Length-.docx
Class type History since 1945Paper type Reaearch paper Length-.docxClass type History since 1945Paper type Reaearch paper Length-.docx
Class type History since 1945Paper type Reaearch paper Length-.docx
 
Class type History since 1945Paper type Reaearch paper Len.docx
Class type History since 1945Paper type Reaearch paper Len.docxClass type History since 1945Paper type Reaearch paper Len.docx
Class type History since 1945Paper type Reaearch paper Len.docx
 
Class Transportation EconomicsQuestionDescribe the major com.docx
Class Transportation EconomicsQuestionDescribe the major com.docxClass Transportation EconomicsQuestionDescribe the major com.docx
Class Transportation EconomicsQuestionDescribe the major com.docx
 
Class type History since 1945Paper type Reaearch paper Lengt.docx
Class type History since 1945Paper type Reaearch paper Lengt.docxClass type History since 1945Paper type Reaearch paper Lengt.docx
Class type History since 1945Paper type Reaearch paper Lengt.docx
 
Class Project build a data warehouse and to do a presentation of t.docx
Class Project build a data warehouse and to do a presentation of t.docxClass Project build a data warehouse and to do a presentation of t.docx
Class Project build a data warehouse and to do a presentation of t.docx
 
Class Exercise – Module 6 (Workplace Law)Hardie is a printer w.docx
Class Exercise – Module 6 (Workplace Law)Hardie is a printer w.docxClass Exercise – Module 6 (Workplace Law)Hardie is a printer w.docx
Class Exercise – Module 6 (Workplace Law)Hardie is a printer w.docx
 
Class Exercise – Module 8 – Real PropertyHarvey sold his house.docx
Class Exercise – Module 8 – Real PropertyHarvey sold his house.docxClass Exercise – Module 8 – Real PropertyHarvey sold his house.docx
Class Exercise – Module 8 – Real PropertyHarvey sold his house.docx
 
Class is Social Responsibility Write a 2-page analysis connectin.docx
Class is Social Responsibility Write a 2-page analysis connectin.docxClass is Social Responsibility Write a 2-page analysis connectin.docx
Class is Social Responsibility Write a 2-page analysis connectin.docx
 
Class Exercise – Module 5 - CorporationsKelly is a director of I.docx
Class Exercise – Module 5 - CorporationsKelly is a director of I.docxClass Exercise – Module 5 - CorporationsKelly is a director of I.docx
Class Exercise – Module 5 - CorporationsKelly is a director of I.docx
 
Class EDU 160 Child Developement and HealthPEAssignment Colle.docx
Class EDU 160 Child Developement and HealthPEAssignment Colle.docxClass EDU 160 Child Developement and HealthPEAssignment Colle.docx
Class EDU 160 Child Developement and HealthPEAssignment Colle.docx
 
Class Ethical Decision Making Through FilmAssignment 1500 WORD.docx
Class Ethical Decision Making Through FilmAssignment 1500 WORD.docxClass Ethical Decision Making Through FilmAssignment 1500 WORD.docx
Class Ethical Decision Making Through FilmAssignment 1500 WORD.docx
 
Clarify the differences between referential and expressive language..docx
Clarify the differences between referential and expressive language..docxClarify the differences between referential and expressive language..docx
Clarify the differences between referential and expressive language..docx
 
Class INF220Each discussion must be at least 200 words.docx
Class  INF220Each discussion must be at least 200 words.docxClass  INF220Each discussion must be at least 200 words.docx
Class INF220Each discussion must be at least 200 words.docx
 
CJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docx
CJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docxCJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docx
CJUS300Sarah Harris, your supervisor at the pretrial diversion pro.docx
 
CJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docx
CJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docxCJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docx
CJUS300Cindy Hart is 23 years of age. She was born on 61186, the.docx
 
CJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docx
CJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docxCJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docx
CJHS311-1501B-01 Study of Alcohol Use and AbuseTask NamePhase 2.docx
 
CJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docx
CJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docxCJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docx
CJHS315-1404B-01 Child AbuseTask NamePhase 1 Individual Project.docx
 
CJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docx
CJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docxCJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docx
CJA 314 Week 1 DQ 1Discuss a specific type of crime and its subseq.docx
 

Dernier

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Dernier (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

class MyLinkedList2   copy of MyLinkedList in Fig. 15.4 {    priv.docx

  • 1. class MyLinkedList2 // copy of MyLinkedList in Fig. 15.4 { private class Node // inner class { private Node link; private int x; } //---------------------------------- private Node first = null; // initial value is null //------------ ---------------------- public void addFirst(int d) { Node newNode = new Node(); // create new node newNode.x = d; // init data field in new node newNode.link = first; // new node points to first node first = newNode; // first now points to new node } //-------------------------------- -- private void traverse(Node p) { if (p != null) { System.out.println(p.x); // display data traverse(p.link); // move p to next node } } public void traverse() { traverse(first); } public void reverseTest(); { Node p = first; if (p != null) { System.out.println(p.x); traverse(p.link); // move p to next node } } reverse(p); } //============================================== class TestMyLinkedList2 { public static void main(String[] args) { MyLinkedList2 list2 = new MyLinkedList2(); list2.addFirst(1); list2.addFirst(2); list2.addFirst(3); System.out.println("Numbers on list"); list2.traverse(); } }