Monday, July 15, 2013

Data Structures (All day and evening classes) - Laboratory Exercise for this Week (Updated)

For this week, you will be given a bring home exercise to be submitted this Friday (July 19, before 12:00nn).   I will no longer meet you in your laboratory class schedule.

Laboratory Exercise Specifications:
  1. Implement the Stack and Queue classes using linked-list implementation separately.  For Stack class, the minimum required methods are:  push, pop, top, and isEmpty.  For the Queue class, the minimum required methods are:  enqueue, dequeue, front, and isEmpty.  You may add other methods if you want.  The file names for these classes are "Stack.java" and "Queue.java".  YOU ARE STILL NOT ALLOWED TO USE THE COLLECTIONS API FOR THIS EXERCISE.
  2. Create a client class (must be a separate class) named "TestBalancedSymbols"  (filename must be saved as TestBalancedSymbols.java).
  3. In the client class, instantiate objects of Stack and Queue classes and write your code that will determine if the entered grouping symbols is balanced or not.  The one we discussed in class uses only Stack so you will have to create your own algorithm (or research on this) how to use both stack and queue in checking for balanced symbols.    The grouping symbols to be checked are only ( ), { }, and [ ].  Make your client class interactive and it must allow for repeated input until the user decides to stop.  YOU DO NOT NEED TO IMPLEMENT THIS WITH A WORKING GUI, ONLY PLAIN CONSOLE I/O IS REQUIRED.
Submission guidelines:
  1. Create a folder in your dropbox shared folder named "Exer2".  Do not create a separate folder for this.  For instance, if your shared folder is CS2_Villamor, then the Exer2 folder must be created inside the CS2_Villamor.  I hope this is clear. 
  2. Upload your Stack.java, Queue.java, and TestBalancedSymbols.java on your Exer2 folder.  You do not need to include the class files anymore.  USE THE NODE CLASS WE HAVE COVERED IN CLASS (can be found in the MyLinkedList folder) AND UPLOAD THIS ALSO IN YOUR EXER2 FOLDER.  Only these four files should be uploaded to your folder.  If you are using Netbeans, go to your src folder to locate your required .java files.  Do not upload everything.  Do not submit a compressed file (e.g. zipped file).
Failure to follow the laboratory exercise specifications and the submission guidelines will have corresponding deductions.   These are simple instructions so I expect everyone to follow them.  I HATE STUDENTS WHO DO NOT KNOW HOW TO FOLLOW INSTRUCTIONS.  

Those who did not follow instructions in your first exercise (e.g. not creating a folder named "exer1", creating a separate shared folder "exer1" outside your dropbox shared folder, not following the correct file names, and uploading files that are not required) will be receiving deductions.


More Announcement:
  1.  Please do not modify the files I have shared in our dropbox folder (DS_resources).  If you want to practice on these files (e.g. MyArrayList and MyLinkedList), just download a copy on your own computers.
  2.  I have made changes to our grading system this prelim, which is as follows:  Lab Exercises (40%) and Prelim Exam (60%).  I removed the quizzes component of the grading system since we never had any quizzes this grading period. 
  3. Prelim Exam schedules:  
    • CS2:  Wednesday (July 17), 3:00 - 5:00pm
    • IT 2A:  Saturday (July 20), 2:00 - 4:00pm
    • IT 2:  Monday (July 22), 3:00 - 5:00pm
 Please bring your own exam booklet.  You can buy them at the IC office at Php 3.00/each

No comments:

Post a Comment