# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

1 Page

### hw8

Course: CS CS101, Spring 2009
School: American College of...
Rating:

Word Count: 309

#### Document Preview

101 CMPS Summer 2009 Homework Assignment 8 (practice only, do not turn in) 1. (1 Point) 12.2-1 Suppose that we have numbers between 1 and 1000 in a binary search tree and want to search for the number 363. Which of the following sequences could not be the sequence of nodes examined? a. b. c. d. e. 2, 252, 401, 398, 330, 344, 397, 363. 924, 220, 911, 244, 898, 258, 362, 363. 925, 202, 911, 240, 912, 245, 363. 2,...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Illinois >> American College of Gastroenterology >> CS CS101

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
101 CMPS Summer 2009 Homework Assignment 8 (practice only, do not turn in) 1. (1 Point) 12.2-1 Suppose that we have numbers between 1 and 1000 in a binary search tree and want to search for the number 363. Which of the following sequences could not be the sequence of nodes examined? a. b. c. d. e. 2, 252, 401, 398, 330, 344, 397, 363. 924, 220, 911, 244, 898, 258, 362, 363. 925, 202, 911, 240, 912, 245, 363. 2, 399, 387, 219, 266, 382, 381, 278, 363. 935, 278, 347, 621, 299, 392, 358, 363. Note: Some of the topics represented by the following problems my not be covered by end of business Tuesday 8/11/09. If that is the case, those topics will not appear on the final exam. 2. (1 Point) 12.2-6 Let x be a node in a Binary Search Tree, all of whose keys are distinct. Suppose that x has no right child, and that x has a successor, call it y. Prove that y is the lowest ancestor of x whose left child is also an ancestor of x. Note that x is considered to be its own so ancestor, it is possible that left[y]=x. (Hint: do this problem in 3 steps. First show that y must be an ancestor of x by eliminating the possibility that it is either a descendent of x or a cousin of x; second, show the same thing for left[y]; third, show by contradiction that there is no ancestor of x which is lower than y, and which has the same properties. All steps boil down to a careful application of the BST properties.) 3. (1 Point) Insert the following keys (in order) into an initially empty Binary Search Tree, and draw the BST structure that results: 26, 41, 47, 17, 14, 30, 10, 38, 28, 21, 19, 12, 16, 39, 23, 20, 15, 7, 35, 3. Determine an assignment of colors Red and Black to the nodes in this tree so as to satisfy the RedBlack Tree properties. 4. (1 Point) 13.1-5 Show that the longest simple path from a node x0 in a red-black tree to a descendant leaf has length at most twice that of the shortest simple path from node x to a descendant leaf. 1
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

