Presentation is loading. Please wait.

Presentation is loading. Please wait.

MCS 231: Concepts of Data Structure Class Hour: Section 1: MW 2:15PM - 3:30PM. Hyland 2306.

Similar presentations


Presentation on theme: "MCS 231: Concepts of Data Structure Class Hour: Section 1: MW 2:15PM - 3:30PM. Hyland 2306."— Presentation transcript:

1 MCS 231: Concepts of Data Structure Class Hour: Section 1: MW 2:15PM - 3:30PM. Hyland 2306

2 Instructor contact information (fastest way to contact me) McGraw 106 Office Hours: 9:00am – 11:00am MTW or by appointment

3 Course Objectives -Given a basic data structure (e.g. queue, stack, list), students will be able to apply the theory to implement applications using those data structures and analyze efficiency of each type. -Given a complex data structure (trees, graph),students will be able to design and implement it, apply theory, and compute its efficiency. -Given a large project that uses basic and complex data structures, students will be able to implement it using advanced Java techniques such as inheritance and polymorphism, interfaces and abstract classes, and the use of classes from the JAVA API.

4 Course Objectives -Given a basic data structure (e.g. queue, stack, list), students will be able to apply the theory to implement applications using those data structures and analyze efficiency of each type. -Given a complex data structure (trees, graph),students will be able to design and implement it, apply theory, and compute its efficiency. -Given a large project that uses basic and complex data structures, students will be able to implement it using advanced Java techniques such as inheritance and polymorphism, interfaces and abstract classes, and the use of classes from the JAVA API.

5 Course Objectives -Given a basic data structure (e.g. queue, stack, list), students will be able to apply the theory to implement applications using those data structures and analyze efficiency of each type. -Given a complex data structure (trees, graph),students will be able to design and implement it, apply theory, and compute its efficiency. -Given a large project that uses basic and complex data structures, students will be able to implement it using advanced Java techniques such as inheritance and polymorphism, interfaces and abstract classes, and the use of classes from the JAVA API.

6 Technology Requirement J2SE Software Development Kit (SDK): ): sp (just download SDK 5.0 or later) sp Eclipse:

7 Course detail - Evaluation GRADABLEPOINTS Labs100 Mid term Exam150 5 Projects500 Final Exam200 Quizzes50 Total1000

8 Grading (+/-)

9 Quiz Quiz is used to measure: - class attendance - class preparation Not all material will be covered in a 75-minute class –Book complements the lectures

10 Must-have for success Reading textbookPracticing (labs+projects)Devote time) ++ =

11 Philosophy for teaching Data Structure in this course Traditional way: implementing everything + starting from beginning+ focusing on complexity analysis Modern way: taking advantages of built-in methods from Java/C++ Hybrid way: taking advantages of built-in methods for simple data structure + implement everything for complex data structure + emphasize on complexity analysis

12 Philosophy for teaching Data Structure in this course Traditional way: implementing everything + starting from beginning+ focusing on complexity analysis Modern way: taking advantages of built-in methods from Java/C++ Hybrid way: taking advantages of built-in methods for simple data structure + implement everything for complex data structure + emphasize on complexity analysis

13 Philosophy for teaching Data Structure in this course Traditional way: implementing everything + starting from beginning+ focusing on complexity analysis Modern way: taking advantages of built-in methods from Java/C++ Hybrid way: taking advantages of built-in methods for simple data structure + implement everything for complex data structure + emphasize on complexity analysis

14 Getting started… Prerequisite:MCS 220 What do we still remember or know about Java and Software life cycle activity?

15 Class Focus Balance between theory and implementation Strict deadlines, high standard, ridiculous demands (always)

16 Assessment Prerequisite:MCS 220 What do we still remember or know about Java and Software life cycle activity?

17 Assessment 1.1 What does “UML” stand for? a. Understanding Modern Language b. Unified Modeling Language c. Unified Modern Language d. Understanding Modeling Language

18 Assessment 1.2 This task is not included in a software development process. a. Architectural, component, and detailed designs b. Implementation c. Acceptable tests d. Maintenance e. Marketing

19 Assessment 1.3 Which of the following symbols can be used in a UML class diagram to represent access ability of a data member or a method a.– b. + c. # d.*

20 Assessment 1.5 What is the complexity of selection sort a. O(n) b. O(nlog 2 (n)) c. O(n 2 ) d. O(log 2 (n))

21 Assessment 2.1 Overriding a method differs from overloading a method because: a. For an overloaded constructor, the superclass constructor will always be called first. b. For an overridden constructor, the superclass constructor will always be called first. c. Overloaded methods have the same signature. d. Overridden methods have the same signature

22 Assessment 2.2 Using the protected keyword gives a member: a.public access (any classes can access it). b.package access (only classes in the same inheritance hierarchy can access it). c.private access (nobody can access it) d.block scope (only the variables inside the same block can access it).

23 Assessment 2.3 Suppose method1 is declared as void method1 ( int a, float b ) Which of the following methods overloads method1? a. void method2 ( int a, float b ). b. void method2 ( float a, int b ). c. void method1 ( float a, float b ). d. void method1 ( int b, float a ).

24 Assessment 2.5. Variables should be declared as data members only if a. they are local variables. b. they are used only within a method. c. they are required for use in more than one method or their values must be saved between calls to the class’s methods. d. they are arguments.

25 Java development environment and Review of Java

26 Eclipse TM Intergrated Development Environment (IDE) Running Eclipse: Warning: Never check the “Use this as the default and do not ask again” box.

