CSCI3122 Data Structures – Dr. Robert Steven Owor

CSCI3122 FINAL EXAM- Due Saturday Dec 5th 2015 by11.55pm

Instructions

These Instructions supercede those on the class website.

  1. Please answer all 10 questions according to the instructions and email it to on or before Saturday December 5th 2015, 11.55pm. Each question is worth 10 points. Make sure you include your first and last name in the document, when you email it as an attachment.
  2. This is an open book examination.
  3. In the Subject Header of the email, you should include the following: CSCI3122 FINAL EXAM 2015, Your Last Name, Your First Name, Due Date and Due Time.
  4. If you do not follow any and each of the 3 instructions above, you will lose points.

STUDENT DETAILS

LAST NAME: /
FIRST NAME: /

DO NOT WRITE ANYTHING BETWEEN THE LINES BELOW:

INSTRUCTOR’S EVALUATION

SCORE:
Comments:
  1. Write a Java program which reads a text file called mydata.txt containing the following numbers: 34 56 76 98 12 33 58 42 98 93 and computes the minimum, maximum sumand average of the numbers and puts the output in a file called myresults.txt. (10 Points)

Attach your java program and your input and output files.

  1. Write a Java Program that prints out Division by Zero and Array Out of Bounds Exceptions when a User attempts to find all integers from 1 to 200 whose last digit is 7, but which are not divisible by 3. Attach your java program and screen capture output. (10 Points)
  2. Implement the following a Customer Address Book using the ArrayList data structure. The Customer Address Book should do the following: Add Name, Address and Phone Number to Customer Address Book, Edit Name and Phone Number, Delete an Entry, Display all Names and Phone numbers in the Address Book. Attach your Java Programs and Screen capture of each of the runs requested. (10 points)
  3. Write a Java Program which prints out all solutions of the 8-Queen Problem, but modify the program to display only those solutions which are not on the 3th row or 7th column of the 8x8 matrix. Attach your Java Program and Screen Capture of the runs. (10 points)
  4. Write a Java Program which implements a Stack of Integers. An Integer should only be pushed into the stack if it is odd or contains the number 3. Now pop all integers that contain 5 or 9. Do this for the first 100 numbers. Print out the numbers remaining in the stack after the Pop operation. Attach your Java Program and Screen Capture of the runs. (10 points)

INSTRUCTIONS FOR Q6-Q10

Put all your answers in the text box provided.

  1. In three paragraphs, describe at least 3 different uses of Queues in Computer Networking. (10 points)
  1. Discuss how Binary Tree Deletion takes place in an ordered Binary Tree. What are the challenges? (10 points)
  1. Explain what a Minimum Spanning Tree is. Give two examples of the use of Minimum Spanning trees. (10 points)
  1. In two paragraphs, explain why Linked Lists are a more efficient Data Structure than Arrays. (10 points)
  1. What is the difference between a Cyclic and an Acyclic Graph? State three uses of Directed Acyclic Graphs.