# 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.

4 Pages

### solt1

Course: CS 352, Fall 2009
School: Contra Costa College
Rating:

Word Count: 515

#### Document Preview

Structures Data and Algorithms Homework 1 Solution (Problem 1.) (a) In Figure 1, in each node we have two numbers: the black number indicates n, and the red one indicates the return value for this node. (b) X(n) = 2n. This can be proved by induction on n. (In the induction step, it is convenient to distinguish between two cases: n = 2k and n = 2k + 1.) Solution (Problem 2.) (a) log(9 n) = (log n + 9) One...

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> Contra Costa College >> CS 352

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.
Structures Data and Algorithms Homework 1 Solution (Problem 1.) (a) In Figure 1, in each node we have two numbers: the black number indicates n, and the red one indicates the return value for this node. (b) X(n) = 2n. This can be proved by induction on n. (In the induction step, it is convenient to distinguish between two cases: n = 2k and n = 2k + 1.) Solution (Problem 2.) (a) log(9 n) = (log n + 9) One justification: To begin, 1 log(9 n) = log 9 + log n. 2 There is a positive integer n0 such that log n0 2 log 9 and log n0 9. (When log = log2 as in the book, we may set n0 = 512.) With this n0 , we have 1 1 1 (log n + 9) log n < log 9 + log n log n < log n + 9 4 2 2 whenever n n0 , and so we may set c = 1/4, c = 1 in the definition on p. 170. (b) log2 n = (7 log n) One justification: We have 1 log2 n (7 log n) 7 for all positive integers n, and so we may set n0 = 1, c = 1/7 in the definition on p. 170. (c) 5(n + log n) = O(n log n + n) One justification: We have 5(n + log n) 5(n + n log n) for all positive integers n, and so we may set n0 = 1, c = 5 in the definition on p. 167. 1 X(1),2 X(3),6 X(2),4 X(1),2 X(7),14 X(2),4 X(1),2 X(4),8 X(1),2 X(2),4 X(1),2 X(15),30 X(1),2 X(2),4 X(1),2 X(4),8 X(1),2 X(2),4 X(1),2 X(8),16 X(1),2 X(2),4 X(1),2 X(4), 8 X(1),2 X(2),4 X(1),2 Figure 1: Recursion Trace for X(15) X(1),2 X(1),2 2 (d) 4n3/2 = (6n log n) One justification: There is a positive n0 integer such that n1/2 log n whenever n n0 . (When log = log2 as in the book, we may set n0 = 16.) With this n0 , we may set c = 2/3 in the definition on p. 170. (e) 5n2 = (2n2 - 5n) One justification: We may set n0 = 5, c = 1, c = 5 in the definition on p. 170. Solution (Problem 3.) Note: By Equation 4 in Proposition 4.1 on p. 155, we have (logb n) = (logd n) for all choices of bases b and d, and so we may write simply (log n) instead of (log2 n), (log3 n), etc. Maximum and minimum number of times each loop is repeated Loop 1 is repeated at least (log n) times and at most (n) times. Loop 3 is repeated (log n) times. Loop 2 is repeated at least (log n) times and at most (n) times. Loop 4 is repeated n/k times (see p. 161 for the definition of the ceiling function x) Lower and upper bound of the run-time of f : Each iteration of Loop 4 runs in time (1). Each iteration of Loop 3 runs in time n (1) k . Each iteration of Loop 2 runs in time (1). 3 Each iteration of Loop 1 runs in time at least (log n) + k n (1) k n (1), k and at most (n) + k where k in the sum runs through all the powers 30 , 31 , 32 , . . . which are smaller than n. Since n n k = O(log n) + k k n k and k n < k s=0 n = O(n) 3s (see Proposition A.14 on p. 676 for the last equation), it follows that each iteration of Loop 1 runs in time (n). The run-time of f is at least (n log n) and at most (n2 ). 4
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:

