UNIVERSITY OF SINDH, JAMSHORO
INSTITUTE OF MATHEMATICS AND COMPUTER SCIENCE
BS (CS) – Part II
Course Title: Compiler Construction
First Semester Examination – 2024
Time Allowed: 2 Hours
Max. Marks: 60 (R) / 100 (I/F)
Note: Attempt any FIVE questions.
-
Explain the history of translators. Differentiate between a compiler and an interpreter. Why is a compiler faster than an interpreter? Discuss briefly.
-
A symbol table is necessary for compiler construction. Justify your statement with examples.
-
List and design the language processing system components. Explain briefly.
-
Differentiate between Syntax Tree (ST) and Abstract Syntax Tree (AST). Design ST & AST for the expression:
A - B * C + D
. -
Define the Translation Process along with the System Development Life Cycle of a compiler. Use the expression:
a - b + c * 50
. -
List and discuss the various types of errors encountered during the translation process.
-
List out the features/tools a programming language must provide to construct a compiler. Explain briefly.
BS (CS) – Part III (Pre-Engineering, Pre-Medical)
Course Title: Design and Analysis of Algorithms
Type: Regular / Improver
Date: 21-05-2024
Time Allowed: 2 Hours
Note: Attempt any FOUR questions. All questions carry equal marks.
-
(a) Define the term Analysis. Explain Time-Space Trade-Off with an example. [8]
(b) State Euclid’s Algorithm for finding GCD. Compute GCD(1547, 560). [7] -
Write the Divide-and-Conquer recursive Quick Sort algorithm. Analyze its best and worst time complexity. [15]
-
(a) Write a recursive Binary Search algorithm and discuss best, average, and worst-case complexities. [8]
(b) Write the recursive Fibonacci algorithm and discuss its time complexity. [7] -
(a) Write an algorithm for Selection Sort and discuss its time complexities. [7]
(b) Explain why Selection Sort is an unstable sorting algorithm with an example. [8] -
(a) What is a heap? Explain the technique for constructing it. [5]
(b) Apply Max-Heapify to the following sequence and show the steps:
(17, 2, 34, 23, 6, 11, 49, 7, 22, 1)
[10] -
(a) Consider the problem of finding the smallest and largest elements in an array. [7]
(b) Compare Divide-and-Conquer vs Pre-sorting-based algorithms using the step count method for matrix multiplication. [8] -
(a) How is the Greedy Method used to solve the Knapsack Problem? [5]
(b) Write the Fractional Knapsack algorithm. Solve it for:
N = 7, M = 15
Profits = (10, 5, 15, 7, 6, 18, 3)
Weights = (2, 3, 5, 1, 4, 1, 2)
[10]
GOOD LUCK
BS (CS) – Part III
Course Title: Computer Networks
Course Code: COMP-605
Date: 23-05-2024
Max. Marks: 60
Time Duration: 2 Hours
Note: Attempt any FIVE questions. All questions carry equal marks.
-
Discuss Network Security. Describe various threats and attacks. Explain the methods to protect networks.
-
Explain the OSI Model. Describe the functions and protocols of each of its seven layers.
-
Briefly explain IP addressing, subnetting, supernetting, and the default mask.
-
What is DNS? Describe its sections and resource records.
-
Define the four types of addresses in computer networks.
-
What is Data Communication? Define its components and transmission modes.
-
Write a short note on transmission media and their types.
-
Explain Bandwidth Utilization. Differentiate between Multiplexing and Spreading techniques.
-
Define Multiplexing and its role in network communication.
All the Best
BS (CS) – Part III (PE) (Regular & Improver/Failure)
Course Title: Python for Data Science
Course Code: CSE-560
Fifth Semester Final Term 2024 – Morning
Date: 28-05-2024
Time Allowed: 120 Minutes
Note: Attempt any FIVE questions. (Question 7 is compulsory.)
-
What is Data Science? Explain its applications.
-
(a) What is the difference between lists and tuples in Python?
(b) Write a Python program to find the intersection of two lists:
ListA = [1, 0, 5, 7, 9, 14, 19]
ListB = [4, 3, 15, 0, 19, 9, 21]
-
(a) What is a function in Python?
(b) Write a function that returns bigrams from a string. -
(a) What is NumPy used for? Mention its benefits.
(b) Write a program for the multiplication of two NumPy arrays. -
What is a DataFrame? Why is it preferred in data science?
-
Plot the following using Matplotlib (code + output):
-
Title: House Prices vs Area
-
Title: Salaries vs Experience
(From 30k to 100k; Experience: Fresher to 5 Years)
-
-
(Compulsory) Write short notes on any two:
-
Dictionaries in Python
-
Set in Python
-
Data Manipulation
-
Difference between Linear and Logistic Regression
-
BS (CS) – Part III
Course Title: Numerical Computing
Course Code: CSS-550
First Semester Examination – 2024
Date: Thursday, May 30, 2024
Time Allowed: 2 Hours
Note: Attempt any FIVE questions. All questions carry equal marks.
-
What is Numerical Computing? Define accuracy, errors, and their types.
-
Use the Newton-Raphson method to approximate
f(x) = x² – 3
withx₀ = 1
(2 decimal places). -
Solve the system using the Gauss-Seidel Method (3 decimal places):
4x + 2y + 3z = 58 -3x + 22y + 2z = 47 5x + y + 20z = 67 Initial guess: x₀ = y₀ = z₀ = 0
-
Find the inverse of matrix A using LU decomposition:
A = [[25, 5, 1], [64, 8, 1], [144, 12, 1]]
-
The population of a city (once every 10 years) is given. Estimate the population in 1955 using interpolation.
Years: 1951, 1961, 1971, 1981 Population: 35, 42, 58, 84
-
Use the Steepest Descent Method to find the minimum of
f(x, y) = x² + y² + 2x + 4
, starting from a point(2,1)
. -
Solve the differential equation.
y' = 2x – y
,y(0) = 1
in[0, 1]
using Euler’s Method withh = 0.1
. -
Use Trapezoidal Rule (5 strips) to evaluate:
∫₁² (x² + 1) dx
Compare with the exact value.
0 Komentar