CSU Northridge - LINEAR ALG - 99997
Advanced Linear AlgebraMath 462 - Fall 2009 - Section 15224 California State Univeristy NorthridgeA This version was L TEXed on September 10, 2009Math 462This is a Rough Draft and Contains Errors!This is an incomplete working document that will be re
INTRO to BUSINESS Notes8-27-08 A. The Economic Environment The Role of Profit A business provides goods and services for a profit Businesses are created by our free enterprise economy, we have the freedom to start a business, hire people, and sell produc
!&quot;#\$%&amp;'()%!*+,-./%)%0,1+2%31*+-4%)5567 !&quot;#\$&quot;%&amp;'()*)+,&quot;-.)/&quot;,0)*1&quot;#/&quot;#&quot;2'+(1+)1+21&quot;-'&quot;#)*&quot;3'0&amp;&quot;/-0*3)+,&quot;4'&amp;&quot;'0&amp;&quot;0%2'\$)+,&quot;15#\$&quot;'+&quot;6&amp;)7&quot;82-7&quot;9:7&quot; ;'&quot;+'-1&quot;-.#-&quot;#&lt;-.'0,.&quot;!&quot;#\$&quot;+'-&quot;&lt;)/-)+,&quot;-1&amp;\$/&quot;4&amp;'\$&quot;'0&amp;&quot;)+)-)#&lt;&quot;0+)-&quot;'+&quot;\$0/)2&quot;40+*#\$1+-#&lt;/=&quot;3'0&quot;&gt;)&lt;&quot;&lt;)?1&lt;3&quot; /-)&lt;&quot;&gt;
!&quot;#!\$%&amp;'()*+,-./'01#'2+#'3'!&quot;#'45617&quot;8167+9:*;&quot;&lt;'=&quot;,71,&gt;'(:?:+@1,&gt;.A'&quot;B6+'&gt;*&quot;CC1D1A' 216D+*@A'B1D;*&quot;D5*;!E&quot;4&quot;17&quot;,'6+5,='6@6D;46'(8FEF'G'HF&amp;F. '8E'D;72,1I5;6! ! ! !J*&quot;,=4&quot;6D;*'KB&quot;62'(E+6;#2'L&quot;=B;*. L7*&quot;D721,&gt; &amp;5DD1,&gt;'(45BD1#B;'*;7+*='#B&quot;@;*6. L&quot;4#
!&quot;#\$%&amp;#&quot;'()\$%&amp;'! ! ! ! ! !!*+,#&quot;'-)\$%&amp; ./-0*+1%2\$'3'+,&amp;*2\$4,#&quot;'-)\$%&amp; .4,%15'6)#,424 7%#1+ 802,# 9:#14;5#,&lt;2!!=212,#&quot;'6)#&quot;%4%2\$! ! !&gt;,#1\$-%\$%+1':%#'1+4#4%+1 ?1&lt;),%15'@&amp;&quot;#\$%&amp;\$A 8B421'@1+1;B)1&amp;4%+1#&quot;A'!C%D2'9E&gt;!!?,#\$'+B'!&quot;#\$%&amp;#&quot;'()\$%&amp;! ! ! ! ! !
!&quot;#\$%&amp;&quot;%\$&amp;'()&amp;*+&quot;,-.&quot;+&amp;/'0-%1&amp; 23&quot;0')'!!4()&amp;*+&quot;,-.&quot;+&amp;5)0-6\$! ! !789:&amp;;&amp;7&lt;=: &gt;?&quot;'30&quot;+%),@&amp;-%&amp;&quot;0' !6A6B(6%-.&amp;')C'30)&amp; D&amp;.+&quot;0-'# E3,-.&amp;F&amp;+&quot;%13&quot;1) G%,'03A)%'&quot;+&amp;A3,-.!HE3,-.&amp;-,I&amp;'()&amp;&quot;0'&amp;6J&amp;-%K)%'-%1&amp; '3%),&amp;&quot;%\$&amp;&quot;.6AB&quot;%#-%1&amp;'()A&amp; L-'(&amp;,3-'&quot;M+)&amp;(&quot;0A6%-),NN
!&quot;#!!!&quot;#\$%&amp;'(')*+!%,-./'&quot;)\$0&quot;-(.)1\$2\$34-56&quot;)73('-56&quot;)\$ -01*0(+\$4-.(\$8&amp;,'+9\$-&quot;:*5('9\$'*6; &lt;(/-.=5+&quot;*5.) &gt;1)6./&quot;*5.) %)+'(8&amp;'\$7\$?-01*0(\$+'6*5.)@\$A\$?4-.)*\$&amp;5)'@ &gt;B5):! ! ! !!!&gt;B5):!!C0&quot;*\$5+\$+B5):D!&quot;#\$%&amp;'%()*#+\$,-.#/01.2#,3&quot; &quot; &quot;43.-.3#'\$)56.'1#
Punjab Engineering College - SJSU - 122b
- What happen to each of the companies?I-Cosmetics ProblemsThey were having trouble distributing products to the retail stores Products were becoming outdated before they reached their customers. Retail stores were having trouble trying to pay back I-cos
Punjab Engineering College - SJSU - 122b
Group Name: Fraudsters Group Members: Guriqbal S. Randhawa Sukhinder Kaur Shailesh Negandhi Dominic Sutter Joerg Bartnik Naoki TabasuCompany Summary: JDSU Corp. was founded in 1979 and is headquartered in Milpitas, California. JDSU Corp. continuously mer
Punjab Engineering College - SJSU - 122b
Case 2: Freedom Jeans Background Freedom Jeans Inc. is a high quality manufacturer of jeans in the U.S. Its target customers include men, women and children. The company manufactures jeans in different facilities throughout the U.S and sells to its custom
Punjab Engineering College - SJSU - 122b
Bryan Aerospace Inc Due: Nov 6th Cost Data for the Industrial Cleaning Project Analysis Chlorinated Solvents Cleaning Agent Purchase in price Usage (in gallons per year) Personnel Time Cleaning operations Cleaning related training Studying MSDS's Wastewat
Punjab Engineering College - SJSU - 122b
The IncrediblesDiana Ting Parminder Kaur Harita Shah Uyen Nguyen Hani Naveed Vicki SantanaBackground on Freedom JeansMedium- to high-quality jeans manufacturer inthe U.S Target customers include men, women and children Recent competition from overseas
Punjab Engineering College - SJSU - 122b
The Pill Box Company:MiniCap Daily VitaminsKaizenAthenaAlcantar FrancisEstrella KristinaHoffman PrittNewlin RayPerlas RomanSohal DoanVuCompany Background MiniCap daily vitamins is one of The Pill Box Companys basic products. MiniCap daily vitamins d
UCSD - CHEM - 662520
Homework Assignment All of the exercises and problems in Vollhardt and Schore (5 th Edition) should be worked, except those listed in the table below. Team Problems and Preprofessional Problems will be optional. Exercises and Problems from Vollhardt and S
University of Texas - GOV - 312L
Setting up Jeffersons Presidency Jeffersons opinion of George Washingtons Presidency Differences between Hamilton and Jefferson Debt constituenciesElection of 1800 Draws Close What does Jefferson do to get his party going? Attack the monarchist tendenc
University of Texas - GOV - 312L
Chapter 5: The Age of Jackson(1829-1837)Andrew Jackson Whois this guy? Lawyer in Nashville Called by a colleague the mostroaring rollicking game cocking horse racing card playing mischievous fellow that ever lived in Salisbury (NC) RachelDonelson
University of Texas - GOV - 312L
Chapter 6LincolnEarly Lincoln Lincoln starts political career as a Whig Why important? Anti-Jackson= Whigs As a Whig, believed Polk was wrong about war withMexico. Powers of Presidency Attitudes about Slavery Kansas-Nebraska Act makes him want to get
University of Texas - GOV - 312L
Chapter 7The second wave of forgettable presidents Johnson, Grant, Hayes, Garfield, Arthur, Cleveland, Harrison, McKinleyAndrew Johnson Accidental President Congress is anxious to reassert itself Punish Confederacy Control Reconstruction Whats reall
University of Texas - GOV - 312L
Chapter 8Yakking about ProgressivismWhere have we been? Lincoln lots of presidential power Johnson Congress starts eroding power Johnson through McKinley: We go through the Reconstruction period and the Gilded Age We go into the nadir period of preside
University of Texas - GOV - 312L
Chapter 9: Woodrow Wilson Distrusted labor but was no fan of big business Wanted to reform abuses of capitalism Social order Via representative government During first term in office Concept of the PresidencyChanges in the system Wilson supported a nat
University of Texas - GOV - 312L
Chapter 10Harding, Coolidge, HooverWhats going on here Congress wants to get back authority lost during WWI 17th Amendment undermines Congressional party discipline how? Following TR, the USA had its longest ever period of leadership by men without mil
University of Texas - GOV - 312L
Moving into Modern PresidentsChapter 11Executive Office Created by Roosevelt Highly personal staff system 6 key aides performed assignments forpresident dictated by his needs and activities Presidentran staff himself Beginning of what is called the
University of Texas - GOV - 312L
Chapter 12Kennedy, Lyndon Johnson, Nixon, Ford, CarterJohn Fitzgerald Kennedy Self-Selected President? Didnt wait for turn via party system Conventions likely to ignore himTook a new path Used charm Money on primaries in small statesFirst slogan at t
University of Texas - GOV - 312L
Chapter 13Ronald Reagan &amp; George Bush (the first one)Ronald Reagan Ronald Reagan admired FDR and hung aportrait of Calvin Coolidge in the Cabinet room (Democrats! Gasp!) During Great Depression he was an avid Democrat During Truman, he headed Screen A
University of Texas - GOV - 312L
Chapter 14Bill ClintonBill Clinton 1 Democrat president to serve 2 full terms since FDR Jonathan Adler a columnist at Newsweek observed there seemsstto be 2 Clintons Inspirational man from Hope Reckless perpetual adolescent who Dick Morris calledSa
University of Texas - GOV - 312L
George W. Bush Becomes president in 2000 in a highly contestedelection Ralph Nader as a spoilerPolitical Scientists thoughtGore would winVoting for Gore or against Clinton?Election 2000Bush v. Gore (2000) Issues at playWhy was every vote notcoun
UCSD - CSE - 21
CSE 21: Notes on Derangements (April 26, 2007)A derangement of [n] is a permutation which has no xed point. In other words, in a derangement, for all i [n], i is not on position i. For example, for n = 3, all the derangements are: 231, 312. Generally, th
UCSD - CSE - 21
CSE 21: Problems in Discussion 4 (April 30, 2007)(1) Using bijections to count: to count elements in set A, if there is a bijection between A and another set B , we may count elements in B instead. Example 1: Given set cfw_1, 2, , n. How many sub-multise
UCSD - CSE - 21
CSE 21: Solutions to Midterm (May 10, 2007)1. By direct calculation, (a) A B B = (1234)(5). (b) B A A = (1324)(5). (c) A B A = (1524)(3). (d) B A B = (1534)(2). So the answer is (c). 2. Without any restriction, we have 3+4+5 = 220 ways to choose 3 balls.
UCSD - CSE - 21
Name: Student ID:CSE 21 Midterm May 10, 2007 Each problem is worth 20 points. Show your work to the extent you think it is necessary (otherwise, it wont be possible to get partial credit). Additional scratch paper is available at the front of the room. T
UCSD - CSE - 21
Name: Student ID:CSE 21 Practice Midterm #1 Each problem is worth 20 points. Show your work to the extent you think it is necessary. Additional scratch paper is available at the front of the room. This is a CLOSED BOOK, NO CALCULATOR test. However, you m
UCSD - CSE - 21
CSE 21: Solutions - Problem Set 11. There are 3 patterns: CVCVCC, CVCCVC, CCVCVC, where C stands for consonant and V for vowel. Note that each pattern has two adjacent consonants, which can not be the same. There are 3 2 3 2 (3 2) = 216 names for each pa
UCSD - CSE - 21
CSE 21: Solutions - Problem Set 41. These problems are variations of Bars and Stars. Let x1 + x2 + x3 + x4 = n be the equation. (a) This is of the standard form: there are n stars, and we need 3 bars. The answer isn+3 3.(b) If all four variable are po
UCSD - CSE - 21
CSE 21: Solutions - Problem Set 61. '&amp;1 ! %\$ &quot;# @ ! &quot;# 0.5 '&amp; %\$ q8 2 .2q q q 0 '&amp; %\$ q '&amp; %\$q ! &quot;# 7 ! &quot;# 1 q8 1 ooo qq 0 .2 q o q 0.1 '/ &amp; %\$ ! &quot;#q &quot;# root y0.6 /'&amp; %\$ 0.6 !2 2 0.2yy y'&amp; %\$ ' ! &quot;# 0.4 /'&amp; %\$ !1 &quot;# 3 xx x 0.4x x x&amp; '&amp;2 ! %\$ &quot;# X Y P r(X
UCSD - CSE - 21
CSE 21: Notes on Stars and Bars (April 17, 2007)Problem: We are given n undistinguishable balls and k distinguishable bins. How many ways are there to drop the balls in the bins? Solution. Lets see an example. Suppose we have 8 balls and 3 bins, where th
UCSD - CSE - 132A
Homework 1CSE 132A Fall 2008 Due: by noon on Tuesday Nov 4. Turn in either in class, or by sliding under Alins door, CSE building room 3238. This deadline is hard! I want to publish the solutions at noon, to benet your midterm preparation.Problem 1. [10
UCSD - CSE - 132A
Homework 2 CSE 132ADue by noon on Monday, Dec. 8, by sliding under Alins oce door.Problem 2[20pts] Suppose that a B + tree index on (branch-name, branchcity) is available on relation branch. What would be the best way to handle the following selection?
UCSD - CSE - 132A
Homework 2 CSE 132ADue by noon on Monday, Dec. 8, by sliding under Alins oce door.Problem 1[25pts] Show the B + trees obtained by inserting the following key values in ascending order: 2, 3, 5, 7, 11, 17, 19, 23, 29, 31. Suppose the maximum number of va
UCSD - PHYS - 2c
Practice Midterm I of Math 20FJiawang Nie October 19, 2009Note: You may use a calculator during the exam, but you must show all relevant computational steps. No credit will be given for unsupported answers gotten directly from a calculator. 1. Reduce th
UCSD - PHYS - 2c
Problem 1. Ocean waves with 18-m wavelength travel a t 5.3 m/s. W hat is t he time interval between wave crests passing under a boat moored at a fixed location?23. A transverse wave with 3.0-cm amplitude and 75-cm wavelength is propagating on a stretched
UCSD - PHYS - 2c
--Problem 1. Sllow t hat the quantity speed.has the units ofProblem 19. W hat is the approximate frequency ran e over which sound with intensity 1 0-l2 W/m can be heard? Consult Fig. 17-3.fSolution T he units of pressure (force per unit area) divide
UCSD - PHYS - 2c
Section 34-4:Electromagnetic WavesProblem 7. At a particular point the instantaneous electric field of an electromagnetic wave points in the +y direction, while the magnetic field points in the -z direction. In what direction is the wave propagating? So
UCSD - PHYS - 2c
ActivPhysics can help with these problems:Activities 15.1, 15.2 Section 35-2: Reflection-Problem 1. Through what angle should you rotate a mirror in order that a reflected ray rotate through 30? Solution Since el = 0; for specular reflection, (Equation
UCSD - PHYS - 2c
CHAPTER 36IMAGE FORMATION A ND OPTICAL INSTRUMENTSF ind the locations of all images of an object a t z=2m,y=lm.ActivPhysics can help with these problems:All activities in Section 15 Sections 36-1 and 36-2: Mirrors Plane and CurvedProblem 1. A shoe st
UCSD - PHYS - 2c
CHAPTER 37 INTERFERENCE AND DIFFRACTION.---Section 37-2:Double-Slit InterferenceSection 37-3: Multiple-Slit Interference and Diffraction Gratings Problem 13. In a 5-slit system, how many minima lie betwee* the zeroth-order and first-order maxima? S
UCSD - PHYS - 2c
UCSD - PHYS - 2c
PART 3THERMODYNAMICSCHAPTER 19 TEMPERATURE AND HEAT---Problem 3. Normal room temperature is 68OF. W hat is this in Celsius? Solution Equation 19-3, solved for the Celsius temperature, gives Tc = i (TF - 32) = 5(68 - 32)/9 = 20C.Problem 27. A stove
UCSD - PHYS - 2c
C HAPTER 21HEAT, WORK, AND T HE FIRST LAW O F THERMODYNAMICS.ActivPhysics can help with these problems: Activities 8.5-8.13 Section 21-1: The First Law of Thermodynamics Problem1. In a perfectly insulated container, 1.0 kg of water is stirred vigorous
UCSD - PHYS - 2c
CHAPTER 22.-THE SECOND LAW O F THERMODYNAMICSProblem17. How much work does a refrigerator with a COP of 4.2 require to freeze 670 g of water already at its freezing point?-Problem3. E stimate the energy that could be extracted by cooling the world
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c
UCSD - PHYS - 2c