Introduction_Part_11

# Introduction_Part_11 - A currentMax A[0 for i 1 to n 1 do...

This preview shows pages 1–3. Sign up to view the full content.

Last Updated: January 5, 2012 CSE 2011 Prof. J. Elder Subtyping with Wildcards In order to obtain this kind of subtyping with generics, you can use wildcards . For example: or Couple<? extends Camera, ? extends Camera> stereoCamera = new Couple<DigitalCamera,DigitalCamera>(); Couple<? extends Camera, ? extends Camera> stereoCamera = new CloselyCouple<DigitalCamera,DigitalCamera>();

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Last Updated: January 5, 2012 CSE 2011 Prof. J. Elder Pseudocode High-level description of an algorithm More structured than English prose Less detailed than a program Preferred notation for describing algorithms Hides program design issues Algorithm arrayMax ( A , n ) Input array A of n integers Output maximum element of
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A currentMax A [0] for i 1 to n- 1 do if A [ i ] > currentMax then currentMax A [ i ] return currentMax Example: find max element of an array Last Updated: January 5, 2012 CSE 2011 Prof. J. Elder Pseudocode Details • Control flow – if … then … [ else … ] – while … do … – repeat … until … – for … do … – Indentation replaces braces • Method declaration Algorithm method ( arg [, arg … ]) Input … Output … • Method call var.method ( arg [, arg …]) • Return value return expression • Expressions Assignment (like = in Java) = Equality testing (like == in Java) n 2 Superscripts and other mathematical formatting allowed...
View Full Document

## This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

### Page1 / 3

Introduction_Part_11 - A currentMax A[0 for i 1 to n 1 do...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online