You are on page 1of 13

2018

QUESTION PAPER
SEFAKO MAKGATHO HEALTH SCIENCES UNIVERSITY
ASSESSMENT AND CERTIFICATION MANAGEMENT

SCHOOL OF SCIENCE & TECHNOLOGY

SUBJECT NAME: DATA STRUCTURES TYPE OF EXAMINATION: STANDARD


RE-EXAMINATION X
SUBJECT CODE: M C O A 0 2 1
COURSE: COMPUTER SCIENCE PAPER NUMBER: 1/1

DATE OF EXAMINATION: 21 JUNE 2018 DURATION: 3 HOURS

NUMBER OF STUDENTS: TOTAL MARKS: 183

INTERNAL EXAMINERS PARTICULARS: 1. Dr. TA DANDADZI

2. Ms. NS MATHIBA

INTERNAL MODERATOR PARTICULARS: 1. Ms. S MAFIKE

THIS QUESTION PAPER CONSISTS OF 13 PAGES INCLUDING COVER PAGE.

Please confirm Please indicate the


Specified Instructions to students Stationary what you need quantity per
student
1. N/A 4 PAGE BOOK
2. Answer all questions, each section on a X 2
8 PAGE BOOK
separate booklet.
3. MCQ’s (must be supplied by
the department on day of
submission)
4. Double Folios
2018

SEFAKO MAKGATHO HEALTH SCIENCES UNIVERSITY

SCHOOL OF SCIENCE & TECHNOLOGY

SUBJECT NAME: DATA STRUCTURES TYPE OF EXAMINATION: STANDARD

RE-EXAMINATION X

SUBJECT CODE: M C O A 0 2 1

COURSE: COMPUTER SCIENCE PAPER NUMBER: 1/1

DATE OF EXAMINATION: 21 JUNE 2018 DURATION: 3 HOURS

SIGNATURE OF HEAD OF DEPARTMENT: _______________________________

SIGNATURE OF THE DEAN


SCHOOL OF SCIENCE & TECHNOLOGY: __________________________________

CONTACT NUMBERS OF INTERNAL EXAMINERS


NAME CONTACT NUMBER
DR. TA DANDADZI X5947/082 202 2134
MS. NS MATHIBA X3692

CONTACT NUMBERS OF INTERNAL MODERATOR


NAME CONTACT NUMBER
MS. S MAFIKE X5421
2

SECTION A DATA STRUCTURES [TOTAL: 140]

Question 1 [30]
Indicate whether the statement is true or false. If false state why in relation to the question.

1. Encapsulation is the ability to create new data types from existing data types.

2. In C++, the mechanism that allows you to combine data and the operations on that data in a single unit
is called a class.

3. A derived class inherits all its data members from the base class; it has none of its own.

4. The values belonging to pointer data types are the memory addresses of your computer.

5. The time complexity of the function isEmpty in an array list is O(1).

6. Every node in a linked list has two components: one to store the relevant information and one to store
the address.

7. The algorithms to implement the operations search, insert, and remove are the same for sorted and
unsorted lists.

8. To delete a given item from an ordered linked list, there is no need to search the list to see whether the
item to be deleted is in the list.

9. In a doubly linked list, every node contains the address of the next node (except the last node), and
every node contains the address of the previous node (except the first node).

10. To access the fifth element in a list, we must first traverse the first four elements.

11. The base case starts the recursion in a recursive function.

12. Functions such as push and pop that are required to implement a stack are not inherently available to
C++ programmers.

13. An array is a random access data structure; a stack is not.

14. The postfix expression 2 3 + 1 * = evaluates to 8.

15. The front of the queue is accessed whenever an element is deleted from the queue.

16. From the binary search algorithm, it follows that every iteration of the while loop cuts the size of the
search list by half.
3

17. If you have 1000 items, each requiring 1 word of storage, chaining requires a total of 4000 words of
storage.

18. When data is being organized, a programmer’s highest priority is to organize it in such a way that item
insertion, deletion, and lookups (searches) are fast.

19. A binary tree is a dynamic data structure.

20. In a preorder traversal of a binary tree, after visiting a node and before moving to the right subtree, we
must save a pointer to the node so that after visiting the right subtree, we can visit the left subtree.

21. As in the case of an inorder traversal, in a postorder traversal, the first node visited is the rightmost
node of the binary tree.

Question 2 [18]
Identify the choice that best completes the statement or answers the question. Give the letter only.

1. ____ is the first and most important step of the software development process.
a. Analyzing the problem c. Implementing the software
b. Designing the software d. Test marketing
2. ____ is the ability to create new data types from existing data types.
a. Encapsulation c. Inheritance
b. Information hiding d. Polymorphism
3. In C++ terminology, a class variable is called a ____.
a. class object c. class member
b. class placeholder d. class template
4. The general syntax for declaring a class object that invokes the default constructor is ____.
a. className classObject.new;
b. className ObjectName;
c. className classObjectName;
d. classObjectName className;

