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
What is the importance of the international employment​
My name is Ann [436]

Answer:

People who went overseas to work can learn different skills and technologies which can be beneficial for the development of our own country.

7 0
3 years ago
Read 2 more answers
The file includes 4993 tweets including the keyword 'election'. Each tweet is represented in a separate line. Write a program to
Likurg_2 [28]

Answer:

import re

with open("../../Downloads/Tweets.txt","r", encoding="utf-8") as tweets:

   myfile = tweets.readlines()

   for item in myfile:

       item = item.rstrip()

       mylist = re.findall("^RT (.*) ", item)

       if len(mylist) !=0:

           for line in mylist:

               if line.count("#") >=1:

                   ln = line.split("#")

                   dm = ln[1]

                   print(f"#{dm}")

Explanation:

The python source code filters the document file "Tweets" to return all tweets with a hashtag flag, discarding the rest.

7 0
2 years ago
All of the following are examples of extracurricular activities except:
mart [117]
A, because normally that would be a requirment
8 0
3 years ago
Read 2 more answers
What do you understand by technological depenence?
son4ous [18]

Answer:

It helps you understand stuff faster

Explanation:

7 0
3 years ago
What kind of software would you use to view and troubleshoot protocol-specific problems such as TCP retries caused by missed ack
sveticcg [70]

Answer:

The kind of software to use is a protocol analyser.

Explanation:

The Protocol analyser, which could either be a hardware or a software is a tool that is used for capturing and analysing signals and also interpreting network traffic over a communication channel or between two or more connected computer systems

Protocol analysers can be used to find out location of problems on Local Area Network by examining flow of traffic.

7 0
3 years ago
Other questions:
  • How do i build a supercomputer.?
    11·1 answer
  • Gabe Kelp is a fourteen-year-old goalie for the Soaring Eagles soccer team. He and his teammates are each creating a screen name
    11·1 answer
  • . Each ____ on a menu performs a specific action.
    14·1 answer
  • A system is composed of four parts, J, K, L, and M. All four must function for the system to function. The four component reliab
    6·1 answer
  • If the user loads this graphic in a text only browser how will the browser describe it?
    11·2 answers
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • ......... mi2hej<br><br>ejid8eo19o1b2bxhxjxjdnneejk2929nr
    5·2 answers
  • What when can you expect technology to be effective?
    12·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • What is a disruptive technology? Give an example of an aspect of society that has been impacted by technological change.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!