[DATA STRUCTURE & Other Objects Using JAVA] Chapter 4 Linked Lists

Class IntNode

An IntNode provides a node for a linked list with integer data in each node. Lists can be of any length, limited only by the amount of free memory on the heap. But beyond Integer.MAX_VALUE, the answer from listLength() is incorrect because of arithmetic overflow.

Field

Constructor

Method

Implementation

IntLinkedBag

An IntLinkedBag is a collection of int numbers.

Limitations

  1. Beyond Int.MAX_VALUE elements, countOccurrence, size and grab are wrong.
  2. Because of the slow linear algorithms of this class, large bags have poor performance.

Constructor

Method

Implementation

Leave a Reply

Your email address will not be published. Required fields are marked *