CMPSC 20 F08 lecture notes: Application of the Stack data type

CMPSC 20 F08 lecture notes: Application of the Stack data type

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CMPSC 20 Week 4: Tuesday Today - overview • • • Using a stack in a program Recursion - more formally Recursion examples Example Given a string of characters, make sure the enclosures ( () , {} , ) are proper. boolean { int length = s . length ; stack = new j ++) L i s t S t a c k <C h a r a c t e r > ( ) ; checkBrackets ( String s) L i s t S t a c k <C h a r a c t e r > for ( int { char } } c = j = 0; j < length ; s . charAt ( j ) ; Some characters we can ignore, and others we can't. We care about: • • • (/) {/} [/] equivalence class about breaks up a large set of items into subsets that have some similarity that we care 1 ...
View Full Document

Ask a homework question - tutors are online