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
joja [24]
3 years ago
9

code a class named sllqueue that uses a double-ended singly linked list to implement a queue as described in this chapter. provi

de a driver program that demonstrates the constructor, enqueue and dequeue methods function properly
Engineering
1 answer:
julia-pushkina [17]3 years ago
6 0

Answer:

See attached file please.

Explanation:

See attached file for detailed explanation and code.

import java.util.*;

class LinklistImplementQueue {  

public static void main(String[] args)

{

Scanner scan = new Scanner(System.in);

/* Creating object of class SLLQueue */    

SLLQueue lq = new SLLQueue();

char ch;

do

{

System.out.println("\nQueue Operations");

System.out.println("1. ENQUEUE");

System.out.println("2. DEQUEUE");

int choice = scan.nextInt();

.

.

.

.

See attached file for complete code.

Download txt
You might be interested in
Multiple poles at the origin. Sketch the asymptotes of the Bode plot magnitude and phase for each of the listed open-loop transf
pogonyaev

Answer:

a la 1/s^2(s + 10)

Explanation:

I got it right on math lab

4 0
3 years ago
Remember from Lab 3C that Mad Libs are activities that have a person provide various words, which are then used to complete a sh
Harlamova29_29 [7]

Answer:

Python code is explained below

Explanation:

CODE(TEXT): -

9A.py:-

def sentence(): #function to read input and display

  name = input("Enter a name: ") #input name

  place = input("Enter a place: ") #input place

  number = int(input("Enter a number: ")) #input number typecasted to int

  noun = input("Enter a plural noun: ") #input plural noun

  adjective = input("Enter an adjective: ") #input adjective

  print("\n{} went to {} to buy {} different types of {}".format(name, place, number, noun)) #format is used to display o/p

  print("but unfortunately, the {} were all {} so {} went back to {} to return them.\n".format(noun, adjective,name, place))

op = "n" #initially op = n i.e. user not wanting to quit

while op != "y" : #while user does not input y

  sentence() #input words from user

  op = input("Do you want to quit [y/n]? ") #prompt to continue or quit

  if op == "y": #if yes then print goodbye and exit

      print("Goodbye")

      break

  else: #else print newline and take input

      print("")

9B.py: -

#inputs are strings by default applying a split() function to a string splits it into a list of strings

#then with the help of map() function we can convert all the strings into integers

numbers = list(map(int, input("Enter the input: ").split()))

sum = 0 #sum is initially 0

for i in range(len(numbers)): #loops for all the elements in the list

  sum = sum + numbers[i] #add the content of current element to sum

avg = sum/ len(numbers) #average = (sum of all elements)/ number of elements in the list

max = numbers[0] #initially max = first number

for i in range(1, len(numbers)): #loops for all remaining elements

  if numbers[i] > max : #if their content is greater than max

      max = numbers[i] #update max

print("The average and max are: {:.2f} {}".format(avg, max)) #format is used to print in formatted form

#.2f is used to print only 2 digits after decimals

9C.py: -

#inputs are strings by default applying a split() function to a string splits it into a list of strings

#then with the help of map() function we can convert all the strings into integers

numbers = list(map(int, input("Enter a list of numbers: ").split()))

numbers = [elem for elem in numbers if elem >= 0] #using list comprehension

#loops for all elements of the list and keep only those who are >= 0

numbers.sort() #list inbuilt function to sort items

print("The non-negative and sorted numbers are: ", end = "")

for num in numbers: #for all numbers in the list print them

  print("{} ".format(num), end = "")

7 0
4 years ago
Gawain 2 talasalitaan
sukhopar [10]
N dnkdicwnjxiwkxdndjdjdj
7 0
3 years ago
A pin connection supports a load. Which type of connection would result in the smallest shear stress in the pin
Viktor [21]

Answer:

A single- shear pin connection.

Explanation:

8 0
2 years ago
Air flows from a large reservoir in which the pressure and temperature are 1 MPa and 30°C, respectively, through a convergent–di
SSSSS [86.1K]

Answer:

The solution is attached in the attachment.

3 0
3 years ago
Read 2 more answers
Other questions:
  • A Vector is a quantity that has magnitude, direction, and sense. a)-True b)- False
    12·1 answer
  • Show that a chirped Gaussian pulse is compressed initially inside a single-mode fiber when ftC < 0. Derive expressions for th
    12·1 answer
  • Programming Assignment 2 Decimal and IEEE-754 ConversionsObjective: To write a C program (not C++) that converts numbers between
    6·1 answer
  • In 1903, Aegidius Elling of Norway designed and built an 11-hp gas turbine that used steam injection between the combustion cham
    13·1 answer
  • What is your opinion on environmental art? Do you consider it art? What about the trans-species art you read about? Do you think
    9·2 answers
  • Which Salesforce editions provide option for customizing profiles?
    13·1 answer
  • What is working fluid and mention five example of working fluid.​
    14·2 answers
  • Any one be my sister​
    15·2 answers
  • A skull and crossbones pictogram indicates this kind of information about a chemical.
    14·1 answer
  • A transformer has a 120/208-volt wye secondary. If the current in each of the secondary coils (or windings) is 75 amps, what is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!