5. A linked list is a collection of ____.


a. classes c. addresses
b. nodes d. memory variables
6. The address of the first node in the list is stored in a separate location, called the ____.
a. head c. key
b. tail d. top
7. Building a linked list forward places the item to be added at the ____ of the linked list.
a. beginning c. middle
b. end d. key point
8. To remove, or pop, an element from the stack ____.
a. decrement stackTop by 1 c. invert stackTop
4

b. increment stackTop by 1 d. do nothing

9. Whenever a system is modeled on the First In First Out principle, ____ are used.
a. stacks c. arrays
b. trees d. queues

10. To implement the deleteQueue operation, we access the index ____.


a. queueBack c. queueTail
b. queueFront d. queueCurrent
11. A technique in which one system models the behavior of another system is called ____.
a. referencing c. simulation
b. bench testing d. reproduction
12. The search item is called the ____.
a. source c. key
b. target d. component
13. One way to improve linear probing is to skip array positions by a ____.
a. fixed constant c. dynamic value
b. random constant d. key-relative value
14. Linear probing that uses the increment value as a function of the key is called ____.
a. quadratic hashing c. key hashing
b. non-linear hashing d. double hashing
15. In a ____ traversal of a binary tree, for each node, first the left subtree is visited, then the right subtree
is visited, and then the node is visited.
a. preorder c. postorder
b. inorder d. recursive
16. Let x be a node in a binary tree, then we say that the node x violates the ____ if |xh – x1| > 1, that is, the
heights of the left and right subtrees of x differ by more than 1.
a. balance criteria c. rebalance criteria
b. balance factor d. rebalance factor
17. There are two types of AVL tree rotations: ____.
a. left rotation and right rotation c. inner rotation and left rotation
b. inner rotation and outer rotation d. right rotation and left inversion
18. The reconstruction procedure for an AVL tree is called ____.
a. reverting the tree c. rotating the tree
b. balancing the tree d. inverting the tree

Question 3 [92]

1. Consider the following program segment for the questions below:

for (i = 1; i <= n; n++)


for (j = 1; j <= n ; j++)
5

for (k=1; k <= n; k++)


print (“%d %d %d\n”, i, j, k);

a. Suppose n = 2, using a trace table determine what will be displayed by the program segment. (11)
b. Determine the number of passes the program segment executes. (2)
c. Determine the big-O of the program segment. Explain your answer. (5)

2. Write a recursive algorithm that changes an integer to a binary number. (14)

3. Using manual transformation, write the following infix expression in prefix form: (6)

(A + B) * C - D * F + C

4. Determine the contents of Q after the following code is executed using the data given below. (10)

Q = createQueue
loop (not EOF)
read num
if (num not 0 )
enqueue (Q, num)
else
x = queueRear(Q)
enqueue(Q, x)
end if
end loop

5, 7, 12, 4, 0, 4, 6, 8, 67, 34, 23, 5, 0, 44, 33, 22, 6, 0

5. Write an algorithm that reverses the contents of queue using only the ADT of the queue and the stack.
(16)

6. Using linked list implementation of a list, write a C++ function lastNode which returns a pointer to the
last node. (12)

7. Generate a heap out of the following data read sequential in the order given from the keyboard. (16)
6

SECTION B SYSTEMS ANALYSIS & DESIGN [70]

Question 1 [15]
Indicate whether the statement is true or false and justify if false by providing the correct complete
statement. 0.5 mark for true statement and 1 mark for false statement with justification

1. Sometimes a narrative description is the best form to use for recording information.

2. A key reason that modeling is important in system development is the complexity of


describing information systems.

3. A good way to remember the details of an interview is to use a tape recorder.

4. A decision point within an activity diagram may be shown with an activity symbol.

5. One benefit of the event decomposition technique is that it helps to identify use cases at the
right level of detail.

6. CRUD stands for create, reply, update, delete.

7. The event decomposition technique is most useful as a cross-check along with other
techniques.

8. The focus on external events is inappropriate when working with end users because
discussing events tends to confuse the issues.

9. Each use case is used by only one actor.

10. Two difference scenarios of a use case would normally be described in a single fully
developed use case description.

11. In a sequence diagram, a message is considered to be an action that is invoked on the


destination object.

12. The key question to answer with the design of the user interface activity is, “Have we
specified in detail how all users will interact with the system?”

13. The output of the design activities is a set of diagrams and documents that describe the
solution system.

14. A project that has high technical risk should use the predictive approach.
7

15. All adaptive approaches include iterations.

16. The data flow diagram is used with the structured analysis system development technique.

17. In Agile Modeling, change is seen as the exception, not the norm.

18. Ceremony refers to the official kick-off meeting to start a project.

19. Since the Agile philosophy embraces change, project scope management is not important for
Agile projects.

20. With Agile Cost Management it is important to control the costs, even more important than
estimating the costs to get project approval.

Question 2 [14]
Multiple Choice: Identify the choice that best completes the statement or answers the question. 0.5 mark
for each correct answer.

