Close
Register
Close Window

Masters of Engineering Bridge Course

Chapter 8 Linked Lists, Bags, Stacks, and Efficiency

Show Source |    | About   «  8.1. Linked Chains (Pointers)   ::   Contents   ::   8.3. Efficiency  »

8.2. Introduction to Bags

8.2.1. Objectives

Upon completion of this module, students will be able to:

  • Name the function and purpose of basic Java data structures

  • State key characteristics of Bags in Java

  • Build and populate Bags in Java

8.2.2. Linked Bags

8.2.2.1. Suggested Reading:

Suggested Reading: Chapter 3 Bag Implementation That Links Data from Data Structures and Abstractions with Java, 4th edition by Frank M. Carrano and Timothy Henry

8.2.3. Introduction to Linked Bags

8.2.3.1. [4:10] Introduction to Linked Bags

TODO: fix URLS.

Linked Bag Intro PPT

8.2.4. LinkedBag add and toArray video

8.2.4.1. [12:45] LinkedBag add and toArray Video Demonstration

TODO: fix URLS.

LinkedBagAddToArray PPT

8.2.4.2. Checkpoint 1

8.2.5. Demo Video ExLinkedBagJunit

8.2.5.1. [7:14] ExLinkedBagJunit Video Demonstration

8.2.5.2. Zipped file example

Download to run and explore on your own in eclipse:

TODO: fix URLS.

Download Link Here

TODO: fix URLS.

This `link <>`_ will direct you to the steps to `download and import <>`_ previously written code into the Eclipse environment.

8.2.6. LinkedBag getFrequencyOf and contains video

8.2.6.1. [14:00] LinkedBag getFrequencyOf and contains Video Demonstration

TODO: fix URLS.

LinkedFreqContains PPT

8.2.6.2. Checkpoint 2

8.2.7. LinkedBag Removing an item

8.2.7.1. [13:44] LinkedBag Removing an Item Video Demonstration

TODO: fix URLS.

LinkedRemove PPT

Tradeoffs of using a linked chain implementation for a bag

Pros and Cons of Linked Bags

Pros

Cons

Bag can grow in size easily

Requires more space than a same-sized array

Adding an entry to the bag is fast

Removing a specified entry requires time to locate the entry

8.2.7.2. Checkpoint 3

8.2.8. Wrapping up Bags

As you’ve seen, Bags are a simple but foundational data structure in Java. We will continue with other data structures and their unique characteristics, including opportunities to practice building them, in later modules.

Recall that the objectives for this module were to:

  • Name the function and purpose of basic Java data structures

  • State key characteristics of Bags in Java

  • Build and populate Bags in Java

By this point, you should have achieved each of these objectives. If you have questions or concerns about your ability to accomplish each of these, please reach out to the instructor of the course.

8.2.9. Programming Practice: LinkedBags

   «  8.1. Linked Chains (Pointers)   ::   Contents   ::   8.3. Efficiency  »

nsf
Close Window