CSE 110 REVIEW Presented By: Samuel Butler & Christina Wilmot.

Slides:



Advertisements
Similar presentations
CS 141 Computer Programming 1 1 Arrays. Outline  Introduction  Arrays  Declaring Arrays  Examples Using Arrays  Sorting Arrays  Multiple-Subscripted.
Advertisements

1. List Static List: no adding or deleting Dynamic List: can add or delete items from the list Both static and dynamic lists: linear search, update item.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 17 Templates.
Chapter 17 Templates. Generic Algorithms Algorithms in which the actions or steps are defined, but the data types of the items being manipulated are not.
An Array A sequence of elements of a particular type Each element in the array has an index which gives its position in the sequence An array is declared.
Written by: Dr. JJ Shepherd
 Sort: arrange values into an order  Alphabetical  Ascending numeric  Descending numeric  Does come before or after “%”?  Two algorithms considered.
Lecture 17 Abstract classes Interfaces The Comparable interface Event listeners All in chapter 10: please read it.
Liang, Chpt 5 continued. Sorting arrays The telephone book is easy to use, because the entries are sorted Sorting is a common task, and many many algorithms.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 14 – Student Grades Application: Introducing.
Simple Sorting Algorithms
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
CMPUT 101 Lab #6 October 29, :00 – 17:00. Array in C/C++ Array is a structure type variable. One dimension of array int: int num[3]; There are.
COMP 14: Sorting June 14, 2000 Nick Vallidis. Announcements zP4 is due today!
Chapter 6 C Arrays Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc. Arrays are data structures.
CS 106 Introduction to Computer Science I 03 / 08 / 2010 Instructor: Michael Eckmann.
PHYS 2020 Making Choices; Arrays. Arrays  An array is very much like a matrix.  In the C language, an array is a collection of variables, all of the.
Arrays Data Structures - structured data are data organized to show the relationship among the individual elements. It usually requires a collecting mechanism.
OOPDA Review. Terminology class-A template defining state and behavior class-A template defining state and behavior object-An instance of a class object-An.
CS 106 Introduction to Computer Science I 10 / 15 / 2007 Instructor: Michael Eckmann.
7.1 Arrays Introduction to arrays Any array is a collection of objects or primitives Useful when the number of reference variables is large or.
CS 106 Introduction to Computer Science I 10 / 16 / 2006 Instructor: Michael Eckmann.
CSE 1301 J Lecture 13 Sorting Richard Gesick. CSE 1301 J 2 of 30 Sorting an Array When an array's elements are in random order, our Sequential Search.
Java Unit 9: Arrays Declaring and Processing Arrays.
CSE 332: C++ templates This Week C++ Templates –Another form of polymorphism (interface based) –Let you plug different types into reusable code Assigned.
NSIT,Jetalpur CORE JAVA CONCEPTS SURABHI MISHRA (LCE)NSIT.
Creating Simple Classes. Outline of Class Account Class Account Account # Balance Holder name phone# Overdrawn (true/false) Data Members Open Credit Debit.
CS125 Exam Review Winter Some Exam Info Tuesday (22nd) at 4:00-6:30pm in the PAC CHECK YOUR SEAT!!! Read Final Exam Information on website –Practice.
Java Quiz Bowl A fun review of the Java you should know from CMPT 201 If you don’t know the answers - this week is for you to study up!
Arrays Module 6. Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array.
Arrays and ArrayLists in Java L. Kedigh. Array Characteristics List of values. A list of values where every member is of the same type. Each member in.
BUBBLE SORT. Introduction Bubble sort, also known as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to.
1 2. Program Construction in Java. 2.9 Sorting 3 The need Soritng into categories is relatively easy (if, else if, switch); here we consider sorting.
 There are times when you will want blocks to repeat. Instead of duplicating blocks and ending up with a long script that might be confusing, there.
Programming in Java CSCI-2220 Object Oriented Programming.
Array, Structure and Union
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
Research Topics in Computational Science. Agenda Survey Overview.
AP Computer Science edition Review 1 ArrayListsWhile loopsString MethodsMethodsErrors
Sorting an array bubble and selection sorts. Sorting An arrangement or permutation of data An arrangement or permutation of data May be either: May be.
Functions in C CSE 2451 Rong Shi. Functions Why use functions? – Reusability Same operation, different data – Abstraction Only need to know how to call.
 2007 Pearson Education, Inc. All rights reserved C Arrays.
