tutorial02

tutorial02 - CSC2100B2007Spring DataStructures Tutorial2 1

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
  1 CSC2100B  2007 Spring Data Structures Tutorial 2 Last updated: 23 Jan, 2007
Background image of page 1

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

View Full DocumentRight Arrow Icon
/21 Assignment 1 Assignment 1: Stack and Queues Assignment 1 is posted! Due date: 6 Feb 2007 (Tue) 4:30 pm Programming assignment only Submission method: WebCT http://www.cuhk.edu.hk/wbt/webctce/
Background image of page 2
/21 Assignment 1 Q1: P alindrome  checking using stacks You need to implement: A Stack Interface. A Stack implementation class. A stack-based palindrome checking application .  Q2: Counter queues simulations You need to implement: A Queue Interface. A Queue implementation class. A queue-based counter queues simulation application.  
Background image of page 3

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

View Full DocumentRight Arrow Icon
/21 Question 1:  Palindrome checking Writing a program to: Keep reading in new line of input from  System.in, until the line contains the word ‘quit’ Determine whether the input is a  palindrome palindrome  is a string that reads the same,  backward or forward
Background image of page 4
/21 Question 1:  Palindrome checking Examples of palindromes: madam able was I ere I saw elba abba abba K (empty string) Not palindromes: Madam    upper and lower characters abb aab ba    spaces characters k1
Background image of page 5

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

View Full DocumentRight Arrow Icon
/21 Question 1:  Palindrome checking Sample Runs > java Palindrome Please input the string of palindromes: madam The input is a palindrome Please input the string of palindromes: abba abba The input is a palindrome Please input the string of palindromes: abb aab ba The input is NOT a palindrome Please input the string of palindromes: quit
Background image of page 6
/21 Question 1:  Palindrome checking What to hand-in Your Stack interface Your Stack implementation class Application main class:  Palindrome.java Any other additional classes that you defined. Note: You should use the Stack interface and  implementation class defined in the lecture. Each class should contain a class header with Your name, Student ID. A brief Description of the class Do not change the stack interface except when  instructed. No addition/deletion of methods.
Background image of page 7

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

View Full DocumentRight Arrow Icon
/21 Question 2: Bank Counter Queues A bank with 3 teller counters, numbered 0,1 and 2. Zero or one customer arrives every minute.  Two kind of customers VIP customers and non-VIP customers. Counter 0 serves VIP customers only. Counter 1 and 2 can serve  both non-VIP and VIP  customers
Background image of page 8
/21 Question 2: Bank Counter Queues 5  mins required 0 2 1 Non V.I.P.  Counters 3  mins required Write an application to simulate waiting lines  in a bank.
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

Page1 / 36

tutorial02 - CSC2100B2007Spring DataStructures Tutorial2 1

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online