Prep Right
PPSC · PMS Punjab 2021

Computer Science, Paper II

100 marks · 3 hours · 6 questions
This paper Computer Science · all yearsQ. 1 · What are the sorting algorithms?…Q. 2 · What is a Binary Search…Q. 3 · The network illustrated above represents…Q. 4 · Describe the main processes in…Q. 5 · What are interrupts and exceptions?…Q. 7 · Show the printout of following…With this paper← 2019
3 hours · questions hide until you reveal them

Not yet checked 1 of 6 questions have not yet been compared with the official paper.

Q. 1
  1. (a)What are the sorting algorithms? Describe the importance/application of any 4 sorting algorithms in modern computing. [5]
  2. (b)Discuss the space and time complexity of any of 5 sorting algorithms. [10]
  3. (c)Outline the psedocode and flow diagram of the ShellSort. [5]
(20)
Q. 2
  1. (a)What is a Binary Search Tree (BST)? What is its searching complexity? [2]
  2. (b)Make a BST for the following sequence of numbers. 99, 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48, 11 [3]
  3. (c)Traverse the tree in Pre-order and Post-order [3]
  4. (d)With an ASCII encoding (8 bits per character) the 13-character string "computer science" requires 128 bits to send. You can use Huffman's algorithm to construct a tree that is used for data compression. Calculate minimum bits of stream using Huffman's algorithm to send the given string. [6]
  5. (e)What is MaxHeap and Minhap? Sort the numbers (7, 6, 6, 1, 9, 2, 2, 4, 4, 0, 1) in ascending order by using heap sort. [6]
(20)
Q. 3

The network illustrated above represents an Ethernet Layer-2 network that uses spanning-tree to compute forwarding tables. Assume all links have a link-weight of one. [Note: Tie-breaking/leader-elections use the switch identifier from this diagram.]

  1. (a)Compute the steady state routing/forwarding table for Switch 3. [4]
  2. (b)Noting which switches recomputed a solution, enumerate the changed forwarding tables in switches of this network resulting from the complete failure and removal of link D. [9]
  3. (c)Following the removal of Link D, a new link H is added between Switch 1 and 4; however, this link fails frequently. Denied access to monitor the network-traffic, outline a diagnostic strategy to identify the faulty Link H, making clear how the network-operator might use interrogation of network switch forwarding tables. [4]
  4. (d)Now suppose the switches do not permit interrogation of switch forwarding tables and that the link status information is untrustworthy. Outline other techniques that might be used to identify the failed link. [3]
(20)
Q. 4
  1. (a)Describe the main processes in a modern software development environment, and the tools used to support them. [6]
  2. (b)If the software were safety-critical, such as the control software for a car's anti-lock braking system (ABS), which other processes might be added? [4]
  3. (c)You are developing control software for a car whose latest model will have a network connection. Software upgrades will be delivered over the air rather than at service visits, so that any security vulnerabilities can be patched quickly. This in turn means that you will have to provide patches, to deal with both security and safety issues for the next 25 years. Discuss how this is likely to affect your development process, and the implications it will have for costs. [10]
(20)
Q. 5
  1. (a)What are interrupts and exceptions? How to handle the interrupts and exceptions in the operating system? [4]
  2. (b)What is paging? Explain paging in the context of virtual memory. [4]
  3. (c)What are semaphores? Explain with the help of examples that how the process can enter into the critical section. [4]
  4. (d)What is the banker's algorithm? How does it work? Explain with the help of examples [4]
  5. (e)What is the role of API, ABI and ISA in operating systems? [4]
(20)
Q. 7
  1. (a)Show the printout of following program code. public class Test { public static void main(String[] args) { double[][] m = {{1, 2, 3}, {1.5, 2.5, 3.5}, {0.1, 0.1, 0.1}}; System.out.println(sum(m)); } public static double sum(double[][] m) { double sum = 1; for (int i = 0; i < m.length; i++) { sum += m[i][i]; return sum; } [2]
  2. (b)What is the difference between pointer and reference? Explain the working of both pointer and reference variable? What is difference between pointer to reference and reference of a pointer? [4]
  3. (c)What is the significance of Fibonacci sequence? [1]
  4. (d)Write a program that takes the maximum range for calculating the Fibonacci and then calculate the Fibonacci series of numbers. [4]
  5. (e)Explain Polymorphism, virtual functions, inheritance with the help of C++ code [6]
  6. (f)Write a sample code to explain object oriented exception handling in C++. How this is different in Java? [3]
Not yet checked
(19)

Related papers

About this paper

The 2021 PMS Punjab Computer Science paper set by the PPSC. Question wording only; questions marked “Not yet checked” have not been compared with the official paper yet.

Disclaimer Prep Right is independent and not affiliated with PPSC.