1 Chapter 5: Defining Classes. 2 Basics of Classes An object is a member of a class type What is a class? Fields & Methods Types of variables: –Instance:
Arrays An array is a data object that can hold multiple objects, all of the same type. We can think of an array as a storage box which has multiple compartments.
Memory Management in Java Computer Science 3 Gerb Objective: Understand references to composite types in Java.
CHAPTER 6 ARRAYS IN C++ 2 nd Semester King Saud University College of Applied studies and Community Service CSC 1101 By: Fatimah Alakeel Edited.
Arrays. The array data structure Array is a collection of elements, that have the same data type Integers (int) Floating point numbers (float, double)
Chapter 3 Templates. Objective In Chapter 3, we will discuss: The concept of a template Function templates Class templates vector and matrix classes Fancy.
Arrays-. An array is a way to hold more than one value at a time. It's like a list of items.
Written by: Dr. JJ Shepherd
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Templates Where the TYPE is generic. Templates for functions Used when the you want to perform the same operation on different data types. The definition.
Arrays Chapter 7. MIS Object Oriented Systems Arrays UTD, SOM 2 Objectives Nature and purpose of an array Using arrays in Java programs Methods.
Computer Science 1620 Sorting. cases exist where we would like our data to be in ascending (descending order) binary searching printing purposes selection.
Sorting and Shuffling Arrays CS 233G Intermediate C++ Programming for Games.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Data Structures Arrays and Lists Part 2 More List Operations.
5.1 Basics of defining and using classes A review of class and object definitions A class is a template or blueprint for an object A class defines.
CSCI 51 Introduction to Programming March 10, 2009.
CHAPTER 6 ARRAYS IN C 1 st semester King Saud University College of Applied studies and Community Service Csc 1101 F. Alakeel.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 9: Arrays; Revision Session.
CS100Lecture 61 Announcements Homework P1 due on Thursday Homework P2 handed out.
Programming with ANSI C ++
More About Objects and Methods
Subroutines Idea: useful code can be saved and re-used, with different data values Example: Our function to find the largest element of an array might.
For Loops October 12, 2017.
CMSC 202 Lesson 22 Templates I.
INC 161 , CPE 100 Computer Programming
Templates I CMSC 202.
Review for Midterm 3.
Presentation transcript:

CSE 110 REVIEW Presented By: Samuel Butler & Christina Wilmot

Classes and Objects ■What is a class? –A class is a blue print/ template that describes the actions/descriptions of an Object. ■What is an Object? –Objects have states and behaviors. Examples are included through different data types and functions to describe these objects. Button myButtonObj = new Button();

What is Static? ■Static members are those that belong to the class instead of a specific instance. ■This means only ONE instance of a static field will exists, even if you create more. This will be shared by all instances. ■Static members CAN accesss instance members through object references.

What is THIS? ■Within an instance method/constructor the keyword “this” is used to reference the current object. That is, whichever method or constructor is being called. –Ex: MyObject.printStuff(); ■Here if printStuff contained the keyword THIS, it would refer to the MyObject object. ■Why is this helpful/used? –Disambiguate variable names, Can use as arguments/parameters

Method Overloading ■Method Overloading is useful because it allows a class to create more methods that share the same name if their signature is different. ■This means we can keep function names consistent (clean code) while keeping differing functionality. ■Method overloading only works when methods with the same name have DIFFERENT signatures

Arrays ■Declaring –Int[] myArray = new int[10]; –Int[] myArray = {1,2,3,4,5,6,7,8,9}; –char[] cArray = {a,b,c,d,e,f,g,h,I,j,k}; ■Indexing/Accessing –myArray[5] = 10; ■Min / Max –myArray[0], myArray[myArray.length -1]

Using for loops with arrays ■For loops go hand in hand with arrays. This is because they can index easily, while looping a specified number of times. ■How could we write code to double every number in an array? ■What if we wanted to double every other number in an array?

Two Dimensional Arrays ■Two dimensional arrays require a nested (one inside of the other) for loop. ■Make sure you keep different variables in a nested for loop, don’t use I for everything.

Selection Sort ■How does it work? –Two different arrays: One sorted, the other unsorted. –We want to look for the smallest number, and add this number to the end of the sorted array. –We do this continuously until the array is sorted.

Insertion Sort ■How does it work? –Compare two numbers next to each other starting at the beginning of the array. –If a swap is necessary, swap. –From here check to see if any other swaps are necessary, if so swap again! –Repeat this process until the array is sorted.

Questions?