class stackLL private: class node public: //put what you need in here } ; node * top; public: stackLL() {} //Take care of memory leaks... --stackLL() {} //return true if empty, false if not bool empty()
Q: Enter the name of the item you purchasing. bag Enter the quantity and price separated by a space. 3 ...
A: Create a header file. Inside the main function declare the function for the input of items name and ...
Q: Please code in python Being tired of the challenging assignments given by the MCS Professors, stu...
A: According to the information given:- We have to follow the instruction mentioned to get desired outp...
Q: Experts need correct Answer else Again Will give you downvote What do you mean by process framework...
A: The Answer is in Below Steps
Q: Assume that a processor employs a memory address register (MAR), a memory buffer register (MBR), a p...
A: Below is the answer to the above question. I hope this will meet your requirement.
Q: Design two trading algorithms (agents) that have the ability to monitor the stocks through the obser...
A: Lets see the solution in the next steps
Q: Who is acknowledged as the inventor of the Intel Pentium microprocessor, and who is the inventor of ...
A: Introduction: Intel Corporation created the Pentium series of microprocessors. The Pentium micropro...
Q: What exactly is a gigabyte?
A: Answer: In computing, one gigabyte (GB) is one billion bytes of data storage space. A gigabyte is eq...
Q: 9. Let M = ({90, 41:42}; {a,b}, 8, qo; {q1}) be the NFA given by the state diagram: (a) Construct th...
A: We need to construct transition table and check for acceptance for the given NFA.
Q: python" Call the function tourism with the arguments 1 and 4 (in that order) and print the value the...
A: 0.30959752321981426
Q: Complexity The function accumulate operates on a list of n integers where each element was chosen in...
A: Answer: I have given answered in the handwritten format in brief explanation.
Q: Exactly what does the term "monochrome" mean?
A: Introduction: When we talk about a monochrome printer, we're talking about one that exclusively ...
Q: e VIN, make, model, year, color, asking price, number of miles, number of collisions, tire age, and ...
A: ERD for given database: No of entities : 1)SalesPerson entity : Attributes are { salespersonID ,name...
Q: Is anybody familiar with John von Neumann's basic schooling?
A: John von Neumann was former mathematician and computer scientist . He presented von Neumann architec...
Q: IN PYTHON Design a program that has the following: Inputs: Last Name, First Name, Middle Name, Birth...
A: Given The answer is given below.
Q: mention atleast 7 system evolutions for: An e-commercy grocery store system Thank you!
A: 7 system evolutions for: An e-commercy grocery store system is an given below : . Business model• R...
Q: What is the difference between cloud storage and local file storage?
A: Cloud storage is the technique of storing digital data in a multi-server, multi-location internet en...
Q: connecting a PC to a switch. Detail the quantity, store, item, price 50 feet away. What do you need...
A: For connection PC and Switch you will need both hardware and a cat5 cable also called ethernet cable...
Q: Does internal or external cloud storage exist?
A: Introduction: Cloud storage is a term used in computer science to describe one of the methods for st...
Q: The size of a colony of blue bacteria growing in a petri dish is modeled by the equation where ...
A: Editable source code: %use step size to get hourly increment t = 0:1/24:7; %given equations ...
Q: Given a graph with 14 edges. What is the missing value 'k' in the following degree sequence, 1, 2, 3...
A: Dear learner, hope you are doing well , I will try my best to answer this question. Thank You!!
Q: Plot the step response of the following system Overdamped G(s) R(S) ) =; 9 C(s) s2+9s +9 Overdamped ...
A: Solution
Q: What are the best practises for writing parallel programmes?
A: In the simplest terms, parallel programming is the act of dividing a problem into smaller jobs that ...
Q: Alice and Bob use the Diffie-Hellman key exchange process to agree on a shared key. Eve (the eavesdr...
A: Diffie-Hellman is an approach to creating a common mystery between two individuals so that the myste...
Q: Is the mainframe computer a relic of the industrial age?
A: The mainframe computer is a big, slow machine that’s still used in large organizations and governmen...
Q: A company wants to develop a group diary and a time management system for various executives. The gr...
A: Executive Assistant needs to be able to manage their calendars effectively: Proper scheduling manage...
Q: achieve performance improvement by using system engineering? What is the benefit of using modeling a...
A: given - What is the purpose of system engineering? How to achieve performance improvement by using s...
Q: Using the Entity Diagram below, create a python program with the different entity-relationship, fiel...
A: The Simple Banking System program is a straightforward Python-based project. Only the administrative...
Q: Develop a fictional ethical hacking scenario. Describe the scenario in enough detail that someone ca...
A: Answer: I have given answered in the brief explanation
Q: Write a program called Question1.java to store some details of computer boxes (serial number, manufa...
A: Program Explanation- Create an array of Computer references, initially empty i.e size 0. A loop tha...
Q: I was tasked with decoding this right here. It's for bonus points please helppp! It was given in tha...
A: Answer: I have given answered in the brief explanation
Q: Add a Makefile so that typing make compiles the program, reverse.c into the executable reverse.exec,...
A: Logically it’s seems impossible to write a C program without using a main() function. Since every pr...
Q: föllówing figuré šhóws à road nétwork. The Välue åssočiated With each arć is travel time in minutes....
A: The Chinese Postman Problem: It is a close cousin to finding an Euler cycle. Given a connected weigh...
Q: What does the "scroll lock" key do?
A: Scroll lock : A key on a standard extended keyboard, originally causing the arrow keys to scroll a w...
Q: What is a system unit
A: What is a System Unit and what are the common components inside the system unit? (watch the video in...
Q: Write a Java program to reverse a linked list. Assume the type of linked list will be integer.
A: Required:- Write a Java Program to reverse a linked list. Assume the type of linked list will be an ...
Q: QIA) Using asterisk (*) pattern to write a program in C++ to display such below style:
A: Answer is giving below-
Q: John von Neumann was married for how long?
A: On New Year's Day in 1930, von Neumann married Marietta Kovesi, who had studied economics at Budapes...
Q: In each of the following code snippets, data is copied from x to y. How many bytes of data are copie...
A: SUMMARY: -Hence, we discussed all the points.
Q: data scientist who works in the headquarter of a local bank. Assuming that you have sum model to hel...
A: Lets see the solution.
Q: What does a computer's output unit entail
A:
Q: Fill in the missing keyword to indicate a class inheriting from a interface: public class MyClass My...
A: Here, I have to provide an answer to the above question.
Q: Which mathematicians were influenced by John von Neumann's achievements?
A: The minimax theorem, which he developed in 1928, was a fundamental contribution to mathematical econ...
Q: In what ways does multicore architecture work?
A: Multi-core processor refers to architecture in which numerous processing units are are combined in a...
Q: For learning a predictive model describe the coefficient of determination and explicate its usefulne...
A: COEFFICIENT OF DETERMINATION: When forecasting the outcome of a particular event, the coefficient o...
Q: Use Matlab commands to load mat into the workspace, then use the information in the inventory variab...
A: According to the information given:- We have to write a Matlab code to create matrix.
Q: What are the prime purposes of including navigation in a presentation?
A: answer is
Q: a. Are these data categorical or quantitative? b. Provide frequency and percent frequency distributi...
A: In the given question, the data set is provided of the users visiting the English language website. ...
Q: Write an algorithm and draw a flowchart to check whether a person has been vaccinated. If vaccinatio...
A: algorithm and draw a flowchart to check whether a person has been vaccinated. If vaccination with a ...
Q: Assuming Alice and Bob are both EOA's, how many gas units are used for Alice to send Bob 10 Ether?
A: 0.001 ETH fixed fee per generated address, meaning if you send Ether to our address this fixed fee g...
Q: Program10.java Part 1: requires three files: Design and save your Motor class before you make Vehi...
A: Kindly Note: As per our guidelines we are supposed to answer only first question. Kindly repost othe...
please help in c++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- Code in java please import java.util.*;public class QueueLastname //<------ change the name of the class to include yourlast name{// no code goes here}class Queue{private ArrayList<String> q;public Queue( ){q = new ArrayList<String>();}public void enqueue(String num){q.add(num);}public String dequeue(){return q.remove(0);}/*This method goes through the quque and finds the longest name in the qThe queue must be restored in its original state after finding the longestname*/public String getLongestName(){Stack s = new Stack();String longest = q.get(0);// q.remove(0);boolean b = false;while(!b){try{String front = q.get(0);//get the first elementq.remove(0);//remove it from the qs.push(front);// push it to the stackif (front.length() > longest.length() )longest = front;}catch(Exception e){b = true;}}restore(s); // restoring the queuereturn longest; }/*Traverse through the queue and creates a string containing all the names.must restore the quque to its original…java: Implement the class Node public class Node { private char data; private Node nextNode; //implements default constructor //implements parameterize constructor take integer as input in parameter a assign that integer to data and assign null to nextNode //implement setters and getters } Implement the class Stack having one member having type Node public class Stack { private Node top; public void push (); public Node pop (); public Boolean isEmpty(); return true if stack is empty // implements all its function and write time complexity of its functionin java starting with an empty stack mimic the functionality of the back and forward button on modern browsers that is, at any point that the stack is not empty,allow a back function to display to previous page.also if you viewing a back page allow a forward button to go to the forward pages stack =[] go to page 1 - display page 1 - stack [page 1] go to page 2 - display page 2 -stack [page1,page 2] go back- display 1 - stack[ page1] go forward - display2 - [page 1 ,page 2] go to page 5- display page 5 -stack[page1,[age2,page5]
- A double-ended queue or deque (pronounced “deck”) is like a stack or a queue but supports adding and removing items at both ends. A deque stores a collection of items and supports the following API: public class Deque implements Iterable Deque() create an empty deque boolean isEmpty() is the deque empty? int size() number of items in the deque void pushLeft(Item item) add an item to the left end void pushRight(Item item) add an item to the right end Item popLeft() remove an item from the left end Item popRight() remove an item from the right end API for a generic double-ended queue Write a class Deque that uses a doubly-linked list to implement this API and a class ResizingArrayDeque that uses a resizing arrayCreate a class Stack. This stack will be implemented using the LinkedList class that has been provided. This stack will hold values of a generic type (<T>). Your Stack should have the following public methods: public void push(int n) public T pop() public T peek() public T size() public boolean isEmpty() public class LinkedList <T> { private Node head; private Node tail; private int size; public LinkedList() { head = null; tail = null; size = 0; } public void append(T data) { Node newNode = new Node(data); if (head == null) { head = newNode; } else { tail.next = newNode; } tail = newNode; size++; } public void prepend(T data) { Node newNode = new Node(data); if (head == null) { head = newNode; tail = newNode; } else { newNode.next = head; head = newNode; } size++; } public T getHead() { return head.data; } public T getTail() { return tail.data; } public int size() { return size; } public void removeByValue(T data) { Node current = head; while…Lab 4: Building a stack with two queuesProblem. Using two queues implement a stack as a class calledQueueStack. Build the following methods:1. push that adds an item to the top of the stack;2. pop that removes an item from the top of the stackand returns the removed item;3. peek that returns the item at the top of the stack;4. isEmpty that checks if the stack is empty.Estimate runtime complexities of the methods that you built.Hint. Use two queues queueIn and queueOut. The first queue queueInserves for pushing new items. When popping an item, move all the itemsbut the last one from queueIn to queueOut.queueIn [1 2 3 4 5] −→queueIn [5]queueOut [ ] −→queueOut [1 2 3 4]Now the item to be popped is in queueIn. Remove and return that asthe item on top of the stack.queueIn [ ]queueOut [1 2 3 4]Now you should swap the queues, so this algorithm may be repeatednext time when one has to pop the stack.queueIn [1 2 3 4]queueOut [ ] (ready for moving items)1
- Need help with python code. Write a LikedStack . Test it by: Add numbers from 7 to 22 in the stack. Print the length of the stack Check if the stack is empty Show the item on the top of the stack Remove the last item in the stack Add 45 to the stack Remove all items in the stack Check if the stack is empty """File: linkedstack.pyAuthor: Ken Lambert"""from node import Nodefrom abstractstack import AbstractStackclass LinkedStack(AbstractStack):"""A link-based stack implementation."""# Constructordef __init__(self, sourceCollection = None):"""Sets the initial state of self, which includes thecontents of sourceCollection, if it's present."""# Accessor methodsdef __iter__(self):"""Supports iteration over a view of self.Visits items from bottom to top of stack."""def visitNodes(node):"""Adds items to tempList from tail to head."""def peek(self):"""Returns the item at the top of the stack.Precondition: the stack is not empty.Raises: KeyError if the stack is empty."""if self.isEmpty():#…Write a java GUI program stacking Student objects of a class. Your program should have buttons for push, pop, and peek. Create a student class with these fields: name (type: String), age (type : int), major ( type: String), gpa (type: double) and gender (type:char). Use Java Stack class for implementation and use the GUI for user interaction. At run time books stored in stack should follow the last in First out (LIFO) of a stack.URGENT URGENT URGENT !!!! Write a void method swapStackwithQueue that takes MyStack and MyQueue Objects as parameters and exchanges the elements. a) The top element of the old stack becomes the rear element of the new queue. b b) and the rear element of the old queue becomes the top element of the new stack. The output should be similar to the image.
- In Java, The following is a class definition of a linked list Node: class Node{int info;Node next;}Assume that head references a linked list and stores in order, the int values 5, 2 and 9. Show the instructions needed to move the value 2 in front of the value 5 so that the list is now 2, 5 and 9.In java The following is a class definition of a linked list Node:class Node{int info;Node next;}Assume that head references a linked list and stores in order, the int values 5, 7 and 9. Show the instructions needed to delete the Node with 5 so that head would reference the list 7 and 9.class Polynomial: class TermNode:def __init__(self, coefficient: int, exponent: int) -> None:"""Initialize this node to represent a polynomial term with thegiven coefficient and exponent. Raise ValueError if the coefficent is 0 or if the exponentis negative."""if coefficient == 0:raise ValueError("TermNode: zero coefficient")if exponent < 0:raise ValueError("TermNode: negative exponent") self.coeff = coefficientself.exp = exponentself.next = None def __init__(self, coefficient: int = None, exponent: int = 0) -> None:"""Initialize this Polynomial with a single term constructed from thecoefficient and exponent. If one argument is given, the term is a constant coefficient(the exponent is 0).If no arguments are given, the Polynomial has no terms. # Polynomial with no terms:>>> p = Polynomial()>>> print(p._head)None>>> print(p._tail)None # Polynomial with one term (a constant):>>> p = Polynomial(12)>>> p._head.coeff12>>>…