Chains of Linked Nodes - Introduction to Data Structures - Notes | COMP SCI 367, Study notes of Data Structures and Algorithms

W4(a) Lecture Notes (Skrentny) Material Type: Notes; Class: Introduction to Data Structures; Subject: COMPUTER SCIENCES; University: University of Wisconsin - Madison; Term: Spring 2014;

Typology: Study notes

2013/2014

Uploaded on 03/11/2014

kmfischer3
kmfischer3 🇺🇸

12 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Copyright 2014 Jim Skrentny CS 367 L7 - 1
CS 367 Announcements
Thursday, February 11, 2014
Homework h2 due 10 pm Friday, February 14th
Program p1 due 10 pm Sunday, February 16th
Assignment questions? Post on Piazza or see a TA during lab consulting hours.
Last Time
Exceptions
throws and checked vs. unchecked
defining
Primitive vs. Reference Types
assignment
parameter passing
ADTs vs. Data Structures
Command Line Java Development
Submitting Work
Today
Chains of Linked Nodes
Listnode class
practice using
Next Time
Read: continue Linked Lists
Java Visibility Modifiers
LinkedList Class - implementing the List ADT with a chain of nodes
LinkedListIterator Class
Tuesday
-------------------
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Chains of Linked Nodes - Introduction to Data Structures - Notes | COMP SCI 367 and more Study notes Data Structures and Algorithms in PDF only on Docsity!

CS 367 Announcements

Thursday, February 11, 2014

Homework h2 due 10 pm Friday, February 14th Program p1 due 10 pm Sunday, February 16th

Assignment questions? Post on Piazza or see a TA during lab consulting hours.

Last Time Exceptions

  • throws and checked vs. unchecked
  • defining Primitive vs. Reference Types
  • assignment
  • parameter passing ADTs vs. Data Structures Command Line Java Development Submitting Work

Today Chains of Linked Nodes

  • Listnode class
  • practice using

Next Time Read: continue Linked Lists Java Visibility Modifiers LinkedList Class - implementing the List ADT with a chain of nodes LinkedListIterator Class

Chain of Linked Nodes Data Structure

Concept

Goal

Making Listnodes

Practice: Making a Chain of Nodes

 Create a chain of nodes containing the Strings "yippie", "ki", and "yay" (in that order)

Practice: Adding a Node at End of the Chain

Assume head points to the first node in a chain of nodes containing Strings.

 Write a code fragment that adds “last” to the end of the chain of nodes. You may assume the chain has at least one item.

Practice: Removing a Node from a Chain

Assume head points to the first node in a chain of nodes containing Strings.

 Write a code fragment to remove the third item from the chain of nodes. You may assume the chain has at least three items.

 How would your code change so that it removes the Nth item from the chain of nodes?