0% found this document useful (0 votes)
184 views5 pages

CIS 200 Final Exam

This document contains instructions for a CIS 200 final exam. It states that students must sign a statement declaring they did not use outside resources to complete the exam and that internet and software tools will be used to check for academic integrity. Any violations will result in a zero on the exam and failing grade for the course. The exam then lists 30 multiple choice and written response questions covering topics like stacks, queues, linked lists, trees, searching, sorting, and exceptions.

Uploaded by

Ashim Dhakal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
184 views5 pages

CIS 200 Final Exam

This document contains instructions for a CIS 200 final exam. It states that students must sign a statement declaring they did not use outside resources to complete the exam and that internet and software tools will be used to check for academic integrity. Any violations will result in a zero on the exam and failing grade for the course. The exam then lists 30 multiple choice and written response questions covering topics like stacks, queues, linked lists, trees, searching, sorting, and exceptions.

Uploaded by

Ashim Dhakal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CIS 200 Final Exam

You MUST sign the following statement (will not be graded if unsigned):

In addition, you are to sign a statement

“I did not use any resources other than the course text book, class slides, class
assignments, notes taken, and/or class videos.”

That is: internet resources, non-class text books, asking anyone other than the
instructor, etc. are NOT allowed for this exam.

_____________________________

Internet and canvas comparison tools will be used to compare what you submit
to internet sites and other student submissions.

Any student violating these statement will receive a grade of zero on the exam and a
grade of E for the class regardless of any other work completed.

Instructions: Type your answers where possible. Work all problems and show all
of your work. Not showing all of your work will result in a loss of points for that
problem. That is, show the formula and your calculations not just the number
calculated.
1) Describe in your own words the operations that are performed on a
stack? Copying from class slide or class text results in loss of points.

2) Describe in your own words the operations that are performed on a


queue? Copying from class slide or class text results in loss of points.

3) Is the implementation of stacks and queues different between using


arrays and pointers/linked lists? Why or why not?

4) How are the operations on stacks and queues similar and how are they
different.

5) Show the operator and operand stacks (and the resulting code sequence)
for each step of the following: A = ((B + C) * D) / (E + F).

We covered memory and addressing in both halves of the semester as it is


a very important topic in computer science.

6)Explain each and show an example of memory for the following:


a) dangling pointer

b) lost object

c) indirect addressing

d) direct addressing

7) Describe
a) What is meant by heap (memory) management? How does it work?

b) What is the difference between static memory and heap memory? How
are they related?

8) What can cause the SAME algorithm to have a range of efficiencies?


(hint: what can cause a range of efficience in the execution of a program
for the same logic … e.g. algorithm: search the list of numbers to find
the largest value can be coded multiple ways thus multiple efficiencies)

9) What are the advantages and disadvantages of doubly-linked lists vs.


singly-linked lists?

10) What is the purpose of a circular list? Give an example of where one
might be used.

11) Can a list be linked in more than 2 ways? If so, what would be the
purpose? If not, why not?
12) We covered binary search in an array (reminder: see recursion slide
set) in the first half of the semester and a binary search using a tree
in the second half. Which is more efficient – a binary search (array) or
binary search (tree)? (hint: start answer with “it depends on ...”)

13) What criteria might you use for choosing which search algorithm to
use (i.e. to determine if you would use a binary search with an array
versus a binary search tree)?

14) Provide the following:

40
25 75
15 30 73 80
10 27 35
29

a. For tree:
Root: Height: Number levels:

Number of leaves: Complete (yes/no): Full (yes/no):

b. For node 30:


GreatGrandParent: GrandParent: Parent:

Child(ren): GrandChild(ren): Ancestor(s):

Siblings: Level:

15) Create a binary search tree using the following input (show steps):
50, 22, 101, 23, 18, 76, 63, 45, 47, 41, 83, 100, 98. How many
comparisons to find 41 and 103?

16) Using the tree you built in #15, traverse it in:


a) pre-order sequence

b) in-order sequence

c) post-order sequence

17) Is the tree from #15 balanced or not? Why or why not? Why would you
want to have the tree balanced?
18) What is a “Full Binary Tree” compared to a “Complete Binary Tree”? Is
the tree from #15 complete and/or full? Why or why not?

19) Describe the three ways a key value data can be deleted in a binary
search tree.

20) What is the difference between shallow and deep copying? When would
each be used?

21) What is a heap (data structure)? What are the characteristics of a


heap? Why would you choose it as a data structure?

22) What does the min-heap data structure look like after the following
steps (A = add, R = remove)? A(50), A(30), A(22), A(1), A(101), A(15),
R, R, A(6), A(18), R, R, A(22)

23) Describe how the heap sort algorithm works. Show the steps of
creating a max-heap from the following numbers: 11, 21, 6, 9, 35, 18,
26, 2, 14, 4, 1, 45 then show the heap sort to order the values.

24) Describe how “random access” files work in C++. What data structure
uses a similar data access process?

25) What is the purpose of a try-catch block? Why would you nest them?
What is not required but should be included every time you include one in
a program?

26) What is the difference between a user thrown exception and a system
thrown exception? Give an example of when would you code for each of
them.

27) Is a priority queue different from a heap? Explain why or why not.

28) Show the AVL steps to balance this tree.


29) What is the advantage of building/coding a program in steps rather
than coding the complete program then testing?

30)Explain how template classes work. When would you code one?

You might also like