SD
sophia-dcruz_
Practical Lab Manual

Part 2 Practical — Computer Science

The culminating year of M.Sc. CS focuses on advanced specialization topics, dissertation research, and industry-ready capstone project development.

// Lab Subjects (3)

MCS-P201

Deep Learning Lab (TensorFlow / PyTorch)

2 credits

MCS-P202

Security Penetration Testing Lab

2 credits

MCS-P203

M.Sc. Dissertation

10 credits

// Sample Programs (Interactive Viewer)

AI Widget
Program 1: Write a program to implement linear search and binary search.
C
#include <stdio.h>

// Linear Search
int linearSearch(int arr[], int n, int key) {
    for (int i = 0; i < n; i++)
        if (arr[i] == key) return i;
    return -1;
}

// Binary Search (sorted array required)
int binarySearch(int arr[], int low, int high, int key) {
    while (low <= high) {
        int mid = low + (high - low) / 2;
        if (arr[mid] == key) return mid;
        else if (arr[mid] < key) low = mid + 1;
        else high = mid - 1;
    }
    return -1;
}

int main() {
    int arr[] = {2, 5, 8, 12, 16, 23, 38, 56, 72, 91};
    int n = 10, key = 23;

    int li = linearSearch(arr, n, key);
    printf("Linear Search: %d found at index %d\n", key, li);

    int bi = binarySearch(arr, 0, n - 1, key);
    printf("Binary Search: %d found at index %d\n", key, bi);
    return 0;
}
Compile & run this in your local IDE or online compiler (onlinegdb.com)

// Lab Submission Checklist

Write the aim, algorithm, and flowchart before coding
Use meaningful variable names and add inline comments
Test with multiple inputs including edge cases (0, negative, large)
Document the expected vs actual output in your journal
Include the time and space complexity analysis for each program
Paste the screenshot of successful output in your practical file