CIS 200 Final Review. New Material Sorting Selection Sort  Repeated scan of list for smallest/largest value  Each swap with item in correct spot 

Slides:



Advertisements
Similar presentations
Searching Kruse and Ryba Ch and 9.6. Problem: Search We are given a list of records. Each record has an associated key. Give efficient algorithm.
Advertisements

Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Microsoft Visual C#.NET: From Problem Analysis to Program Design1 Chapter 9 Programming Based on Events Microsoft Visual C#.NET: From Problem Analysis.
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
© 2006 Pearson Addison-Wesley. All rights reserved10-1 Chapter 10 Algorithm Efficiency and Sorting CS102 Sections 51 and 52 Marc Smith and Jim Ten Eyck.
Programming Based on Events
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Advanced Object-Oriented Programming Features
Programming Based on Events
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
Sorting CS-212 Dick Steflik. Exchange Sorting Method : make n-1 passes across the data, on each pass compare adjacent items, swapping as necessary (n-1.
Concepts of Database Management Sixth Edition
Controls General Discussion. VB Controls Visual Basic Controls A control is the generic name for any object placed on a form Controls may be images,
Maps A map is an object that maps keys to values Each key can map to at most one value, and a map cannot contain duplicate keys KeyValue Map Examples Dictionaries:
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Recursion Bryce Boe 2013/11/18 CS24, Fall Outline Wednesday Recap Lab 7 Iterative Solution Recursion Binary Tree Traversals Lab 7 Recursive Solution.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
CIS 199 Test 01 Review. Computer Hardware  Central Processing Unit (CPU)  Brains  Operations performed here  Main Memory (RAM)  Scratchpad  Work.
1 Web-Enabled Decision Support Systems Objects and Procedures Don McLaughlin IE 423 Design of Decision Support Systems (304)
Recursion, Complexity, and Searching and Sorting By Andrew Zeng.
CIS 200 Final Review. New Material Data Structures.
CIS 200 Test 02 Review. Windows Forms, GUI Programming  Elements  Textboxes  Tab Groups  Checkboxes  Fields  Event Handlers  Visual Studio Designer.
PHP meets MySQL.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 9: Algorithm Efficiency and Sorting Data Abstraction &
Final Review Dr. Yingwu Zhu. Goals Use appropriate data structures to solve real- world problems –E.g., use stack to implement non-recursive BST traversal,
ListBox, ComboBox, Menu Chapter 5.4, ComboBox Control: Properties & Methods u Combines TextBox features with a short drop- down list  cboOne.AddItem(string)
Concepts of Database Management Seventh Edition
Introduction to Exception Handling and Defensive Programming.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Programming with Microsoft Visual Basic th Edition
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
1.
The ADT Table The ADT table, or dictionary Uses a search key to identify its items Its items are records that contain several pieces of data 2 Figure.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
CIS 199 Final Review. New Material Structures  Value type  NOT a reference type!  Used to encapsulate small groups of related variables.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
CIS 199 Final Review. New Material Classes  Reference type  NOT a value type!  Can only inherit from ONE base class.
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections UTPA – Fall 2011.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code that may be executed several times. Fixed-count (definite) loops repeat a fixed.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
CIS 200 Test 01 Review. Built-In Types Properties  Exposed “Variables” or accessible values of an object  Can have access controlled via scope modifiers.
Unit 6 Repetition Processing Instructor: Brent Presley.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Quick Test Professional 9.2. Testing Process Preparing to Record Recording Enhancing a Test Debugging Running the Test and Analyzing the Results Reporting.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code (loop body) that may be executed several times. Fixed-count (definite) loops repeat.
Searching and Sorting Searching algorithms with simple arrays
Visual Basic Fundamental Concepts
CIS 199 Test 01 Review.
Computing with C# and the .NET Framework
CIS 200 Test 01 Review.
CIS 200 Test 02 Review.
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
CIS 199 Test 01 Review.
Visual Basic..
Web Development Using ASP .NET
Introduction to Programming
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

CIS 200 Final Review

New Material

Sorting

Selection Sort  Repeated scan of list for smallest/largest value  Each swap with item in correct spot  Big O, N-1 Passes  Probes – O(N^2)  Data Movements – O(N)

Insertion Sort  Like cards being one at a time  Array is split into 2 logical parts, sorted and unsorted  On each pass, next item from unsorted walks (via swaps) to correct position in sorted portion  Big O, N-1 passes Best, Worst, Ave. cases  Best – O(N)  Worst – O(N^2), T(N) =1/2N^2 – 1/2N  Avg – O(N^2), T(N) = 1/4N^2…

Merge Sort Recursive 1.Divide list into 2 parts 2.Sort each part using recursion 3.Combine the 2 (now sorted) parts into one sorted list Big O  Best, Avg, Worst – O(N log2 N)

Quick Sort  Partition is the key Two approaches  Dr. Wright’s  Text, from E18.10, p. 745 Big O  Worst case is when pivot is extreme value (min or max)  Already sorted list!  O(N^2)  Best/Avg  O(N log2 N)  Really is twice as fast as merge sort on average

Data Structures

Linked List

Doubly Linked List

Queue

Stack

Binary Search Tree  How to add items  Show a well-balanced BST – Add in this order: 9, 7, 12, 15, 2  Show a poorly balanced BST – Add in this order: 2, 7, 9, 12, 15  How to search  Show Inorder traversal in BST

Traversals  Preorder  Inorder  Postorder

Generics  Generic methods  Generic classes

.NET Collections  Esp. Hash Table  Collisions  Bucket – Linked List  Load Factor

Test 01 Material

Memory Management  C, C++ - Have to “allocate” memory  Forgetting to “free” results in memory leaks  “Garbage Collector” Rounds up and “reclaims” memory  Variables that drop out of “scope” will be collected  Temporary values inside methods reclaimed on method exit  Generally uncontrolled by the developer

LINQ Language Integrated Query  Perform Queries Against Objects, Data

LINQ Keywords  “from” - Data Source  “where” – Filters the source elements with Boolean expressions  “select” – Choosing the data type to work with  “group” – Groups results according to a desired key value  “orderby” – Sorts the query results in ascending or descending order based on a comparer  “let” – Introduce a variable for query use  Select new creates anonymous class as result set

Namespaces, Scope Classes, often with common functionality, bundled together  System.Console  System.Collections.Generic  System.Linq Scope  “private” – Can only be accessed by the class, object itself  “protected” – Can only be accessed by the class, object, or any child classes, objects  “public” – Available access for all

Constructors C#,.NET compiler provides a ‘free’ constructor - Default  No parameters  When a new constructor is created, ‘free’ constructor goes away  Constructors can be “connected” with “this”

Interfaces  Object used for creating “interfaces”, common code  Classes “implement” an interface  All methods, properties are “abstract” in an interface  Objects that implement interface can be grouped  List  IPayable, IDisposable, etc

Inheritance  Classes with child or children classes  Can be used to “share” common code properties  Allows for “unique” objects, while reducing code  Object -> Person -> Student  Object -> Person -> Employee

Polymorphism  Override  Virtual  abstract

Inheritance - Keywords  “abstract” – Methods marked MUST be overridden  Class declared with abstract prevents creation with “new”  “virtual” – Methods marked CAN be overridden  Controls “how” other classes inherit information from the class  Private, protected, public – Used to control what is inheritance

Casting  Convert one type to another  Integer to String  Decimal to Integer  Byte to Integer  C#,.NET will know how to “box” and “unbox” types  Decimal -> Object -> Integer  Remember back to the Person – Student relationship  We can “cast” Person to Student both ways

Will compile, But will throw an EXCEPTION at runtime Will cast to student just fine

Exceptions and Exception Handling  Exceptions are…  “Exceptional” events  Unexpected events, errors during runtime  Unhandled exceptions? Stack trace and application death  Handled with try/catch/finally blocks  Try block “attempts” to run the code in question  Catch block handles the exception(s) that may occur  Finally block, optional, always executes

Vs. multiple catches  What order must the catch clauses appear?

Test 02 Material

Windows Forms, GUI Programming  Elements  Textboxes  Tab Groups  Checkboxes  Fields  Menus  Combobox  Event Handlers  Visual Studio Designer

Event Handlers  “Events” triggered by end user  Button Press  Key Press  Field Entry  …other GUI modifications or events

Role of Delegates in Event Handling  Sender?  E?  Need examples

Files and Streams  Files  Objects on Disks  Streams  Data structure that exposes  Read  Write  Synchronous  Asynchronous

Write to File

Read from File

Recursion …a solution strategy that involves a simpler version of the same problem. The problem becomes simplified with each call until we reach a stopping point. Resolution level by level. Useful for  Complex equations (Fibonacci number)  Towers of Hanoi  Binary Searching  Entry point  Stopping point  Deceptively simple

Define a Recursion Method What is my base case?  What is the solution to my base case? What is my intermediate case?  What is the solution to the intermediate case?

Recursion Example

Big O  What’s better?  T(N) = 2 * N * N  … 2(N^2)  T(N) = 1 * N * N + 1 * N  … N^2 + N

Sample Questions from Blackboard Wiki

What is the differences between Panel and GroupBox? Panel  Scrollable  Does not have a caption Groupbox  Not scrollable  Has a caption

What is the differences between CheckBox and RadioButton? CheckBox  Offer a “binary” choice  Turn options on / off  True / False  Multiple together RadioButton  Two or more mutually EXCLUSIVE items  … XOR  Multiple Choice Question

RadioButton controls become a set of mutually exclusive choices. How?  A group of RadioButtons offer only a single choice to a user  Selecting one will deselect another  Logical XOR  By container the radio buttons are placed in

ListBox has four modes of operation, what are they and describe them. None  No items can be selected One  Only one item can be selected MultiSimple  Multiple items can be selected by toggling MultiExtended  Multiple items can be selected AND the user can use SHIFT, CTRL, and ARROw keys to make selections

ComboBox has three modes of operation, name and describe each. Simple  List is always visible, text portion editable  User can enter a new value DropDown  List is displayed by clicking down arrow and text portion is editable  User can enter a new value DropDownList  List is displayed by clicking down arrow and text is not editable  Only values in the list can be selected

How does the use of object serialization compare to simply writing our data to a text file? Raw Write to Text File  List of “strings”  Will require manual “re- entry” later  Some method, or handler to convert text file to.NET object Object Serialization  Takes state of object, serializes for storage  Reading serialization produces native.NET object

The hierarchy of data includes what, and in what order?  (Smallest)  Bits  Bytes  Fields  Records  Files  (Largest)

Describe the hierarchy of data elements  Bits  0 or 1  Bytes  8 bits together  Fields  Name, Phone number, Data Dimension  Conveys meaning  Records  Group of related fields  Files  Group of related fields or other data

How can REACH further help you today?  Ask Questions Now!  Need to see an Example?  Need to see a concept again?  Need additional help?  Visit us at:  iTech Zone  CRC (Ekstrom Library)  Wednesday & Thursday (12 / / 6)  9:00AM – 5:00PM  Friday (12 / 7)  9:00AM – 4:00PM