What does this method of playerlinkedlist class do

Assignment Help C/C++ Programming
Reference no: EM13939914

The linked list that follows represents a stack. After we push the player (5, Joe, Sonic) onto the stack, what are first and last items on the stack?
(7,Ajay, NFL) -> (3, Sarah, Mario) -> (9, Jin, Golf) -> null
head

(7, Ajay, NFL0 and (9, Jin, Golf)
(5, Joe, Sonic) and (9, Jin, Golf)
(3, Sarah, Mario) and (5, Joe, Sonic)
(7, Ajay, NFL) and (5, Joe, Sonic)

A=

- The diagram that follows shows the current state of the stack represented by an array of 50 integers. After pushing 36, 88, and 62 onto the stack and popping three times from the stack, what will be the value of the top and what element will be stored at index top?
Index Item Stored
47(top) 28
46 98
... ...
3 17
2 12
1 20
0 45

Top is 49 and the element at index top is 62
Top is 47 and element at index top is 28
Top is 46 and element at index top is 98
Top is 50 and element at index top is 17

a=

- The diagram that follows shows the current state of a queque represented by circular array of 8 integers. After enqueuing 36, 100, 83, 77, and 62, what are the values of front and back, and what elements are stored at indexes front and back.
Index Item stored
7
6(back) 28
5 97
4 25
3 54
2(front) 12
1
0

A=

For these questions, consider the following classes from this chapter Player, PlayerNode, and PlayerLinkedList.

- What does this method of PlayerLinkedList class do?
Public void fool( Player p, Player q )
{
insert ( p );
insert ( q );
}

A=

- What does this method of PlayerLinkedList class do?
Public int f004( )
{
PlayerNode nd =head;
int i = 0;
while ( nd != null )
{
if (nd.getPlayer( ).getGame( ).equals( "Sonic") )
i++;
nd = nd.getNext( );
}
return i;
}

A=

- What does this method of PlayerLinkedList class do?
Public Boolean f008( )
{
if ( number0fitems <= 2 )
return false;
else
{
head.setNext( ( head.getNext ( ) ).getNext ( ) );
Number)fItems--;
return true;

A=

Reference no: EM13939914

Questions Cloud

Magnetic resonance imaging : Magnetic Resonance Imaging is one of most important imaging technique, however, it still needs a lot of improvement to enhance the quality of the image and reduce time. In this report, the issue that has been focus on is who to reduce time of reco..
Whether economic indicators such as gdp : Write an economics dissertation on the topic of 'whether economic indicators such as GDP, inflation etc have a significant effect on General Election Outcomes in the Uk.
Statements must be true about these securities : Stock A's beta is 1.7 and Stock B's beta is 0.7. Which of the following statements must be true about these securities?
Marketing channel and distribution strategy : 1. Brief presentation of the company (products, market segments, international organization...) 2. Supply Chain characteristics (i.e. operational practices, inter-organizational collaboration, use of IOIS...) 3. Marketing Channel(s) and distribution ..
What does this method of playerlinkedlist class do : What does this method of PlayerLinkedList class do
What are the roles of the judge and the jury : What are the roles of the judge and the jury? How are the two roles similar and how are they different? Who among the two is more important in a trial process? Why? Explain the education, training, and selection processes for a judge. Do these proce..
Explain the theory behind free cash flow valuation approach : Explain the theory behind the free cash flow valuation approach. Why are the free cash flows value relevant to common equity shareholders when they are not cash flows to those shareholders, but rather are cash flows into the firm?
Assuming that firm asset beta : ABC Inc is a pure equity firm. Firm decides to recapitalize to take advantage of tax shield.
Use a ray diagram to show the image of an object : Use a ray diagram to show the image of an object 30 cm away from a convex lens with focal length 12cm. Describe the image fully and give the magnification/reduction.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Need to prepare a c++ program of class swap

Class Swap contains tow data members num1 , num2 and member function swapping ,the aim of this function is swapping num1 and num2 values , swapping should done by using pointer , i.e. if num1= 20 and num2 =5 they become : num1= 5 and num2=20.

  Maze program

Maze program. In this assignment you will represent a maze with a binary tree. . The starting point is node N and the ending point is node Z.

  Show the deatils of an emplyoee - c programming

Show the deatils of an emplyoee in a neat format.

  Give the implementation of the constructor

Implement the member function max() as an external function.

  Prepare a program in c++ using the class as defined

Prepare a program in C++ using the class as defined below - Then write the main program in another file that will read in some numbers and test out whether your functions all work.

  Program consisting of multiple objects

Write a program consisting of multiple objects which interact with each other by following appropriate design practices

  Write function that randomly produces maze

Write a function mazeGenerator that randomly produces a maze (in C++). The Function should take as arguments a two-dimensional 12-by-12 character array.

  Use a loop in main to efficiently handle all three persons

Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data.

  Departmental store in shanghai

Shopping Spree is a leading departmental store in Shanghai. The store has a number of regular customers who purchase bulk items. The store also conducts regular feedback sessions to analyze customer satisfaction levels.

  Program to decode a secret message

Write a program that decodes a message that was encoded using a random key. These keys work similar to a magic decoder wheel (where 'A' encodes to 'F', 'B' encodes to 'G', 'C' encodes to 'H', etc)except there is a random mapping from one letter to..

  Write a c++ program which will calculate the monthly balance

Write a C++ program which will calculate the monthly balance of a debt. Each month a payment is made on the balance, and interest is added to the balance using a fixed percentage rate.

  Create a class called rational for performing arithmetic

Rational Class Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the class-the numerator and the denominator. Provide a constructor th..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd