<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.lensovet.net/~sysadmin/w/index.php?action=history&amp;feed=atom&amp;title=Computer_Science%2F61b%2FHomework%2Fhw7</id>
	<title>Computer Science/61b/Homework/hw7 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.lensovet.net/~sysadmin/w/index.php?action=history&amp;feed=atom&amp;title=Computer_Science%2F61b%2FHomework%2Fhw7"/>
	<link rel="alternate" type="text/html" href="http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;action=history"/>
	<updated>2026-05-03T07:28:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;diff=24353&amp;oldid=prev</id>
		<title>Lensovet: Lensovet moved page CS/61b/Homework/hw7 to Computer Science/61b/Homework/hw7</title>
		<link rel="alternate" type="text/html" href="http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;diff=24353&amp;oldid=prev"/>
		<updated>2023-02-20T03:51:35Z</updated>

		<summary type="html">&lt;p&gt;Lensovet moved page &lt;a href=&quot;/~sysadmin/w/CS/61b/Homework/hw7&quot; class=&quot;mw-redirect&quot; title=&quot;CS/61b/Homework/hw7&quot;&gt;CS/61b/Homework/hw7&lt;/a&gt; to &lt;a href=&quot;/~sysadmin/w/Computer_Science/61b/Homework/hw7&quot; title=&quot;Computer Science/61b/Homework/hw7&quot;&gt;Computer Science/61b/Homework/hw7&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 03:51, 20 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Lensovet</name></author>
		
	</entry>
	<entry>
		<id>http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;diff=4041&amp;oldid=prev</id>
		<title>Lensovet: moved CS 61b/Homework/hw7 to CS/61b/Homework/hw7:&amp;#32;fix cs 61b hierarchy</title>
		<link rel="alternate" type="text/html" href="http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;diff=4041&amp;oldid=prev"/>
		<updated>2010-11-14T06:00:20Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/~sysadmin/w/CS_61b/Homework/hw7&quot; class=&quot;mw-redirect&quot; title=&quot;CS 61b/Homework/hw7&quot;&gt;CS 61b/Homework/hw7&lt;/a&gt; to &lt;a href=&quot;/~sysadmin/w/CS/61b/Homework/hw7&quot; class=&quot;mw-redirect&quot; title=&quot;CS/61b/Homework/hw7&quot;&gt;CS/61b/Homework/hw7&lt;/a&gt;: fix cs 61b hierarchy&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 06:00, 14 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Lensovet</name></author>
		
	</entry>
	<entry>
		<id>http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;diff=3224&amp;oldid=prev</id>
		<title>Lensovet at 06:01, 22 September 2007</title>
		<link rel="alternate" type="text/html" href="http://www.lensovet.net/~sysadmin/w/index.php?title=Computer_Science/61b/Homework/hw7&amp;diff=3224&amp;oldid=prev"/>
		<updated>2007-09-22T06:01:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Files==&lt;br /&gt;
*[[/dict]] package&lt;br /&gt;
&lt;br /&gt;
==Grade==&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
                               CS 61B Homework 7&lt;br /&gt;
                       Due 4pm Friday, November 10, 2006&lt;br /&gt;
&lt;br /&gt;
This homework will give you practice with 2-3-4 trees.  This is an individual&lt;br /&gt;
assignment; you may not share code with other students.&lt;br /&gt;
&lt;br /&gt;
Copy the Homework 7 directory by doing the following, starting from your home&lt;br /&gt;
directory.  Don't forget the &amp;quot;-r&amp;quot; switch in the cp command.&lt;br /&gt;
&lt;br /&gt;
    cp -r $master/hw/hw7 .&lt;br /&gt;
&lt;br /&gt;
Your task is to implement the insertion operation of a 2-3-4 tree, in the file&lt;br /&gt;
Tree234.java (in the dict package).  For simplicity, the tree stores only keys;&lt;br /&gt;
no element is associated with each key.  Furthermore, the keys are ints.&lt;br /&gt;
&lt;br /&gt;
The central two operations have the following prototypes.&lt;br /&gt;
&lt;br /&gt;
  public boolean find(int key);&lt;br /&gt;
  public void insert(int key);&lt;br /&gt;