27 The importance of workspace This is where you will find all your java files. You can switch from one workspace to another. You need to define the workspace first (where you want to put your files) before click on OK

28 Eclipse TM tutorial Perspective is a set of related Views (windows) that enable a development specialist to perform specific tasks

29 Create an Eclipse project From the Eclipse menu bar select File, New, Project to start the “New Project” wizard. Select “Java Project” and click “Next”.

30 Create an Eclipse project

31 Create a Java package Structure in dot format: for example: com.tm.tutorial.main

32 Create Java classes Create Application class under com.tm.tutorial.main package

33 Create Java classes Create Application class under com.tm.tutorial.main package

34 Implementation of Java class

35 Generating setters and getters for attributes

36 Implementation of Java class Generating constructors

37 Implementation of Java class Generating constructors

38 Compile Java Application

39

40 Run the application

41

42

43

44 Run Application (Shorter way)

45 Setting up preferences in Eclipse If you did not download the JDK earlier in this tutorial, and your existing JRE does not appear in the “Installed JREs” preference, you must add it yourself.

46 Setting up preferences in Eclipse

47

48 Introduction to Software Design

49 Chapter 1: Introduction to Software Design 49 The Software Challenge In industry, a software product is expected to be used for an extended period of time by someone who did not write the program and who is not intimately familiar with its internal design Initial specification for a software product may be incomplete Specification is clarified through extensive interaction between users of the software and the system analyst

50 The Software challenge A requirements specification should be generated at the beginning of any software project Designers and users should both approve the document

51 Chapter 1: Introduction to Software Design 51 The Software Life Cycle Software Life Cycle: the sequence of stages that software products go through as they mature from initial concept to finished product

52 Chapter 1: Introduction to Software Design 52 Software Life Cycle Models Waterfall model: simplest way of organizing activities that transform software from one stage to another Activities are performed in sequence and the results of one flows into the next Waterfall model is simple but unworkable –Fundamental flaw is assumption that each stage can and must be completed before the next one occurs

53 Chapter 1: Introduction to Software Design 53 Waterfall Model

54 Chapter 1: Introduction to Software Design 54 Waterfall Model (continued)

55 Chapter 1: Introduction to Software Design 55 Software Life Cycle Models (continued) Unified Model: the cycles are called phases and iterations and the activities are called workflows Four phases –Inception –Elaboration –Construction –Transition

56 Chapter 1: Introduction to Software Design 56 Software Life Cycle Models (continued)

57 Chapter 1: Introduction to Software Design 57 Software Life Cycle Activities (continued) Certain activities are essential for software development –Requirements specification –Architectural, component, and detailed designs –Implementation –Unit, integration, and acceptance tests –Installation and maintenance

58 Chapter 1: Introduction to Software Design 58 Software Life Cycle Activities (continued) Requirements Specification –System analyst works with software users to clarify the detailed system requirements –Questions include format of input data, desired form of any output screens, and data validation Analysis –Make sure you completely understand the problem before starting the design or program a solution –Evaluate different approaches to the design

59 Chapter 1: Introduction to Software Design 59 Software Life Cycle Activities (continued) Design –Top-down approach: breaking a system into a set of smaller subsystems –Object-oriented approach: identification of a set of objects and specification of their interactions –UML diagrams are a design tool to illustrate the interactions between Classes Classes and external entities

60 Chapter 1: Introduction to Software Design 60 Software Life Cycle Activities (continued)

61 Chapter 1: Introduction to Software Design 61 Using Abstraction to Manage Complexity An abstraction is a model of a physical entity or activity Abstraction helps programmers deal with complex issues in a piecemeal fashion Procedural abstraction: distinguish what is to be achieved by a procedure from its implementation Data abstraction: specify the data objects for a problem and the operations to be performed on them without concern for their representation in memory

62 Chapter 1: Introduction to Software Design 62 Using Abstraction to Manage Complexity (continued) If a higher-level class references a data object only through its methods, the higher-level class will not have to be rewritten, even if the data representation changes Information hiding: Concealing the details of a class implementation from users of the class

63 Chapter 1: Introduction to Software Design 63 Abstract Data Types A major goal of software engineering is to write reusable code Abstract data type (ADT): The combination of data together with its methods

64 Interface A Java interface is a way to specify an ADT –The interface specifies the names, parameters, and return values of the ADT methods without specifying how the methods perform their operations and without specifying how the data is internally represented Each class that implements an interface must provide the definitions of all methods declared in the interface

65 Chapter 1: Introduction to Software Design 65 Abstract Data Types, Interfaces You cannot instantiate an interface You can declare a variable that has an interface type and use it to reference an actual object A Java interface is a contract between the interface designer and the programmer who codes a class that implements the interface

66 Pre-condition, Post-condition Precondition: a statement of any assumptions or constraints on the method data before the method begins execution Postcondition: a statement that describes the result of executing a method

67 Chapter 1: Introduction to Software Design 67 Requirements Analysis, Use Cases, and Sequence Diagrams First step in analysis is to study the problem of input and output requirements carefully to make sure they are understood and make sense Use case: list of the user actions and system responses for a particular sub-problem in the order that they are likely to occur Sequence diagram: shows all the objects involved in this use case across the horizontal axis, time is shown along the vertical axis


Download ppt "MCS 231: Concepts of Data Structure Class Hour: Section 1: MW 2:15PM - 3:30PM. Hyland 2306."

Similar presentations


Ads by Google