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.
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:
Maryland - CMSC - 131
Lecture Set 4:More About Methods and More About OperatorsMethodsDefinitions InvocationsMore arithmetic operators Operator Side effects Operator Precedence Short-circuitingCMSC 131 Fall 2009 Jan Plane (adapted from Bonnie Dorr)main methodpublic stat
Maryland - CMSC - 131
Lecture Set 5:Design and ClassesThis Set:Methods and Parameter PassingBasics of program designPseudo-codeObjects and classesHeapsGarbage CollectionMore about Creating Objects and classes in JavaMethodsConstructors, Accessors, MutatorsEquality
Maryland - CMSC - 131
Lecture Set #6:Encapsulaton, this,junit testing and Libraries1.2.3.4.5.Review of Parameter passingthispublic vs. private Choicesjunit testingLibrariesCMSC 131 Fall 2009Jan Plane (adapted from Bonnie Dorr)Tracing Parameters andMethodsRecal
Maryland - CMSC - 131
Lecture Set #7:Exceptions& Mutability Issues1.2.3.4.Break and Continue for LoopsExceptionsMutability/ImmutabilityStringbuffer classCMSC 131Fall 2009Jan Plane (adapted from Bonnie Dorr)break from loopsbreak can also be used to exit immediatel
Maryland - CMSC - 131
Lecture Set #8: Debugging1. 2.Complete Class Summary The Eclipse DebuggerCMSC 131 Fall 2009 Jan PlanePutting the pieces togetherConstructorsdefault constructor constructors with parameters copy constructorsDatadata members: instance/static and pub
Maryland - CMSC - 131
Lecture Set #9: Arrays IntroThis lecture set: Intro to arrays Copying arrays and making arrays bigger Array lengths and out-of-bounds indexing Passing arrays and array elements to a function Privacy Leaks Different levels of copyCMSC 131 Fall 2009 Jan P
Maryland - CMSC - 131
11/1/2009Lecture Set #10:Two-Dimensional Arrays2-dimensional arrays1.1.2.Ragged ArraysRectangular ArraysCMSC 131 Fall 2009Jan Plane (adapted from Bonnie Dorr)Recall ArraysArrays: sequences of elements from the same basetypeint[] a;Date[] d;
Maryland - CMSC - 131
Lecture Set #11:Ternary Operatorand SwitchMethod Overloading Warningternary operator: The ?:(conditional operator)switchCMSC 131 Fall 2009Jan Plane (adapted from Bonnie Dorr)Method OverloadingMethod definitionpublic static void f(int x, float y
Maryland - CMSC - 131
Lecture Set #12:PolymorphismIntroduction1.2.WrappersInterfacesCMSC 131 Fall 2009Jan Plane (Adapted from Bonnie Dorr)WrappersW e may want to treat primitives as though they were objectsFor example, generic routines can be implemented using inter
Maryland - CMSC - 131
Lecture Set #13:Algorithms and Design1.2.3.Algorithmic DesignAlgorithmic AnalysisSystem DesignCMSC 131 Fall 2009Jan Plane (Adapted from Bonnie Dorr)What is an algorithm?The method used to solve a particular problem is called analgorithm.Examp
Maryland - CMSC - 131
Lecture Set #14:Command Line RunningIssues & Comments1.2.3.Command-line JavaArguments to Main MethodCommenting ReviewCMSC 131 Fall 2009Jan Plane (adapted from Bonnie Dorr)Command-Line JavaSource File:an ASCII text file named appropriately for
Maryland - CMSC - 131
Lecture Set #15: Collections1.1. 2.CollectionsArrayList Stack2.1.New Looping constructfor each loopCMSC 131 Fall 2009 Jan Plane (adapted from Bonnie Dorr)Collections in JavaArrays are collectionsArrays are objects Arrays are sequences of eleme
Maryland - CMSC - 131
Lecture Set # 16:Packages1.PackagesCMSC 131 Fall 2009Jan Plane (adapted from Bonnie Dorr)Java Program OrganizationProgram Organization:Java program: is composed of 1 or more Java source files.Source file: can have 1 or more class and/or interface
Maryland - CMSC - 131
Lecture Set #17:InheritanceInheritanceConceptualIs-A relationship compared to contains-aTerminologyOverloading compared to OverridingsuperisInstanceOf and getClass()CMSC 131 Fall 2009Jan Plane (adapted from Bonnie Dorr)InheritanceA crucial fea
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IICourse IntroductionDepartment of Computer ScienceUniversity of Maryland, College ParkCourse Catalog DescriptionIntroduction to use of computers to solveproblems using software engineeringprinciplesDesign, bu
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIObject-OrientedProgramming IntroDepartment of Computer ScienceUniversity of Maryland, College Park1Object-Oriented Programming (OOP)Approach to improving softwareView software as a collection of objects (ent
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIObject-OrientedProgramming & JavaLanguage ConstructsDepartment of Computer ScienceUniversity of Maryland, College Park1Review of Java Language ConstructsBasic elementsPrimitive types, variables, constants,
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIAbstract ClassesDepartment of Computer ScienceUniversity of Maryland, College ParkModifier AbstractDescriptionLeave lower-level details to subclassDefines contract for subclassesAllows inheritance of other m
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIJava Support for OOPDepartment of Computer ScienceUniversity of Maryland, College ParkOverviewObjects & class, this, superReferences, alias, levels of copyingConstructor, initialization blockGarbage collecti
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIProgram Correctness,ExceptionsDepartment of Computer ScienceUniversity of Maryland, College ParkOverviewProgram correctness is determined by thepresence / absence of program defects (errors)IssuesTypes of e
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIJava Inner ClassesDepartment of Computer ScienceUniversity of Maryland, College Park1Java ClassesTop level classesDeclared inside packageVisible throughout package, perhaps furtherNormally declared in their
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIGraphical User Interface(GUI)Department of Computer ScienceUniversity of Maryland, College Park1Graphical User Interface (GUI)User interfaceInterface between user and computerBoth input and outputAffects u
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIAlgorithmic Complexity IDepartment of Computer ScienceUniversity of Maryland, College Park1Algorithm EfficiencyEfficiencyAmount of resources used by algorithmTime, spaceMeasuring efficiencyBenchmarkingAsy
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIAlgorithmic Complexity IIDepartment of Computer ScienceUniversity of Maryland, College Park1OverviewCritical sectionsComparing complexityTypes of complexity analysis2Analyzing AlgorithmsGoalFind asymptot
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IICollection Abstractions &Java CollectionsDepartment of Computer ScienceUniversity of Maryland, College ParkCollectionPrograms represent and manipulateabstractions (chunks of information)Examples: roster of s
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IILinear Data StructuresDepartment of Computer ScienceUniversity of Maryland, College ParkOverviewLinear data structuresGeneral propertiesImplementationsArrayLinked listRestricted abstractionsStackQueueLi
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIGeneric ProgrammingDepartment of Computer ScienceUniversity of Maryland, College ParkGeneric ProgrammingGeneric programmingDefining constructs that can be used with differentdata typesI.e., using same code f
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIHashingDepartment of Computer ScienceUniversity of Maryland, College Park1HashingHashingHashing function function that maps data to a value (e.g.,integer)Hash Code/Hash Value value returned by a hash functi
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IISets and MapsDepartment of Computer ScienceUniversity of Maryland, College Park1How Do Collections Work in Java?Elements are NOT copied when insertedCollection contains references, not objectsFinding matchin
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIRecursive AlgorithmsDepartment of Computer ScienceUniversity of Maryland, College ParkRecursionRecursion is a strategy for solving problemsA procedure that calls itselfApproachIf ( problem instance is simple
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IITrees & Binary Search TreesDepartment of Computer ScienceUniversity of Maryland, College Park1TreesTrees are hierarchicaldata structuresOne-to-many relationshipbetween elementsParent nodeTree node / eleme
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIHeaps & Priority QueuesDepartment of Computer ScienceUniversity of Maryland, College ParkOverviewBinary treesCompleteHeapsInsertgetSmallestHeap applicationsHeapsortPriority queuesComplete Binary TreesA
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIJava I/O OverviewDepartment of Computer ScienceUniversity of Maryland, College Park1Input/OutputApproaches to store file dataText filesData represented in human-readable formExample: Java source programsUs
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IINetworkingDepartment of Computer ScienceUniversity of Maryland, College Park1NetworkingInternetDesigned with multiple layers of abstractionUnderlying medium is unreliable, packet orientedPacket-SwitchingAn
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IISoftware DevelopmentDepartment of Computer ScienceUniversity of Maryland, College Park1Modern Software DevelopmentWhy do we want to study the softwaredevelopment process?To understandSoftware development pr
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IISoftware Process ModelsDepartment of Computer ScienceUniversity of Maryland, College Park1OverviewSoftware process modelsWaterfallIterativeChoosing a software process modelLevel of understandingCost of ch
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIProblem Specification& Software ArchitectureDepartment of Computer ScienceUniversity of Maryland, College ParkOverviewProblem specificationObstaclesSoftware ArchitectureHow to divide workInterface & condit
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIProgram TestingDepartment of Computer ScienceUniversity of Maryland, College ParkProgram TestingEmpirical testingTest software with selected test casesTest failures frequently indicate software errorsAbsence
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIObject-Oriented DesignDepartment of Computer ScienceUniversity of Maryland, College ParkApplying Object-Oriented Design1.Look at objects participating in system2.Find nouns in problem statement (requirements
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIUnified Modeling Language(UML)Department of Computer ScienceUniversity of Maryland, College ParkUML (Unified Modeling Language)UML is a modeling language forSpecifyingVisualizingConstructingDocumentingobj
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIGraphs & Graph TraversalDepartment of Computer ScienceUniversity of Maryland, College Park1Graph Data StructuresMany-to-many relationship between elementsEach element has multiple predecessorsEach element ha
Maryland - CMSC - 132
CMSC 132:Object-Oriented Programming IIThreads in JavaDepartment of Computer ScienceUniversity of Maryland, College Park1ProblemMultiple tasks for computerDraw & display images on screenCheck keyboard & mouse inputSend & receive data on network
Maryland - CMSC - 250
RelationsCMSC 2501DefinitionsqA relation from X to Y is a subset of X YqIf R is a relation and (x,y) in R we denote this xRyCMSC 2502Exampleqq"Less than" relation from A = cfw_0,1,2 to B = cfw_1,2,3Use traditional notation0 < 1, 0 < 2, 0 <
Maryland - CMSC - 250
FunctionsCMSC 2501Function terminologyq A function maps elements of one set (called the domain)to another set (called the codomain).q Domain: the set which contains the values to which thefunction is appliedq Codomain: the set which contains the p
Maryland - CMSC - 250
Counting and ProbabilityCMSC 2501Countingq Counting elements in a list: how many integers in the list from 1 to 10? how many integers in the list from m to n? (assuming m n)CMSC 2502How Many in a List?q How many positive three-digit integers are
Maryland - CMSC - 250
Set TheoryCMSC 2501Set definitionsDefinition: A set is a collection of objects.Examples: A = cfw_1,2,3B = cfw_x Z | 4 < x < 4C = cfw_x Z+ | 4 < x < 4A set is completely defined by its elements, i.e.,cfw_a,b = cfw_b,a = cfw_a,b,a = cfw_a,a,a,b,b,b
Maryland - CMSC - 250
Mathematical InductionCMSC 2501Logic of Inductionq Induction principle:P(1)(n 1)[P(n) P(n+1)] (n 1)[P(n)]CMSC 2502Logic of Inductionq Induction principle:P(1)(n 2)[P(n-1) P(n)] (n 1)[P(n)]CMSC 2503Descriptionq Inductive proofs must have:
Maryland - CMSC - 250
Summations and ProductsCMSC 2501Sequences 2,4,6,8,for i 1ai = 2i an infinite sequencebi = (1)i for i 1 an infinite sequence for 1 i 6 ci = i + 5 a finite sequenceCMSC 2502Finding an explicit formulaq Figure out the formula for this sequenc
Maryland - CMSC - 250
Number TheoryCMSC 2501Introductory number theoryqA good proof should have: a statement of what is to be proven (labeled as Theorem,Lemma, Proposition, or Corollary) "Proof" to indicate where the proof starts a clear indication of flow a clear in
Maryland - CMSC - 250
Predicate LogicCMSC 2501QuantificationqqqqqqxThere exists an xxFor all x'sDomain- the set where these subjects come from( x) [P(x)] there exists an x for which predicate p is true(x) [P(x)] for all x, predicate p is trueNotation:x Zx R
Maryland - CMSC - 250
CircuitsCMSC 2501Find Boolean formula for:q p, q & rare thevariables.qroutput1111110110101001011001000CMSC 250p01000002Find Boolean Formulaq For each row with output 1 obtain mini-formula whichis 1 exactly on
Maryland - CMSC - 250
Discrete StructuresCMSC 250Lecture 1January 24-28, 2011CMSC 2501AdministrativeqqSyllabus (Online)Every week (mostly): Worksheet Quiz HomeworkqClass webpageTwo midterms, as noted on the syllabus (on the classwebpage)qAcademic integrityq
Maryland - CMSC - 250
CMSC 250-Discrete Structures, Spring 2011Syllabus: SHORT VERSIONSECOND MIDTERM IS APRIL 13, 2011 AT 6:00-7:30WHERE YOU WILL TAKE THE MIDTERM ON APRIL 13, 2011:1. If you are in sections 0101 or 0102 then take the midterm in CSI 1115.2. If you are in s
Maryland - CMSC - 250
SOLUTIONforPracticeExam,CMSC250Thesequestionsareintendedtoprovideareasonablycompleteoverviewoftheconceptswehavecoveredsofarthissemester.Theactualexamwillhavesomewhatfewerquestions,butdrawnlargelyfromthisgeneraltypeofquestion.Sincetherewasnohomeworkset
Maryland - CMSC - 250
Practice Exam, CMSC 250 These questions are intended to provide a reasonably complete overview of the concepts we have covered so far this semester. The actual exam will have somewhat fewer questions, but drawn la
Maryland - CMSC - 250
Relating Internal and External Path LenghtsDenition 0.1 A Full Binary Tree is a tree where every node has either 0 or 2 children.Denition 0.2 Let T be a tree. The leaves of T are the nodes at the bottom that have no children.The internal nodes of T are
Maryland - CMSC - 250
Weak and Strong InductionAuthor(s): J. C. ShepherdsonSource: The American Mathematical Monthly, Vol. 76, No. 9 (Nov., 1969), pp. 989-1004Published by: Mathematical Association of AmericaStable URL: http:/www.jstor.org/stable/2317124 .Accessed: 04/04/
Maryland - CMSC - 250
CMSC 250-Discrete Structures, Spring 20111DescriptionWe will study fundamental mathematical concepts that are relevant to computer science. Inparticular we will cover propositional and predicate logic, proof techniques, mathematicalinduction, element
Maryland - CMSC - 250
Spring-2011CMSC 250: Homework 12Due: Wed May 4, 2011NOTE: Due AT THE BEGINNING of Recitation!COURSE WEBSITE: http:/www.cs.umd.edu/ gasarch/250/S11.htmlNOTE: In this HW N = cfw_0, 1, 2, . . .. In this HW answer can use choose-notation or factorialsor
Maryland - CMSC - 250
Spring-2011CMSC 250: Homework 12Due: Wed May 4, 2011NOTE: Due AT THE BEGINNING of Recitation!COURSE WEBSITE: http:/www.cs.umd.edu/ gasarch/250/S11.htmlNOTE: In this HW N = cfw_0, 1, 2, . . .. In this HW answer can use choose-notation or factorialsor
Maryland - CMSC - 250
Spring-2011CMSC 250: Homework 11Due: Wed Apr 27, 2011NOTE: Due AT THE BEGINNING of Recitation!COURSE WEBSITE: http:/www.cs.umd.edu/ gasarch/250/S11.htmlNOTE: In this HW N = cfw_0, 1, 2, . . .. In this HW answer can use choose-notation or factorialso