联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2020-04-19 10:38

CISP 430 Data Structures

Midterm Exam

Spring 2020

Directions:

1) This is your midterm examination; upon Canvas submission,

a) you certify sole authorship of the work submitted, and

b) you have provided citation for any published work (text,

Internet, etc.) referenced in research used to complete

this exam.

2) You are solely responsible for ensuring your exam responses

are not copied – do not discuss your ideas or approach with

anyone. If there is any duplication, real or superficial, of

design or source code documents, your entire exam will receive

a grade of zero.

3) The exam must be submitted to Canvas on or before April 22,

6:30pm.

Question 1 - 20 pts: Define the following terms AND show an example

of the object language syntax required to

implement each term.

Data Structure

Abstract Class

Generic Class

Inheritance

Polymorphism

Question 2 - 25 pts: Assume a hastable ADT will implement

a “bucket” as a linked list of slots.


a-5) Show a class diagram for the hashtable design.

b-10) Show the code which implements the default and copy

constructors for two(2)different classes within your

design.

c-10) Assume a user issues the following “message” during

reuse of your design within a user application:

myHashTable.insert(“someData”);

Show the actual code which implements the insert()

method of your design.

Question 3 - 35 pts: Consider the List-Stack-Queue class

hierarchy used in Assignment 2.

a-5) Show the class diagram which defines the List,

Stack, and Queue classes.

b-10) Show the actual code which implements the Insert(),

Enqueue(), and Push() methods of the design.

c-20) Design a “test stub” application which generates the

report below using 1) a stack AND 2) a queue instance.

IMPLEMENT your design in code and submit the design,

code, and report similar to a CISP 430 project

submission. Your solution MUST utilize a stack AND

queue.

Input your test string ===> ABCDEF[enter]

Your output string: FEDCBA

Question 4 - 20 pts: y = 10/5.00 *((sin(PI/6)-cos(PI/3))- a

a-5) Show the postfix equivalent of the infix expression.

b-5) Show contents of Q1 and S2 data structures when token

“6” is processed by the parser.

c-5) Show the contents of the “Eval” stack when the infix

term “sin(PI/6)” is evaluated.

d-5) Function tan(beta) may be defined as:

sin(beta)/cos(beta) [right triangle]

Show the actual code segment of the evaluator which

evaluates infix expression tokens “tan(Alpha+Beta)”

using sin() and cos() as internal functions.

Thus, any tokens referencing “tan” are evaluated

using sin()/cos() ratio internally. Show the

code of the evaluator which implements this algorithm.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp