CS210 Thurs. Apr. 13
Handout: slideSample01.xml and clocks.xml, from pa05 files directory
Note that Chap 17 starts out with singly-linked lists, but these are
not as generally useful as doubly-linked lists such as our JDK
LinkedList, so skip sections 17.1 and 17.2 and start at section 17.3,
on doubly-linked lists.
Continuing on LinkedLists, specifically the LinkedListIterator implementation in Weiss.
We looked at an example of a list with 3 elements A, B, and C, with
Nodes for them, plus two dummy Nodes on each end. and a LinkedList
object with theSize = 3 and modCount = 5 and refs to both dummy Nodes.
We considered a ListIterator created with listIterator(1), so initially:
current = ptr to Node for B
lastVisited = null
lastMoveWasPrev = F
expectedModCount = 5
after next() is called on the ListIterator, which returns the B element,
current = ptr to Node for C
lastVisited = ptr to Node for B (B just returned)
lastMoveWasPrev = F
expectedModCount = 5
Now the fact that lastVisited is non-null and modCount == expectedModCount allows a remove() operation to succeed:
after remove() is called on the ListIterator:
Node for B is removed, the last one returned by next (or previous)
current = ptr to Node for C
lastVisited = null
lastMoveWasPrev = F
expectedModCount = 6 (and LinkedList's modCount = 6, so all looks well for more operations with
See definitions, pg. 596-597.
Binary Trees: each node has 0, 1, or 2 children.
Intro to XML
Simplest "hello world" XML document:
<?xml version="1.1"?>
<mytag>
hello!
</mytag>
or better:
<?xml version="1.1"?>
<greeting>
hello!
</greeting>
See XML tutorial linked from class web page for basics on element, attirbutes, comments. Skip processing instructions.