Concordia Canada - CS - 352
/* One possible solution for programming problem in assignment 1.The problem is :The evaluation of fully bracketed arithmetic expressions, i.e., expressions like(2 * (3 - 4)/(5 + 3)in which there is a pair of brackets for each arithmetic operati
Concordia Canada - CS - 352
Data Structures and Algorithms Homework 2 Solution (Problem 1.)A: 8n lg n &gt; n3 23n for all integers n greater than 2. B: 8n lg n &lt; n3 23n for n = 1 and n = 2. Justication. A: We will rely on the fact that (ba )c = bac and ba bc = ba+c (Proposition 4
Concordia Canada - CS - 352
Midterm solutions 1. True or false? n3 = O(5n2 lg n), n2 lg n = O(5n3 ), n2 = O(4lg n ), 4lg n = O(n2 ) Solution: n3 = O(5n2 lg n) Justication: n3 /5n2 lg n = n/5 lg n, which can be made arbitrarily large by choosing a suciently large n. n2 lg n = O(
Concordia Canada - CS - 352
Student ID a1p a1t (last 4 digits) (/24) (/6) 0101 0141 0157 1035 1572 1775 1776 1797 1918 2190 2537 4182 4468 4636 4866 5123 5358 5383 5613 5755 5977 6082 6526 6624 6917 6993 7013 7031 7204 7240 7243 7373 7374 7666 7966 8112 8201 8274 8465 8485 8803
Concordia Canada - CS - 352
COMP 352, Winter 2008 Assignment 1Theoretical Component (6 points/30) Choose one of the following three questions, solve it, and submit the hard copy in class on Monday Feb 4. 1. Consider the following recursive function. public static int X(int n)
Contra Costa College - CS - 352
COMP 352, Winter 2008 Assignment 3Theory part (10 points/30) Answer all three questions and submit the hard copy in class on Wednesday March 26. The TA will choose one and grade it. 1. When the nodes of a heap are stored in an array as on p. 338 of
Concordia Canada - CS - 352
COMP 352, Winter 2008 Assignment 4This assignment has no programming part. Answer all six questions. The TA will choose two and grade them. Due on Monday 21 April at 23:59. Submit electronically or place a hard copy in the assignment box in EV3.249.
National Taiwan University - ECON - 502
Consider an economy that consists of a coconut grower, a restaurant, and a government. The coconut grower produces and sells \$1000 worth of coconuts. The grower has no raw material inputs. The coconut producer pays \$700 in wages and \$100 in taxes. Th
UMiami - BIO - 151
Appendix II How to Write a Scientific PaperA good scientist also must be a good writer. All the brilliant research of a lifetime is of little use if the investigator cannot effectively communicate new findings to his or her colleagues. Go to the uni
Texas A&M - ECON - 202
ECONOMICS 202 - EXAM IA - SPRING 20061.In the circular flow diagram of the market economy if we are observing the market in which consumers are suppliers and producers are demanders, this is the location where the _ question(s) of the economic pr
Berkeley - ECON - 121
Department of Economics University of CaliforniaFall 2004 Woroch/Lopez/SydnorEconomics 121 Midterm Frequently Asked QuestionsWhen is the midterm exam? It will be held on Thursday, October 21st, from 12:40 PM to 2:00 PM. Please try to arrive by 1
Cornell - ECON - 301
Economics 301 Fall 2007 PRELIM 1 - J. Wissink Thursday October 4 Directions: ANSWER ALL THE QUESTIONS. Write legibly, concisely, and coherently. Be sure to label all axes, functions, and variables you use. READ QUESTIONS CAREFULLY. Draw pictures w
Sonoma - USERS - 304
Econ 304 Sonoma State University Fall 2007 Dr. Robert Eyler Homework #6: Due December 6, 2007 1. The difference between the spot and forward market for currency is large in explaining how exchange rates change. a. Define spot and forward exchange rat
Sonoma - USERS - 304
Econ 304 Sonoma State University Fall 2007 Dr. Robert Eyler eyler@sonoma.edu Stevenson 2042B, 664-4256 OH : W 10-12; TTH 10-12; by appt. www.sonoma.edu/users/e/eylerIntermediate Macroeconomic TheoryCourse Description: This course extends topics co
Software Developer Company Founded in 1998, Sageworks, Inc., a Research Triangle Park-based firm, is one of the fastest-growing software and information companies in the United States. The firm has many Fortune 500 clients as well as over 4,000 accou
Cal Poly Pomona - ECON - 316
Marginal Analysis and Comparative StaticsTo introduce you to comparative statics analysis, I will work with some simple optimization problems with which you are already familiar, but will examine them in more detail than in your previous courses.1
SUNY Buffalo - VPAA - 0405
Curriculum Additions and Changes Approved by the University Undergraduate Curriculum Committee3/25/2005Program Title Classics - Concentrations Informatics - BA Architecture - Minor Biochemistry - BSBiological Sciences - BA Biotechnology - BS Bu
Purdue - ECON - 370
Name_Section _ Econ 370 International Trade Midterm There are 40 T/F questions worth 2 points each, and 2 short answer questions worth 20 points each, for a total of 120 points. Please budget time accordingly. You have 75 minutes. Please write legibl
Texas A&M - ECON - 202
ECONOMICS 202 - EXAM 2A - FALL 2006ANSWER THE NEXT 3 QUESTIONS WITH REFERENCE TO THE FOLLOWING TABLE (Assume PH = \$3; PK = \$4; PJ = \$5; Budget = \$31; Saving = \$0.00)1. The fourth unit in sequence purchased by this consumer has a MU / P = : a. 13;
SUNY Buffalo - VPAA - 0405
New Courses Approved by the University Undergraduate Curriculum Committee1/5/2005Number TitleART 356 Exploring IdentityBIO 449Evolutionary Developmental BiologyCIE 430Design of Wood StructuresCredit Course Hours Type Prerequisites Cou
Georgia Tech - PHYSICS - 2212
QUIZ #4Physics 2212 C Test Form#: 401AName:_1. Print your name, test form number, and your full 9-digit Georgia Tech ID number in the section of the answer card labeled &quot;STUDENT IDENTIFICATION&quot;. 2. Bubble in your test form number in columns 1-
SUNY Buffalo - VPAA - 0506
New Courses Approved by the University Undergraduate Curriculum Committee5/15/2006NumberTitleCredit HoursCourse TypePrerequisitesCourse Description (if available)EffectiveAAS 424APY 321Liberation Struggles of the African Diaspor
CSU Northridge - PSY - 420
Name_ 420 Ainsworth Psy 420 Midterm 1 Part 1 In class (50 points total) True or False (circle T or F) (1 point each) 1. T F With more than 2-groups, performing multiple T-tests would be the same as doing a one-way ANOVA. In a one-way ANOVA, total
Pittsburgh - UPJ - 1663
Michigan - ENGR - 273
CSU Northridge - PSY - 420
Psy 420 Final Exam Fall 06 AinsworthKey Name_Psy 420 Final A researcher is studying the effect of Yoga, Meditation, Anti-Anxiety Drugs and taking Psy 420 and the anxiety levels of the participants. Twenty participants were randomly assigned to on
Dallas - CS - 060100
LectureNotes:MutualRecursion&amp;TailRecursionCS6371:AdvancedProgrammingLanguages August27,2007#let rec length = function [] -&gt; 0 | _:t -&gt; (length t)+1; length : 'a list -&gt; int = &lt;fun&gt; #type staff = Programmer | Manager of dept and dept = Outsourced |
Dallas - CS - 060100
CS 6371 Fall 2007Advanced Programming LanguagesSample Final ExamWrite all of your answers and scratch work in your exam booklet(s), not on this exam paper; only material written in your booklet(s) will be graded. Remember to write your name on
Dallas - CS - 060100
Introduction to the calculusCS6371: Advanced Programming LanguagesFirst, Some Mathematical HistoryMathematics in Ancient Times Based on observational reasoning Example: Does the sum of interior angles of a triangle always equal 180 ? Draw a
CSU Northridge - PSY - 524
Ainsworth Spring 2008 Psychology 524: Applied Multivariate Statistics 15215 9:30-10:45am TTH in SH 322 Lab 15216 11:00-11:50am TTH SH 341 Information: Email address: andrew.ainsworth@csun.edu Office Hour: TTH 2-3pm or by appointment in ST302 Class We
ASU - DIV - 522
Volume 51, Number 1, Winter 1998The Clinical PsychologistUpdate on Empirically Validated Therapies, IIDianne L. Chambless, Mary J. Baker, Donald H. Baucom, Larry E. Beutler, Karen S. Calhoun, Paul Crits-Christoph, Anthony Daiuto, Robert DeRubeis
CSU Northridge - HCBUS - 005
CHAPTER 10Reporting and Analyzing LiabilitiesStudy Objectives1. 2. 3. 4. 5. 6. 7. Explain a current liability and identify the major types of current liabilities. Describe the accounting for notes payable. Explain the accounting for other current
California State University, Monterey Bay - PSYCH - 215
PROD #: 111001Psychotherapy: Theory/Research/Practice/Training 2002, Vol. 39, No. 1, 6675Copyright 2002 by the Educational Publishing Foundation 0033-3204/02/\$5.00 DOI 10.1037/0033-3204.39.1.66ETHICAL ISSUES IN ATTEMPTS TO BAN REORIENTATION THE
Liberty - MEDIA - 1160
ACCT 511 Advanced Business Law for Accountants Professors notes* As of July 18, 2007Note: All content is based on the professors opinion and may vary from professor to professor and student to student. All content may be changed without notice. Th
Berkeley - ASTRO - 00350853
# Time [days] Mag Magerr Band Uplim Ref
Berkeley - ASTRO - 00350853
Source Contamination: 0.00E+00 +/- 0.0E+00 cts/s
Fanshawe - FILES - 462
The Project Gutenberg EBook of The Errand Boy, by Horatio AlgerThis eBook is for the use of anyone anywhere at no cost and withalmost no restrictions whatsoever. You may copy it, give it away orre-use it under the terms of the Project Gutenberg
Illinois State - COE - 044
Fall 2004 Class Registration DirectoryRegistration Quick Reference and Work Sheet for Fall SemesterThere are three methods by which you may register:1. iCampus portal 2. Student Information Access System (SIAS) 3. STAR+ (touch tone telephone)Cl
Wisconsin - HOMEPAGES - 1944
10th Dist. A.C.|10th District A.C.|111th Ambulance|11th Cavalry|1st Infantry|1stTexasArtillery|20th Infantry|260th Coast Artil|260th Coast Artillery|2nd TX 132nd Inf|2nd Texas 132nd Infantry|362nd Infantry|3rd Army Corps|5th Division|63rd
Illinois State - COE - 034
Fall 2003 Class Registration DirectoryFall 2003 Confirmation of AttendanceA correct registration is each student's individual responsibility. Advisers and registration officials cannot assume your responsibility. You will receive a copy of your cl
Carnegie Mellon - PROJECT - 15441
The GNU C Library Reference ManualThe GNU C Library Reference ManualSandra Loosemore with Richard M. Stallman, Roland McGrath, Andrew Oram, and Ulrich DrepperEdition 0.11 last updated 2007-09-09 for version 2.7This file documents the GNU C lib
Ill. Chicago - PDFS - 73102
Social Science &amp; Medicine 51 (2000) 4150www.elsevier.com/locate/socscimedChronic physical illness, psychiatric disorder and disability in the workplaceCarolyn S. Dewa*, Elizabeth LinCentre for Addiction and Mental Health, Clarke Site, Health Sy
WPUNJ - IRA - 071
12:38 Tuesday, September 4, 20071ENROLLMENT AND GRADE DISTRIBUTION BY COURSE LEVEL FOR DEPARTMENT, COLLEGE AND UNIVERSITY SPRING 2007COLLEGE 1. ARTS &amp; COMMUNICATIONS SEC &lt;&gt; N LEVEL BASIC LEVEL GE 100 LEVEL 200 LEVEL 300 LEVEL 400 LEVEL GRAD LEVE
University of Hawaii - Hilo - SOC - 200830
SOC 478, Field Research Methods SPRING 2007, E-SYLLABUS AND COURSE DESCRIPTION T, R 12:00-0115 COURSE DESCRIPTION AND SYLLABUS (A WRITING INTENSIVE COURSE) Class meets Tuesdays and Thursdays, 12 noon to 1:15 p.m., in Saunders 637. Instructor: Michael
UCSC - ENGR - 003
AMS 3: Precalculus.Instructor: Bruno Mendes mendes@ams.ucsc.edu, Oce 141 Baskin Engineering Teaching Assistant: Jing Chang(jxchang@ucsc.edu) February 24, 2008Required TextCohen, D. (2005), Precalculus, Sixth Edition. West Publishing Company. Ther
Iowa State - EE - 457
EE 457 Homework #2 Solution 1. Consider the two-bus system shown in Fig. 11. The two generators and transformers are assumed of equal rating 300 MVA which is the 3phase base power for all pu unit data given in what follows. Line has series
Washington University in St. Louis - CS - 464
CSE464 Homework 07 Due 2005.03.30Note: Please list at top of first sheet of homework submission anyone or anything from which you obtained any help for this homework assignment other than the text, class notes/discussion, and the instructor. Please
Camden County - EPD - 22004
lanTMSC520 MicrocontrollerUser's ManualOrder #22004B 2001 Advanced Micro Devices, Inc. All rights reserved.The contents of this document are provided in connection with Advanced Micro Devices, Inc. (&quot;AMD&quot;) products. AMD makes no representations
University of Hawaii - Hilo - SOC - 200830
Sociology 316 Survey of Social Change Spring, 2008MWF 1130-1220 KUY 301COURSE SYLLABUS (Note: This preliminary syllabus is subject to change.) Instructor: Dr. Barbara Joyce 248 Saunders Hall 956-8794; barbaraj@hawaii.edu Office Hours: MWF 1:00-4:0
Montana - MATH - 480
1 FEMALE SCI 25 4.0 5 GOOD 2 MALE HUM 28 3.3 5 BAD 3 FEMALE SOC 25 3.3 0 BAD 4 FEMALE BUS 24 2.2 20 G
Sanford-Brown Institute - CS - 149
CS149: Homework 9 SolutionsDecember 13, 2006Many thanks to Dave and Josh for this solution. The following algorithms assume the existence of these simple constant-time operations: num_nodes(G): returns the number of nodes in the graph G. neighb
University of Hawaii - Hilo - SOC - 200830
SOC 491, Seminar for Discussion Group Leaders Freshman Seminar E-SYLLABUS AND COURSE DESCRIPTION SPRING 2008 M 1230-0220 KUY 401 COURSE DESCRIPTION SOCIOLOGY 491 SEMINAR FOR DISCUSSION GROUP LEADERS IN THE FRESHMAN SEMINAR PROGRAM SPRING SEMESTER 2
Claremont - FACULTY - 159
letters to natureanomaly, morphotropic phases need to be determined under high electric-eld driving. However, this evaluation is very difcult to perform, and is left for future studies. On the other hand, it is obvious in Fig. 4a that the textured L
Lake County - ECE - 573
Prof. George Gross ECE 573 Solution of Homework 7 The solution requires the capability curve of the generator at bus 2. The data corresponding to the specific situations discussed in the problem needs to be considered together with the capability cur
University of Hawaii - Hilo - SOC - 200830
Sociology 336 Deviance and Social Control Spring, 2007 Barringer ARCH 205, TTH 1:30-2:45SYLLABUS* Sociology 336 is an introduction to the subfield of sociology that studies the ways different societies define deviance and then attempt to control it
University of Hawaii - Hilo - SOC - 200830
Sociology 715(005) Seminar in Current Issues in Sociology: Sociology of Family Spring 2008 F 0230-0500 THIS IS TENTATIVE. SOC Sociology 715(005) (Spring 2008) Seminar in Current Issues in Sociology: Sociology of FamilyF 1:30-4:00 Course Description
San Jose City College - SOC - 122
COURSE SYLLABUS JOHNSON COUNTY COMMUNITY COLLEGE INTRODUCTION TO SOCIOLOGY (SOC 122) FALL 2008 Professor: Eve Blobaum, M.S. Email: eblobaum@jccc.edu Phone: 913-469-8500 ext. TBA Office Location: OCB 261F Office Hours: 1-2pm MWF; 3-4pm MW; mornings (M
CSU LA - BUS - 101
Mid-Term Exam Revised BUS 101-301/Fall 2004 Changed Questions, Answers, and Instructions Are Noted In RED There are 30 questions. Each is worth 3.33 points. You will take the test in-class. Bring a regular-sized Scantron. Please refer to the 2003-200
National Taiwan University - SOC - 101
SOCIOLOGY 101 INTRODUCTORY SOCIOLOGY Spring Quarter, 2005 COURSE OUTLINE: Text: Reprint: James M. Henslin, Sociology [SOC]: A Down-to-Earth Approach, Seventh Edition, 2005 John Finley Scott, &quot;The American College Sorority: Its Role in Class and Ethni
University of Hawaii - Hilo - SOC - 200830
SPRING 2008 SYLLABUS FOR SOCIOLOGY 454 W ANALYSIS IN MEDICAL SOCIOLOGY T, R -130-0245 STJHN11Dr. Eldon L. Wegner E-mail: wegner@hawaii.edu Saunders Hall 247, 956-7152 Hours: T TH 10:30-11:30 and by appointmentClass: TTh 1:30 -2:45 p.m.PREREQUIS
CSU Sacramento - M - 114
Fall 2004 Section:_Tsai Name:_MIS 150 - Database Management Systems for Business Exam 2 Part II: open books and notes 13. (14 points) MIS, Inc. is a transportation service company located in Sacramento City. MIS offers three different types of se