1. A series of formulas that describe technical aspects of a system is a(n) model.


a. textual c. graphical
b. descriptive d. mathematical

2. The most important step in preparing for an interview is to _______.


a. determine the correct users c. establish an objective
b. build a list of questions d. determine the project team
members

3. Which of the following is an example of a state event?


a. A customer places an order c. Management checks order
status
b. It is time to send a late notice d. Inventory reorder point is
reached

4. The specific area of the user’s business need that is within the scope of the new system is
called the _______.
a. use cases c. functional requirements
b. user specifications d. problem domain
8

5. When making a list of nouns to determine what are the important “things” for the new system,
there are three question that should be asked about each noun. Which of the following is one of those
questions?
a. Is it a tangible item?
b. Is it an abstract item?
c. Who needs information about this item?
d. Should it be researched further?

6. An attribute that contains a collection of related attributes is called a(n) _______.


a. class attribute c. compound attribute
b. key attribute d. association attribute

7. Which of the following is NOT considered an analysis model?


a. Class diagram c. User interface screen layouts
b. State machine diagram d. Activity diagram

8. Which is NOT a characteristic of a VPN?


a. It uses the Internet.
b. Only certain computers can access it.
c. It uses HTTPS for security
d. It always uses encryption

Multiple response [10]


Identify one or more choices that best complete the statement or answer the question. 1 mark for each
correct answer.

9. Two benefits of researching vendor solutions include _______ and ______. (Choose two)
a. encouraging the users to buy a d. speeding up the development
vendor solution immediately project
b. helping analysts discover state e. informing senior management
of the art solutions about competitors
c. helping users generate new f. reducing the risk of
ideas for business functions implementing a new system

10. Two types of interaction diagrams are: (Choose two)


a. Activity diagrams d. Class diagrams
b. Sequence diagrams e. Communication diagrams
c. State chart diagrams f. Package diagrams
9

11. Two methods to show a repeating message are: (Choose two)


a. Dashed arrow d. Opt frame
b. Brackets [ ] e. Loop frame
c. Asterisk * f. Alt frame

12. When the user interface is being designed for Web based systems, there are several important
considerations. Which of the following are included in those particularly important issues? (Choose
two)
a. Web Connectivity
b. Performance and load speed
c. Pictures, Video and Sound
d. Programming language
e. Server speeds and capabilities
f. HTML standards

13. Which two of the following are activities belonging to the first core process?
a. Schedule the work
b. Perform risk and feasibility analysis
c. Choose the project manager
d. Establish the project environment
e. Evaluate the work processes
f. Quantify project approval factors

Question 3 [17]

1. One of the problems analysts encounter during investigation is “scope creeping” (i.e., user
requests for additional features and functions). Scope creeping happens because users
sometimes have many unresolved problems and the system investigation may be the first time
anybody has listened to their needs. How can the system be kept from growing and including
new functions that should not be part of the system? (5)

2. What is the difference between an external event and a temporal event? Give example of an
external event that applies to order-processing system and then give an example of a temporal
even that applies to a payroll system. (3)

3. What is the difference between system capabilities and business benefits? (2)

4. What are the three primary reasons for initiating a software development project? (3)
10

5. When considering a hosting alternative, there are five areas that must be considered. Describe
any four of the five reasons. (4)

Question 4 [24]

1. Develop an activity diagram based on the following narrative. Note any ambiguities or questions that
you have as you develop the model. If you need to make assumptions, also note them. (9)

The shipping department receives all shipments on outstanding purchase orders. When the
clerk in the shipping department receives a shipment, he or she finds the outstanding
purchase order for those items. The clerk then sends multiple copies of the shipment packing
slip. One copy goes to purchasing, and the department updates its records to indicate that the
purchase order has been fulfilled. Another copy goes to accounting so that a payment can be
made. A third copy goes to the requesting in-house customer so that he or she can receive the
shipment.
After payment is made, the accounting department sends a notification to purchasing. After
the customer receives and accepts the goods, he or she sends notification to purchasing. When
purchasing receives these other verifications, it closes the purchase order as fulfilled and paid.

2. Refer to the RMO CSMS reporting subsystem shown below and draw a use case diagram that shows only all
use cases involving the management and marketing actors. (5)
11
12

3. Describe the relationships (identify the business rules) depicted in the Crow’s Foot ERD shown in the
following figure: (4)

4. Read this narrative and then make a list of six (6) system capabilities for the Especially For You
Jewelers (EFYJ) company (6)

The new direct sales and accounting system for EFYJ Company will be an important element in
the growth and success of the jewelry company. The direct sales portion needs to track every sale
and be able to link to the inventory system for cost data to provide a daily profit and loss report.
The customer database needs to be able to produce purchase histories to assist management in
preparing special mailings and special sales to existing customers.
Detailed credit balances and Aged accounts for each customer would help solve the problem with
high balance of accounts receivables. Special notice letters and credit history reports would help
management reduce accounts receivable.

You might also like