1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Assoli18 [71]
2 years ago
6

Write a program using LinkedList class and ListIterator interface to demonstrate the following activities:

Computers and Technology
1 answer:
babunello [35]2 years ago
3 0

The program is an illustration of LinkedList.

<h3>What is a LinkedList?</h3>

A LinkedList is a data structure element that contains nodes where each node represents a value and also points to the next node.

<h3>The main program</h3>

The program written in Java, where comments are used to explain each line of the program is as follows:

import java.util.LinkedList;

import java.util.Iterator;

class Main {

 public static void main(String[] args) {

     //This creates the Alphabets LinkedList

   LinkedList<String> Alphabets = new LinkedList<String>();

   //This creates an iterator for the Alphabets LinkedList

   Iterator it = Alphabets.iterator();

   //This adds P, Q, R and T to the list

   Alphabets.add("P");    Alphabets.add("Q");    Alphabets.add("R");    Alphabets.add("T");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This adds O to the beginning of the list

   Alphabets.addFirst("O");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This adds U to the list

   Alphabets.add("U");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This adds S after R

   Alphabets.add(4,"S");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This removes O and Q from the list

   Alphabets.remove("O"); Alphabets.add("Q");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

 }

}

Read more about LinkedList at:

brainly.com/question/19754898

You might be interested in
Can someone help me with these questions on linear dimensions pls
andrew-mc [135]
Size dimentions reffer to overall dimentions and will tell the overall width, lenth height and depth of something location dimentions means the locatuon of each geometric shape.
7 0
3 years ago
Read 2 more answers
A wired laser printer is attached to a home computer. That printer has been shared so that other computers on the home network c
ohaa [14]

Answer:

peer-to-peer (P2P)

Explanation:

P2P peer-to-peer networking model is in use

3 0
3 years ago
And there you go <br> sorry its saying my thing is tooo small
zaharov [31]

Answer:

Global knowledge is the answer

6 0
4 years ago
Read 2 more answers
Why OSI is called open system?
MAXImum [283]

Answer: OSI system is called Open System Interconnection because It provides the collection of protocols for the connection of different system to connect with  any dependence on any other system or network.

Explanation: Open system interconnection establishes a connection between the different system for the communication purpose using several protocols and software standards .It has no dependency or any network or other system to do the functioning and works using the seven layers of the OSI architecture.Thus, that is why OSI system known as open system.

7 0
4 years ago
What are some examples for Environmental Technology? Also some negative and positive effects?
lakkis [162]
Wave energy and wind power (also hydroelectric dams as well), they create energy without pollution but need a lot of maintenance and some people disagree with their aesthetic influence of the countryside as they are very industrial looking  <span />
5 0
3 years ago
Other questions:
  • With iteration-control systems, each team member ________. is given an account with a set of permissions is given their own priv
    6·1 answer
  • Assume that the following table is created and stored in your database:
    5·1 answer
  • In an average case involving an array of n elements, how many times will a sequential search function have to read the array to
    13·1 answer
  • How do I make sure I have full access to this app where do I put in payment information
    8·1 answer
  • Before posting a picture online, make sure to
    7·1 answer
  • How many basic elements of QBASIC are there
    14·1 answer
  • Activity 8. Direction: Read the article and make an outline. Be guided by the rubric for outlining. Write your answer on a separ
    15·1 answer
  • I've been stuck on these two basic javascript assignments for an embarrassingly long time. The teacher refuses to help me and th
    13·1 answer
  • A multinational pharmaceutical company used a saffron trident in a promotional campaign for one of its drugs in India. The saffr
    5·1 answer
  • Which ipconfig command switch would a technician use to display detailed information (such as dns servers and mac addresses)?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!