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
Adjust list by normalizing When analyzing data sets, such as data for human heights or for human weights, a common step is to ad
finlep [7]

Answer:

I've implemented this program using python

userinput = int(input("Length: "))

mylist = []

mylist.append(userinput)

for i in range(1,userinput+1):

   userinp = int(input("Input: "))

   mylist.append(userinp)

smallval = mylist[1]

for i in range(1,len(mylist)):

   if smallval > mylist[i]:

       smallval = mylist[i]

for i in range(1,len(mylist)):

   mylist[i] = mylist[i] - smallval

for i in range(1,len(mylist)):

   print(mylist[i],end=' ')

Explanation:

I've added the full source program as an attachment where I used comments to explain difficult lines

4 0
2 years ago
What symbol should you look for to determine who owns the intellectual property of a website? the logo the web address the domai
devlian [24]

Answer:

Answer:

the logo of the company or corporation

Explanation:

Usually, the symbol that determines who owns the intellectual property is the logo of the company or corporation. The logo of a website is technically the logo of the brand which has the rights to all of the information represented on the site and ultimately the intellectual property of the site itself. Since there are various board members that usually make up the company that owns the intellectual property, the logo is a way of representing all of these members as a single entity.

8 0
2 years ago
Read 2 more answers
Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less
Ad libitum [116K]

Answer:

#include<iostream>//library inclusion

using namespace std;

int main()

{

int userInput;

do//start of do while loop

{

 cout << "Enter a number less than a 100" << endl;

 cin >> userInput;

 if (userInput < 100) //condition

 {

  cout << "YOu entered less than a hundred: " << userInput << endl;

 }

 else

 {

  cout << "your number is greater than 100" << endl;

 }

} while (userInput > 100);//condition for do while

return 0;//termination of int main

}

Explanation:

The program has been commented for you. The do-while loop enters the first loop regardless of the condition. Then after the first iteration, it checks for the condition. If the condition is being met, it will iterate through, again. Otherwise it will break out of the loop and land on the "return 0;" line. Which also happens to be the termination of the program in this case. The if-else condition is used for the user to see when prompted.

6 0
2 years ago
Does C supports STRINGS as a data type?
Nat2105 [25]

Answer:

C language does not support strings as a data type. A string is actually one-dimensional array of characters in C language. These are often used to create meaningful and readable programs.

Explanation:

6 0
1 year ago
You have a Mobile Legends account???<br>Can I play with You???​
yulyashka [42]

Answer:

yes oo you want to play with me

7 0
2 years ago
Other questions:
  • What would be one advantage and one risk of using an electric car?
    14·2 answers
  • How would you define the rule of thirds?
    11·1 answer
  • What are the advantages to using a linked implementation as opposed to an array implementation?
    8·1 answer
  • Why might reading a product review be a good idea before purchasing a product?
    5·2 answers
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • Hello my name is Phoenix I will like for you to friend me on Ro blox my user name is Jessiahcoleman and if u play BLOX fruits or
    13·1 answer
  • marianne needs to create a version of her slide presentation that does not include all the slides and will be used for a particu
    9·1 answer
  • If you can photoshop please text me i need help for my digital media class 7862381441
    9·1 answer
  • An online bank wants you to create a program that shows prospective
    12·1 answer
  • Posts that you delete
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!