4 Pages

day2

Course: COP 3503c, Spring 2001
School: UCF
Rating:
 
 
 
 
 

Word Count: 1000

Document Preview

3503 COP Computer Science II CLASS NOTES INTRODUCTION TO OOP Terminology DAY #2 Class Complete description of an object Provides the model, or pattern, from which an object is created. Example: An architect creates a blueprint when designing a house. The blueprint defines the important characteristics of the house: walls, windows, doors, electrical outlets, etc. Once the blueprints are created, several...

Register Now

Unformatted Document Excerpt

Coursehero >> Florida >> UCF >> COP 3503c

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.
3503 COP Computer Science II CLASS NOTES INTRODUCTION TO OOP Terminology DAY #2 Class Complete description of an object Provides the model, or pattern, from which an object is created. Example: An architect creates a blueprint when designing a house. The blueprint defines the important characteristics of the house: walls, windows, doors, electrical outlets, etc. Once the blueprints are created, several houses can be built using the same blueprint. In one sense the houses built from the same blueprint are different. They are in physically different locations, have different addresses, different furniture, and different people live in them. Yet in many ways they are the same. The layout of the rooms is the same, the electrical outlets are in the same locations as are the windows, etc. To create a completely different house we need a different blueprint. A class is a blueprint of an object. It defines the type of data that will be held in an object and defines the code for the methods. But a class is not an object any more than a blueprint is a house. Container for methods and data. Reserves no space for data each object has its own data space (reserved at time of instantiation) Constructors are used to instantiate an object. Instantiation Once a class is defined, an object can be created from it. The process of creating an object is called instantiation. Every object is an instance of a particular class. Example: Just as several houses can be created from a single blueprint, several objects can be instantiated from the same class. They are the same type of object with the same methods, but each object is unique because each has its own data space with possibly different values. Once an object has been instantiated, the dot operator allows access to its methods. (Like System.out.println) Method A group of programming statements that are given a name. Specific tasks to be performed on the objects data. A complete description of an objects actions. Day 2 - 1 The behavior of an object. Form is: return-type method-name (parameter-list) { statement-list } May declare local variables that cannot be accessed outside of the method. Shared amongst all objects of the class. Object Contains variables and methods. The values of the variables define the state of the object and the methods define the behavior of the object A region in memory in which information in the form of a collection of data and methods are stored for use by the program. Data = state, Methods = behavior An instance of a class. Object-Oriented Paradigm EVERYTHING is an object. Computations are performed by objects (this represents the objects behavior) on the state of an object (its data) and by communication with other objects (method calls). Each object has its own memory. Each object is an instance of a class. Classes are organized in a tree structure (e.g. inheritance hierarchy). Structure of an OOP A collection of classes. Some are specific and developed for the problem and some are general and developed as polymorphic solutions (recall polymorphic solutions). Inheritance hierarchy. (IS-A). apple [An is-a fruit.] Object-Oriented Programming Modeling real world scenarios and events with software components. A way of thinking about the problem at hand. The focus is on the objects and the interaction between them. A means of implementing the Object Paradigm. A "real-world" system. Day 2 - 2 Examples: School environment (small) Code developed by one programmer. Usually only understood by the programmer (hopefully the instructor too!) Solves a particular problem by design. The developed system has a very short life cycle. Biggest problem confronting the programmer is usually the due date. Real world (large) Code is typically developed by a team of programmers with management input. Usually there is no one who understands what is going on in all parts of the project. Typically designed to solve a "systems" level problem. Typically designed to have a long life cycle. Biggest problem is commonly communication amongst the developers. Solution is modular (divide and conquer strategy at the macro level). Enforced encapsulation. Designed with a high degree of reusability, compatibilty, continuity, and polymorphism (+ dynamic binding). Concurrency Object Oriented Design Patterns These are a set or recurring patterns of interactions between objects. Containers A container represents a group of objects, called elements. The elements may be ordered, unordered, duplicated or unique depending upon implementation. An object which holds other objects within it. A container has capacity and objects can be inserted and removed. All containers support the following operations: test for empty, return size, position at beginning, and position past the end. The first is a Boolean test, the second returns a number, and the last two return an iterator. Iterators An object which allows access to and iteration through all of the elements in a container. All iterators share a common interface and encapsulate the container. Day 2 - 3 Constructors Similar to a method and is used to initialize an object. Has the same name as the class of object that it initializes. References A reference (shorthand for a reference variable) is a variable that stores the memory address of where an object resides (or null if it references no object). Java does not allow references to primitive types (byte, short, int, long, float, double, char, Boolean). Primitive types are handled by value, nonprimitive types are handled by reference. Accessors and Mutators An accessor is a method which examines but does not change the state of an object. Special cases of accessors examine only a single field and typically have names beginning with get (i.e., getMonth, getNext, etc.). A mutator is a method which can change the state of an object (it mutates the state of the object). Special cases of mutators change only a single field and typically have names beginning with set (i.e., setDay, setValue, etc.). The advantage a mutator has over making the field public is that the mutator can ensure that changes to the state of the object are consistent (an integrity check). Day 2 - 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:

UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #3Algorithm Analysis Algorithm - a clearly specified set of instructions that the computer will follow to solve a problem. Algorithm Analysis - determining the amount of resources that the algorithm w
UCF - COP - 3503c
COP 3503 CS II CLASS NOTES - DAY #3 Supplemental Asymptotic Notation Big Oh Notation Definition: Let p(n) and q(n) be two nonnegative functions. The function p(n) is asymptotically bigger [p(n) asymptotically dominates q(n)] than the function q(n)
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #4 A Closer Look at Linear, Quadratic, and Cubic Algorithms In order to more closely examine the differences in running times of linear, quadratic, and cubic algorithms, consider the following problem:
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #5General Big-Oh Rules Def.(Big-Oh): T(N) is O(F(N) if there are positive constants c and No such that T(N) cF(N) when N No. [an upper bound] Def. (Big-Omega): T(N) is (F(N) if there are positive c
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #6Chapter SixData Structures Most algorithms require a proper representation of the data in order to achieve efficiency. This representation and the operations that are allowed are called a data str
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #7 General Trees A tree consists of a set of nodes and a set of edges that connect pairs of nodes. A tree is an instance of a more general data structure known as a graph. We will be concerned with roo
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #8 Chapter 7 More on Recursion Lets look at a couple recursive static methods in Java that calculate Fibonacci and Factorials, respectively: public static int Fibonacci(int n) { if (n < 0) return 1; /
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #9 Upper Bounds for Divide and Conquer Algorithm Running Times The analysis of the divide and conquer algorithm to solve the MCSS problem illustrated that a problem divided into two parts, each solved
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #10 Backtracking Algorithms Backtracking algorithms use recursion to try all possible solutions and pick the optimal solution from the set of all solutions. This is a common strategy employed in AI gam
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #11CHAPTER 8SORTINGSorting is one of the fundamental applications of computer systems. Almost everything done on a computer involves sorting of some kind. We will be concerned here only with intern
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #11 SupplementElementary Sorting AlgorithmsSelection Sort Selection sort is an attempt to localize the exchanges of array elements by finding a misplaced element first and putting it in its final pl
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #12Mergesort The mergesort sorting algorithm uses the divide and conquer strategy in which the original problem is split into two half-size, recursively solved problems. If the overhead of the base c
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #12 SupplementEfficient Sorting AlgorithmsThe O(N2) limit for sorting based upon inversion removal for adjacent elements is too costly for large sorts and must be broken down to improve efficiency a
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #17 PART III - APPLICATIONS Chapter 11 Stacks and Compilers Stacks are a commonly used data structure in compilers. We will examine two of the basic uses of the stack data structure in a compiler, (1)
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #18 Expression Trees Expression trees are a useful technique for representing and evaluating expressions. The leaves of an expression tree represent the operands of the expression which may be either c
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #20 Linked Lists Chapter 16General Characteristics Allow general access (i.e., not constrained to the beginning or end of the list as with a stack or a queue). Consists of dynamically allocated no
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #20 Supplement Although the concept of linking is common to all linked lists, a number of other issues can affect the implementation of a linked list in different fashions. Many of the design considera
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #21 Doubly Linked Lists Better than singly linked list as they are bi-directional. Has both a header and a tail node (for the same reason that we added the header node to the singly linked list). nul
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #22Chapter 17 TREES Techniques for defining a tree There are two basic techniques that can be used to define a tree. 1. Recursively: this allows for very simple algorithms to manipulate the tree. 2.
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #23 Huffman Coding Tree public class HuffNode { protected boolean children; protected char root; protected HuffNode left; protected HuffNode right; public HuffNode ( ) { children = false; root = null;
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #23 SupplementHuffman Coding RevisitedExample: Suppose that we have a four letter alphabet consisting of a, b, c, and d, and e only. To encode four letters requires 2 bits. Suppose that these are a
UCF - COP - 3503c
COP 3503 Computer Science II Spring 2000 - CLASS NOTES - DAY #24 Hashed Tables Hash tables (files) rely on hashing to perform insertion, deletion, and retrieval in constant time. Hashing functions are a mapping between a key value and a location
UCF - COP - 3503c
COP 3503 Computer Science II CLASS NOTES - DAY #25 Priority Queues A priority queue is a structure where the highest priority item is the next item that will be dequeued. Implementation typically sets the highest priority item to have the lowest
UCF - COP - 3503c
COP 3503 Final Exam Practice ProblemsThese problems are similar in nature to those that you will see on the final exam. The final exam in comprehensive and not every topic that we have covered is represented here so dont study for the final based u
UCF - COP - 3503c
COP 3503H Spring 2001 Homework - Induction Proofs For each of the following conjectures, produce an induction proof which proves the conjecture is true. Note that all of these conjectures are true.1. n 1, and n natural numbers, it is true that
UCF - COP - 3503c
COP 3503H Spring 2001 - Homework - Induction Proofs SOLUTIONS For each of the following conjectures, produce an induction proof which proves the conjecture is true. Note that all of these conjectures are true.1. n 1, and n natural numbers, it is
UCF - COP - 3503c
COP 3503 Final Exam Practice Problems - SOLUTIONS 1. For the binary tree shown below, show the output of a preorder traversal of the tree. Foradditional practice do: inorder, postorder, and level order traversals.ABEC DF G H IPreorder
UCF - COP - 3503c
COP 3503H Mid-term Exam Spring 2001Thursday March 1, 2001 [100 points] NO CALCULATORS MAY BE USED!NAME:KEYStudent ID:1. (15 points Induction Proof) Shown below is a conjecture. Complete an induction proof that proves the conjecture is tru
UCF - COP - 3503c
COP 3503H Spring 2001 Programming Assignment #1Points: This assignment is worth 100 points. [program 60pts write-up 40 pts] Due Date: Thursday February 15, 2001 in class ObjectiveIn class we discussed three different algorithms, each of differen
UCF - COP - 3503c
COP 3503H Spring 2001 Programming Assignment #2Due Date: March 27, 2001 at class time. Points: 100 total program 60 points, write-up 40 points Objective: You will implement the Insertion sort, the Shell sort, and the Quick sort algorithms (all of
UCF - COP - 3503c
COP 3503 Honors OverviewProject #3 PresentationIn this project you will research a data structure which will not be covered in the class. You will prepare a short paper and deliver a presentation to the class on the data structure that you have
UCF - COP - 4710
COP 4710 Fall 2007 Course CalendarAugustSunday MondayTuesday7 14 21 Classes Begin IntroductionWednesday1 2 9 16Thursday3FridaySaturday4 11 18 255 12 196 13 208 15 2210 17 2423 Chapter 1 Notes 30 Chapter 2 Notes262728
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Introduction to Database SystemsInstructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science Universi
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Introduction to Database SystemsInstructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science Universi
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 2 Introduction to Data ModelingInstructor :Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science Univer
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 2 Introduction to Data ModelingInstructor :Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science Univer
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 2 In Class ExercisesInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 2 In Class ExercisesInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 3 The Relational Data ModelInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science Un
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 3 The Relational Data ModelInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science Un
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 3 In Class ExercisesInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 3 In Class ExercisesInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 4 Relational Query Languages Part 1Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Scien
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 4 Relational Query Languages Part 1Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Scien
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 4 Relational Query Languages Part 2Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Scien
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 4 Relational Query Languages Part 2Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Scien
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 5 Introduction To SQL Part 1Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 5 Introduction To SQL Part 1Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 5 Introduction To SQL Part 2Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/ccop4710/fall2007School of Electrical Engineering and Computer Science
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 5 Introduction To SQL Part 2Instructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/ccop4710/fall2007School of Electrical Engineering and Computer Science
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 9 Data StorageInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of C
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 9 Data StorageInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of C
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 19 NormalizationInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapter 19 NormalizationInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University of
UCF - COP - 4710
COP 4710: Database Systems Fall 2007CHAPTER 22 Parallel and Distributed Database SystemsInstructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Comp
UCF - COP - 4710
COP 4710: Database Systems Fall 2007CHAPTER 22 Parallel and Distributed Database SystemsInstructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Comp
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapters 10 and 11 IndexingInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University
UCF - COP - 4710
COP 4710: Database Systems Fall 2007Chapters 10 and 11 IndexingInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science University
UCF - COP - 4710
COP 4710: Database Systems Fall 2007CHAPTERS 16 & 17 Transaction ProcessingInstructor :Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Scienc
UCF - COP - 4710
COP 4710: Database Systems Fall 2007CHAPTERS 16 & 17 Transaction ProcessingInstructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http:/www.cs.ucf.edu/courses/cop4710/fall2007School of Electrical Engineering and Computer Science
University of Texas - HDF - 338
1. What is head start? a. A federal program begun in 1965 as a legislative effort to break into, and alter, the poverty cycle. b. It is a comprehensive preschool program providing healthcare and nutrition services to families, including special needs