Anzeige
Anzeige

### part 1 - intorduction data structure 2021 mte.ppt

1. DataStructuresandAlgorithms CSE153
2.  Our Course contains 6 main parts: 2/64  Part 1- Introduction to Data Structure and Algorithm  Part 2 – Array Data Structure  Part 3- List Data Structure  Part 4 –Stack And Queue Data Structure  Part 5 – Tree and Table Data Structure.  Part 6 – Algorithm (Sort and search )
3.  Course Objective The main objective of this course is to provide students with the theoretical background and practical experience relating to the design and implementation of Data structure. The main objectives of the course are: (1) Know the terminology associated with the Data structure field.  Data Structures Course Objectives  Be familiar with basic techniques of algorithm analysis  Master the implementation of linked data structures such as linked lists and binary trees  Be familiar with several sorting algorithms including quicksort, mergesort  Be familiar with path and minimum spanning tree  Master the standard data structure library of a major programming language (e.g. C#) 3
4.   Be able to classify data structures and algorithms as “good/bad”.  Know precise ways of analyzing whether a data structure or algorithm is good. Course Objectives 4
5.  Overall Picture Data Structure and Algorithm Design Goals Implementation Goals Correctness Efficiency Robustness Adaptability Reusability
6.  This course is not about:  Programming languages  Computer architecture  Software architecture  Software design and implementation principles  Issues concerning small and large scale programming  We will only touch upon the theory of complexity and computability 6 Overall Picture (2)
7.  Weekly Periodical sheets to assess understanding each chapter or terminated job Report : to assess gain of specific chapter and task Participation in the lecture to assess gain of specific chapter and task Lab activities to assess implementation of the practical parts Term project to assess understanding how to complete job Mid term and final Exam Assessment Methods 20% for and Projects and lab Activities 15 % for and lecture activities and attendance, Quizzes, report, project 15 % for midterm exam 50 % final exam 7
8.   A: 91-100  A-: 89, 90  B: 79 - 88  C: 70 - 78  D: 59 - 69  F: 0 - 58 Grade scale For a grade of C or better you must have both: •At least 300 points from all programming assignments •At least 300 points from exams 8
9.  Notes  Lecture attendance is very important. You lose ½ degree for each lecture you miss.  Late submission of the tasks will be marked with deduction of %10 per day.  The assignments, and of course the quizzes, and exams need to be done individually  Students have to attend Exams or lecture on time – No Excuse are accepted. 9
10.   All assignment are individual  Plagiarism is not tolerated/ FSU Honor code strictly enforced (see details in syllabus).  Automated detection tools will be employed!  Typically two weeks per-assignment  Start early  Ask questions early  Submit on time  Lateness policy (after 11:59PM on Fridays):  10% penalty < 24 hours delay  20% penalty < 48 hours delay  No points awarded > 48 hours delay, except in special cases with documented reasons Assignments 10
11.  Design Produce Measurement/ Analysis Reporting 3D Cad Model Authority Process Scope Computer in Industrial Life
12.  Computer in Industrial Life
13.  2D Drawing Authority 2D Drawing Interpretation Digital Product Line Today 3D Design 3D Model Release Tool Oriented Detail Assembly 2D drawing Assembly Inspection 3D Measurement Equipment MFG Engineering NC Programming Manufacturing Quality Assurance Tooling Product Integrated Digital Product Line 3D Model Assembly Inspection 3d Model Oriented Detail Assembly And Authority
14.  Wing Spar Test Program Aug 2000
15.  Overview of 3D Measurement Pilot Create 3D CAD Models of components, sub-assemblies and major components CATIA Model with Embedded Tolerancing Local Area/Zone X-form from Part Attributes Key Characteristics FD&T Tolerances Measurement Systems
16.  Functional Dimensioning and Tolerancing (FDT)
17.  Common Measurement Systems Interface
18.  21 Define: Computer Program • Series of instructions submitted to a computer to accomplish a task- Instructions must be written in a way the computer can understand • An organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. • A program contains a list of values (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. • The variables can represent numeric data, text, can be organized (structured) in different way
19.  Data Structure  Systematic way of organizing and accessing data.  are collection of variables, possibly of several different data types, connected in various ways.  A data structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths. Algorithm  Step-by-step procedure for performing some task in a finite amount of time. Definitions
20.   A Set of Instructions  Data Structures + Algorithms  Data Structure = A Container stores Data  Algoirthm = Logic + Control What is Program
21.   Formal data structures enable a programmer to mentally structure large amounts of data into conceptually manageable relationships  Sometimes we use data structures to allow us to do more: for example, to accomplish fast searching or sorting of data.  we can call the data structure an abstract data type (sometimes abbreviated as ADT). Abstract data types can minimize dependencies in your code Benefit of Data Structure
22.   Algorithm  Outline, the essence of a computational procedure, step-by-step instructions  Program – an implementation of an algorithm in some programming language  Data structure  Organization of data needed to solve the problem 25 Data Structures and Algorithms
23.   In programming, the term data structure refers to a scheme for organizing related pieces of information. The basic types of data structures include: Array lists Stack Queue Tree Table Data structure and programming
24.   Abstract Data Type (ADT)  A set of allowed data values, with a set of allowed operations.  Allows the user to create data types to their own specifications  All data must conform to the predefined structure, and this data may only be manipulated through a set of predefined operations.  These operations must not violate the integrity of the data structure.  The purpose of the ADT is to shield the programmer from the internal workings of the data structure, by giving access to the data only through the operations. Definitions
25.  Has zero or more inputs. Has at least 1 output. Each instruction is unambiguous. Terminates after a finite sequence of instructions. Each step is achievable. Properties of an Algorithm
26.   design the algorithm  goals:  correctness  efficiency  verify and prove correctness  goals:  will it work for all cases?  does it output the correct result? Developing Algorithms
27.   analyze the algorithm  goals:  how long will it run?  at what instance will it fail? Succeed?  rate of change of execution as data size increases?  implement the algorithm  coding and programming  goals:  robustness – ability to handle unexpected inputs  adaptability – ability to run with less changes in hardware & operating system platforms  reusability – use as diff component of other system for various Developing Algorithms (cont.)
28.   determine the running time of a program as a function of its inputs;  determine the total or maximum memory space needed for program data;  determine the total size of the program code;  determine whether the program correctly computes the desired result; Analysis of an Algorithm determine the complexity of the program • how easy it is to read, understand, and modify determine the robustness of the program • how well does it deal with unexpected or erroneous inputs?
29.   algorithm itself  input data  computer system used to run the program Factors that Affect Running Time hardware processor used (type and speed); memory available (cache and RAM) , and disk available the programming language in which the system is specified; the language compiler/interpreter used; and the computer operating system software
30.   Knowledge of a programming language  C#  Task to solve  Development environment, compilers, SDK  Visual Studio, .NET Framework SDK  Set of useful standard classes  Microsoft .NET Framework FCL  Help documentation  MSDN Library 33 What You Need to Program?
31.   Programming language A syntax that allow to give instructions to the computer  C# features: New cutting edge language Extremely powerful Easy to learn Easy to read and understand Object-oriented 34 What is "C#"?
32.   Visual Studio – Integrated Development Environment (IDE)  Development tool that helps us to:  Write code  Design user interface  Compile code  Execute / test / debug applications  Browse the help  Manage project's files 36 Visual Studio
33.   Single tool for:  Writing code in many languages (C#, VB, …)  Using different technologies (Web, WPF, …)  For different platforms (.NET CF, Silverlight, …)  Full integration of most development activities (coding, compiling, testing, debugging, deployment, version control, ...)  Very easy to use! 37 Benefits of Visual Studio
34.  38 Visual Studio – Example
35.  1. File  New  Project ... 2. Choose C# console application 3. Choose project directory and name 39 Creating New Console Application
36.  4. Visual Studio creates some source code for you 40 Creating New Console Application (2) Namespace not required Class name should be changed Some imports are not required
37.   The process of compiling includes:  Syntactic checks  Type safety checks  Translation of the source code to lower level language (MSIL)  Creating of executable files (assemblies)  You can start compilation by  Using Build->Build Solution/Project  Pressing [F6] or [Shift+Ctrl+B] 41 Compiling Source Code
38.   The process of running application includes:  Compiling (if project not compiled)  Starting the application  You can run application by:  Using Debug->Start menu  By pressing [F5] or [Ctrl+F5] * NOTE: Not all types of projects are able to be started! 42 Running Programs
39.   The process of application includes:  Spotting an error  Finding the lines of code that cause the error  Fixing the code  Testing to check if the error is gone and no errors are introduced  Iterative and continuous process 43 Debugging The Code
40.   Visual Studio has built-in debugger  It provides:  Breakpoints  Ability to trace the code execution  Ability to inspect variables at runtime 44 Debugging in Visual Studio
41.   // Namespace Declaration using System; // Program start class class WelcomeCSS { // Main begins program execution. static void Main() { // Write to console Console.WriteLine("Welcome to the C# "); } } First program in C# Welcome.cs Program 1
42.   The screen will run and close quickly when launching this program To prevent this add the following code as the last line in the Main method:  // keep screen from going away // when run from VS.NET Console.ReadLine();  You should be aware of is that C# is case-sensitive  The namespace declaration, using System;, indicates that you are referencing the System namespace. Namespaces contain groups of code that can be called upon by C# programs  The class declaration, class WelcomeCSS, contains the data and method definitions that your program uses to execute  The one method within the WelcomeCSS class tells what this class will do when executed  Every method must have a return type. In this case it is void, which means that Main does not return a value. Every method also has a parameter list following its name with zero or more parameters between parenthesis. For simplicity, we did not add parameters to Main. First program in C#
43.  // Namespace Declaration using System; // Program start class class NamedWelcome { // Main begins program execution. static void Main(string[] args) { // Write to console Console.WriteLine("Hello, {0}!", args[0]); Console.WriteLine("Welcome to the C#"); } } Getting Command-Line Input: NamedWelcome.cs Program 2
44.  There are 4 ways to define Main function. We use the simplest one. static void Main() {...} static void Main(string[] args) {...} static int Main() {...} static int Main(string[] args) {...} Main Method declaration C# Beginning
45.   Variable declarations  Statements Inside method Main static void Main(string[] args) { const double pi = 3.1416; int radius; double area; radius = int.Parse(Console.ReadLine()); area = pi*radius*radius; Console.WriteLine(area); } C# Beginning Program 3
46.  A simple C# Program Grouping using { } C# Language Overview Program 4
47.  A simple C# Program Statement ending with semicolon “;” C# Language Overview Program 5
48.  Console “Hello World”
49.  A simple C# Program C# syntax is case-sensitive namespace NAMEspace Main() main() C# Language Overview
50.  A simple C# Program Anything between /* */ or after // is considered a comment static void Main(string[] args) //comment here { /* This is comment too. */ Console.WriteLine("Hello World!"); } Comments will not be translated C# Language Overview
51.  Dissect The Program using System; class Program { public static void Main(string[] args) { Random r = new Random(); int answer = 1 + (r.Next() % 100); int g; do { Console.Write("Guess a number: "); g = int.Parse(Console.ReadLine()); if(g > answer) Console.WriteLine("Too large"); else if(g < answer) Console.WriteLine("Too small"); } while(g != answer); Console.WriteLine("That's correct"); } } The main program is contained in a function (method) called Main Program 6
52.  Every statement ends with a ; (semi-colon) Program 7
53.  Variables must be declared with proper data types before used. Here, double is a data type for storing a real number.
54.  Calculate the result and store it in s
55.  Output Statements
56.  Input Statement reads user input as a string
57.  Install at home: 1. Microsoft .NET Framework 2. Microsoft Visual Studio (or Visual C# Express) 3. Microsoft Developer Network (MSDN) Familiarize yourself with: Microsoft Visual Studio Microsoft Developer Network (MSDN) Library Documentation  Find information about Console.WriteLine() method. 61 Exercises 1 *NOTE: If you have any difficulties, search in Web.
58.  1. Provide a short list with information about the most popular programming languages. How do they differ from C#? 2. Describe the difference between C++ and .NET Framework. 3. Describe briefly .NET Framework. Indicate its key components? 4. What is Common Language Runtime (CLR)? Why it is important part of .NET Framework? 5. What is .NET assembly? What are its integral parts? 62 Exercises (2)
59.  6. Create, compile and run a “Hello C#” console application. 7. Modify the application to print your name. 8. Write a program to print the numbers 1, 101 and 1001 9. Create console application that prints your first and last name. 10. Create a console application that prints the current date and time. 11. Create a console application that calculates and prints the square of the number 12345. 12. Write a program to read your age from the console and print how old you will be after 10 years. Exercises (3)
Anzeige