Compiler Construction – First Semester Examination 2024 IMCS University of Sindh

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.

  1. Explain the history of translators. Differentiate between a compiler and an interpreter. Why is a compiler faster than an interpreter? Discuss briefly.

  2. A symbol table is necessary for compiler construction. Justify your statement with examples.

  3. List and design the language processing system components. Explain briefly.

  4. Differentiate between Syntax Tree (ST) and Abstract Syntax Tree (AST). Design ST & AST for the expression: A - B * C + D.

  5. Define the Translation Process along with the System Development Life Cycle of a compiler. Use the expression: a - b + c * 50.

  6. List and discuss the various types of errors encountered during the translation process.

  7. 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.

  1. (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]

  2. Write the Divide-and-Conquer recursive Quick Sort algorithm. Analyze its best and worst time complexity. [15]

  3. (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]

  4. (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]

  5. (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]

  6. (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]

  7. (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.

  1. Discuss Network Security. Describe various threats and attacks. Explain the methods to protect networks.

  2. Explain the OSI Model. Describe the functions and protocols of each of its seven layers.

  3. Briefly explain IP addressing, subnetting, supernetting, and the default mask.

  4. What is DNS? Describe its sections and resource records.

  5. Define the four types of addresses in computer networks.

  6. What is Data Communication? Define its components and transmission modes.

  7. Write a short note on transmission media and their types.

  8. Explain Bandwidth Utilization. Differentiate between Multiplexing and Spreading techniques.

  9. 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.)

  1. What is Data Science? Explain its applications.

  2. (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]

  3. (a) What is a function in Python?
    (b) Write a function that returns bigrams from a string.

  4. (a) What is NumPy used for? Mention its benefits.
    (b) Write a program for the multiplication of two NumPy arrays.

  5. What is a DataFrame? Why is it preferred in data science?

  6. 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)

  7. (Compulsory) Write short notes on any two:

    1. Dictionaries in Python

    2. Set in Python

    3. Data Manipulation

    4. 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.

  1. What is Numerical Computing? Define accuracy, errors, and their types.

  2. Use the Newton-Raphson method to approximate f(x) = x² – 3 with x₀ = 1 (2 decimal places).

  3. 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  
    
  4. Find the inverse of matrix A using LU decomposition:

    A = [[25, 5, 1],  
         [64, 8, 1],  
         [144, 12, 1]]  
    
  5. 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  
    
  6. Use the Steepest Descent Method to find the minimum of f(x, y) = x² + y² + 2x + 4, starting from a point (2,1).

  7. Solve the differential equation. y' = 2x – y, y(0) = 1 in [0, 1] using Euler’s Method with h = 0.1.

  8. Use Trapezoidal Rule (5 strips) to evaluate:
    ∫₁² (x² + 1) dx
    Compare with the exact value.



Previous
Next Post »
0 Komentar