Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Section 7.3.2, implement the Positional List Abstract Data Type. That means implementing all the 12 functions and run your code on Example 7.4 Your program

Section 7.3.2, implement the Positional List Abstract Data Type. That means implementing all the 12 functions and run your code on Example 7.4 Your program should print out that table in Example 7.4. (Java)

Functions:

image text in transcribedimage text in transcribedimage text in transcribed

first ( ): Returns the position of the first element of L (or null if empty). last( ): Returns the position of the last element of L (or null if empty). before (p) : Returns the position of L immediately before position p (or null if p is the first position). after(p) : Returns the position of L immediately after position p (or null if p is the last position). isEmpty( ): Returns true if list L does not contain any elements. size( ): Returns the number of elements in list L. addFirst(e) : Inserts a new element e at the front of the list, returning the position of the new element. addLast (e) : Inserts a new element e at the back of the list, returning the position of the new element. addBefore (p,e) : Inserts a new element e in the list, just before position p, returning the position of the new element. addAfter(p,e) : Inserts a new element e in the list, just after position p, returning the position of the new element. set(p,e): Replaces the element at position p with element e, returning the element formerly at position p. remove (p) : Removes and returns the element at position p in the list, invalidating the position. Example 7.4: The following table shows a series of operations on an initially empty positional list storing integers. To identify position instances, we use variables such as p and q. For ease of exposition, when displaying the list contents, we use subscript notation to denote the position storing an element

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions