Show the list configuration resulting from each series of list operations using the List ADT of Figure
Question:
Show the list configuration resulting from each series of list operations using the List ADT of Figure 4.1 . Assume that lists L1 and L2 are empty at the beginning of each series. Show where the current position is in the list.
(a) L1.append(10);
L1.append(20);
L1.append(15);
(b) L2.append(10);
L2.append(20);
L2.append(15);
L2.moveToStart();
L2.insert(39);
L2.next();
L2.insert(12);
Transcribed Image Text:
/** List ADT */ public interface List { } /** Remove all contents from the list, so it is once again empty. Client is responsible for reclaiming storage used by the list elements. */ public void clear(); /** Insert an element at the current location. The client is responsible for ensuring that the list's capacity is not exceeded. @param item The element to be inserted. */ public void insert (E item); /** Append an element at the end of the list. The client is responsible for ensuring that the list's capacity is not exceeded. @param item The element to be appended. */ public void append (E item); /** Remove and return the current element. @return The element that was removed. */ public E remove (); /** Set the current position to the start of the list */ public void moveToStart (); /** Set the current position to the end of the list */ public void moveToEnd (); /** Move the current position one step left. No change if already at beginning. */ public void prev (); /** Move the current position one step right. No change if already at end. */ public void next (); /** @return The number of elements in the list. */ public int length(); /** @return The position of the current element. */ public int currPos (); /** Set current position. @param pos The position to make current. */ public void moveToPos (int pos); /** @return The current element. */ public E getValue (); Figure 4.1
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (3 reviews)
Based on the operations specified and the List ADT methods provided lets show what happens to lists ...View the full answer
Answered By
Ali Khawaja
my expertise are as follows: financial accounting : - journal entries - financial statements including balance sheet, profit & loss account, cash flow statement & statement of changes in equity -consolidated statement of financial position. -ratio analysis -depreciation methods -accounting concepts -understanding and application of all international financial reporting standards (ifrs) -international accounting standards (ias) -etc business analysis : -business strategy -strategic choices -business processes -e-business -e-marketing -project management -finance -hrm financial management : -project appraisal -capital budgeting -net present value (npv) -internal rate of return (irr) -net present value(npv) -payback period -strategic position -strategic choices -information technology -project management -finance -human resource management auditing: -internal audit -external audit -substantive procedures -analytic procedures -designing and assessment of internal controls -developing the flow charts & data flow diagrams -audit reports -engagement letter -materiality economics: -micro -macro -game theory -econometric -mathematical application in economics -empirical macroeconomics -international trade -international political economy -monetary theory and policy -public economics ,business law, and all regarding commerce
4.00+
1+ Reviews
10+ Question Solved
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Question Posted:
Students also viewed these Computer science questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
In 2013, Lou has a salary of $54,000 from her job. She also has interest income of $1700. Lou is single and has no dependents. During the year, Lou sold silver coins held as an investment for a $7000...
-
It is possible to construct a nonparametric tolerance interval that is based on the extreme values in a random sample of size n from any continuous population. If p is the minimum proportion of the...
-
Air at 327C, 400 kPa with a volume flow 1 m3/s runs through an adiabatic turbine with exhaust pressure of 100 kPa Neglect kinetic energies and use constant specific heats. Find the lowest and...
-
For the circuit in Fig. 3.69 , find v 1 , v 2 , and v 3 using nodal analysis. 240 V (+- 201 V3 20 V2 1 40 40 10
-
By using six factor formula for \(k\), derive the Eqs. (7.93), (7.94) of Section 7.7.1. dkoo dp= k MB dM dB 8 + (7.93) 1+M B M B2
-
Near the end of 2011, the management of Simid Sports Co., a merchandising company, prepared the following estimated balance sheet for December 31, 2011. To prepare a master budget for January,...
-
The adjusted trial balance for Chiara Company as of December 31 follows. Cash Accounts receivable Interest receivable Debit $ 30,000 Credit 52,000 18,000 nt ok Notes receivable (due in 90 days)...
-
Write a series of Java statements that uses the List ADT of Figure 4.1 to create a list capable of holding twenty elements and which actually stores the list with the following configuration: (2, 23...
-
Assume a list has the following configuration: Write a series of Java statements using the List ADT of Figure 4.1 to delete the element with value 15. (2, 23, 15, 5, 9).
-
Why are mechanistic organizations right for a static environment? Why do organic organizations fit well with a dynamic environment? Which organization form likely will be dominant in the future?...
-
Assume a mortgage loan has an outstanding principal balance of $100,000 and the interest rate is 6%. Calculate what portion of a $599.55 monthly payment will be allocated to interest.?
-
7. List three advantages when using radiography as a non-destructive testing method. (3 marks) 8. List three limitations when using radiography as a non-destructive test method. (3 marks) 9. What are...
-
what would be the discount rate under which 2 0 0 euros today would be the same as 3 0 0 euros in 5 years
-
1. Why is quality systems (such as Six Sigma) important for careers in engineering technology/engineering technology management? 2. Describe an instance when you have utilized production planning and...
-
a) Khaleef, a football player is negotiating with BBB Club regarding his contract. His opportunity cost is 6%. He has been offered three possible 4-year contracts. Payments are guaranteed, and they...
-
Is depreciation included in the computation of net present value ? Explain.
-
A new car sold for $31,000. If the vehicle loses 15% of its value each year, how much will it be worth after 10 years?
-
What is the bit rate for the signal in Figure 3.35? 16 ns Time
-
Why do optical signals used in fiber optic cables have a very short wave length?
-
A device is sending out data at the rate of 1000 bps. a. How long does it take to send out 10 bits? b. How long does it take to send out a single character (8 bits)? c. How long does it take to send...
-
QUESTION 1 From the table below which gives the effects of individual transactions, you are required to state as fully as possible what transaction has taken place in each case. Assets GHC A B C D E...
-
Melinda, a manager at Tidal Wave Corp, shuts down the wave pool after staff members complained about poor lighting at the deeper end of the wave pool. What is the process reflects Melinda s actions?
-
When Mary returned home from work one evening, she finds that her garage roof has been replaced and there is a bill for the job taped to her front door. Later, the roofing company comes by to collect...
Study smarter with the SolutionInn App