&lt;br /&gt;
find() returns true if the specified key is in the tree, and false otherwise.&lt;br /&gt;
find() is already implemented for you; inspecting the code will help you&lt;br /&gt;
understand the data structure better.  insert() inserts its parameter &amp;quot;key&amp;quot;&lt;br /&gt;
into the tree.  Please implement the top-down insertion algorithm described in&lt;br /&gt;
the Lecture 27 notes, and not the bottom-up insertion algorithm described by&lt;br /&gt;
Goodrich and Tamassia.&lt;br /&gt;
&lt;br /&gt;
Because there is no object associated with each key, there is no reason to&lt;br /&gt;
store duplicate keys.  Hence, if a key is found to already be in the tree,&lt;br /&gt;
don't insert another copy.&lt;br /&gt;
&lt;br /&gt;
A toString() method is also provided for 2-3-4 trees, and is useful for&lt;br /&gt;
testing.  Do not change it; the autograder will use it to check your trees.&lt;br /&gt;
&lt;br /&gt;
There's also a printTree() method, which prints a 2-3-4 tree in an easier-to-&lt;br /&gt;
read, but more space-consuming, tree-shaped manner (albeit sideways).  This&lt;br /&gt;
method will not be tested, and you may change it to your liking.&lt;br /&gt;
&lt;br /&gt;
The Tree234Node class represents a node in a 2-3-4 tree, and has the following&lt;br /&gt;
fields.&lt;br /&gt;
&lt;br /&gt;
  int keys;&lt;br /&gt;
  int key1;&lt;br /&gt;
  int key2;&lt;br /&gt;
  int key3;&lt;br /&gt;
  Tree234Node parent;&lt;br /&gt;
  Tree234Node child1;&lt;br /&gt;
  Tree234Node child2;&lt;br /&gt;
  Tree234Node child3;&lt;br /&gt;
  Tree234Node child4;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;keys&amp;quot; field is the number of keys stored in the node, and must be 1, 2, or&lt;br /&gt;
3.  The fields &amp;quot;key1&amp;quot;, &amp;quot;key2&amp;quot;, and &amp;quot;key3&amp;quot; are filled in (in order) with the int&lt;br /&gt;
keys stored in the node.  If keys == 1, the value of key2 doesn't matter.  If&lt;br /&gt;
keys &amp;lt; 3, the value of key3 doesn't matter.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;parent&amp;quot; field is the node's parent.  The fields &amp;quot;child1&amp;quot; through &amp;quot;child4&amp;quot;&lt;br /&gt;
are the node's children, and are filled in in order from child1 to child4.  All&lt;br /&gt;
four of these references must be set to null in a leaf node.  If keys == 1,&lt;br /&gt;
child3 should be null, and if keys &amp;lt; 3, the value of child4 should be null.&lt;br /&gt;
&lt;br /&gt;
You may not change any of these constraints on how a Tree234Node is&lt;br /&gt;
represented, but you may add fields and helper methods to the Tree234 and&lt;br /&gt;
Tree234Node classes if it helps.  However, make sure that the toString()&lt;br /&gt;
methods and the find() method work correctly in their unmodified forms.&lt;br /&gt;
Do not change toString() or find().&lt;br /&gt;
&lt;br /&gt;
Test code is provided in the main method of the Tree234 class.  To compile,&lt;br /&gt;
change (cd) to your hw7 directory and type &amp;quot;javac -g dict/*.java&amp;quot;.  To run,&lt;br /&gt;
type &amp;quot;java dict.Tree234&amp;quot;.  The test code does not test whether you correctly&lt;br /&gt;
update the tree's &amp;quot;size&amp;quot; field; you'll have to test that yourself.&lt;/div&gt;</summary>
		<author><name>Lensovet</name></author>
		
	</entry>
</feed>