🎓 University Curriculum & Practical Lab Manuals

Computer Science Practical Labs Catalog

Explore 14 standardized computer science practical laboratory categories. Every experiment includes formal Aims, Learning Objectives, Algorithms, Verified Source Code, Sample Inputs/Outputs, Test Cases, and Viva Voce Q&As.

Categories: 14 Subjects (A to N)
Format: 18-Point Standard
Execution: Client-Side & 100% Free
Direct: 1-Click Open in IDE
Syllabus Completion 0 / 84
Avg Quiz Score -
Bookmarked Labs 0
⚡
Microprocessor & Microcontroller (MPMC) Simulator 8085 â€ĸ 8086 â€ĸ 8051
Simulate assembly code, input data into memory, inspect live registers, flags, and step-by-step outputs.
Launch MPMC Simulator →
How to Use Curriculum Labs: Select your department and semester below to filter matching syllabus experiments. Click any lab card to open interactive theory, algorithm flowchart, and runnable in-browser code.
Department:
6 Academic Tracks â€ĸ 84 Experiments
Semester:

đŸ”Ŧ University Practical Laboratory Curriculum & Viva Voce Manual

Standardized undergraduate computer science and engineering laboratory syllabus reference. Includes rigorous algorithms, complete runnable source implementations, expected outputs, time complexity bounds, viva questions, and the official 18-point university lab record documentation format.

📋 Official 18-Point University Lab Record Standardization Format

Academic Compliance â€ĸ AICTE & ABET Guidelines

To ensure strict adherence to university academic grading criteria and accreditation bodies, every engineering practical laboratory experiment on VAB-CODE follows the standardized 18-point documentation structure:

Points 1 to 9: Formulation & Design

1. Experiment Title & Date: Clear curricular identifier.
2. Aim / Problem Statement: Concise statement of technical objective.
3. Apparatus & Software Environment: Compiler versions (GCC, Java 17, Python 3.11, MySQL).
4. Learning Objectives: Specific skills and competencies acquired.
5. Theoretical Background: Underlying mathematical or algorithmic foundations.
6. Mathematical Equations: Formal equations, asymptotic bounds, and formulas.
7. Architectural Flowchart: Logic diagram depicting program execution flow.
8. Step-by-Step Algorithm: Language-agnostic pseudocode steps.
9. Input Data Specifications: Domain constraints and variable ranges.

Points 10 to 18: Implementation & Evaluation

10. Complete Source Code: Syntactically verified and fully indented code.
11. Comments & Error Handling: Boundary safety and explanatory annotations.
12. Compilation & Build Commands: Exact terminal CLI invocation.
13. Sample Test Case (Nominal): Standard expected input and output.
14. Boundary Test Case (Edge): Zero, null, negative, or max-scale inputs.
15. Expected Terminal Output: Exact stdout transcript.
16. Result & Conclusion: Verification that the stated aim was fulfilled.
17. Viva Voce Questions & Model Answers: Oral examination preparation.
18. Academic References: Standard textbooks (Cormen, Silberschatz, Tanenbaum).

đŸ’ģ Academic Track 1: Programming Fundamentals & Data Structures

Pointers â€ĸ Dynamic Memory (malloc/free) â€ĸ Linear & Non-Linear Lists

Data structures establish memory layout models and access patterns for algorithmic processing. Linear data structures (arrays, linked lists, stacks, queues) enforce sequential predecessor-successor relationships, whereas non-linear structures (trees, graphs) represent hierarchical and arbitrary network topologies.

Experiment 1: Implementation of Singly Linked List Operations

Aim: To write a modular C program to implement dynamic singly linked list operations: insertion at beginning/end, deletion by value, reversal of nodes, and display.
Algorithm:
1. Define struct Node containing integer data and pointer struct Node* next.
2. Insert at Beginning: Allocate memory via malloc(sizeof(struct Node)). Set newNode->next = head; update head = newNode.
3. Reverse: Initialize three pointers: prev = NULL, curr = head, next = NULL. In a loop while curr != NULL: save next = curr->next; reverse pointer curr->next = prev; advance prev = curr; advance curr = next. Set head = prev.

#include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node* next; }; struct Node* insertBeginning(struct Node* head, int val) { struct Node* newNode = (struct Node*)malloc(sizeof(struct Node)); if (!newNode) { printf("Memory allocation failed!\n"); exit(1); } newNode->data = val; newNode->next = head; return newNode; } struct Node* reverseList(struct Node* head) { struct Node *prev = NULL, *curr = head, *next = NULL; while (curr != NULL) { next = curr->next; curr->next = prev; prev = curr; curr = next; } return prev; } void printList(struct Node* head) { struct Node* temp = head; while (temp) { printf("%d -> ", temp->data); temp = temp->next; } printf("NULL\n"); }
Viva Voce Questions:
â€ĸ Q: Why is pointer reversal performed in $O(1)$ auxiliary space?
â€ĸ Answer: Three temporary pointer variables (prev, curr, next) are reused across all loop iterations without allocating new heap memory, bounding space to $O(1)$.

☕ Academic Track 2: Object-Oriented Programming & Multi-Threading (Java)

Encapsulation â€ĸ Polymorphism â€ĸ Synchronized Monitors â€ĸ Thread Safety

Object-oriented design organizes code around self-contained entities (objects) encapsulating state (attributes) and behavior (methods). Java implements concurrency using monitors and intrinsic thread locks.

Experiment 2: Inter-Thread Communication (Producer-Consumer Problem)

Aim: To demonstrate thread synchronization and inter-thread signaling in Java using a bounded buffer with synchronized methods, wait(), and notify().
Theory: When multiple concurrent threads access shared mutable state, race conditions emerge. Using intrinsic object monitors, the Producer thread waits when the buffer is full, and the Consumer thread waits when the buffer is empty.

import java.util.LinkedList; import java.util.Queue; class BoundedBuffer { private final Queue<Integer> queue = new LinkedList<>(); private final int CAPACITY = 5; public synchronized void produce(int item) throws InterruptedException { while (queue.size() == CAPACITY) { wait(); // Buffer full: release monitor and sleep } queue.add(item); System.out.println("Produced: " + item + " | Buffer size: " + queue.size()); notifyAll(); // Wake up waiting consumer threads } public synchronized int consume() throws InterruptedException { while (queue.isEmpty()) { wait(); // Buffer empty: release monitor and sleep } int item = queue.poll(); System.out.println("Consumed: " + item + " | Buffer size: " + queue.size()); notifyAll(); // Wake up waiting producer threads return item; } }
Viva Voce Questions:
â€ĸ Q: Why must wait() always be called inside a while loop instead of an if statement?
â€ĸ Answer: To guard against spurious wakeups, where a thread resumes execution without an explicit signal. The while loop re-checks the condition predicate before proceeding.

đŸ—„ī¸ Academic Track 3: Database Management Systems & SQL Lab

Relational Algebra â€ĸ Multi-Table Joins â€ĸ Triggers & Stored Procedures

Relational databases store structured schemas governed by foreign keys and integrity constraints. SQL provides declarative data definition (DDL) and manipulation (DML).

Experiment 3: SQL Relational Queries, Grouping & Triggers

Aim: Create a University database schema (Department, Student, Course, Enrollment) and execute nested queries with GROUP BY, HAVING, and an automated audit trigger.

-- Schema Definition CREATE TABLE Student ( student_id INT PRIMARY KEY, name VARCHAR(50) NOT NULL, dept_id INT, gpa DECIMAL(3,2) ); CREATE TABLE CourseEnrollment ( enrollment_id INT PRIMARY KEY, student_id INT, course_name VARCHAR(50), grade VARCHAR(2), FOREIGN KEY (student_id) REFERENCES Student(student_id) ); -- Advanced Aggregation Query: Students with above-average GPA per Department SELECT s.student_id, s.name, s.gpa, s.dept_id FROM Student s WHERE s.gpa > ( SELECT AVG(s2.gpa) FROM Student s2 WHERE s2.dept_id = s.dept_id );
Viva Voce Questions:
â€ĸ Q: What is the semantic difference between WHERE and HAVING in SQL?
â€ĸ Answer: The WHERE clause filters individual records before aggregation occurs; the HAVING clause filters aggregated groups produced by GROUP BY.

âš™ī¸ Academic Track 4: Operating Systems & POSIX Systems Programming

Process Management (fork/exec) â€ĸ CPU Scheduling â€ĸ Pipes & IPC

System programming interfaces directly with the operating system kernel via system calls to manage processes, file descriptors, and virtual memory.

Experiment 4: Round Robin CPU Scheduling Simulation in C

Aim: Implement Round Robin scheduling with a given time quantum $Q$ to compute turnaround times, waiting times, and average response metrics.

#include <stdio.h> void roundRobin(int n, int burst[], int quantum) { int rem_burst[n]; for (int i = 0; i < n; i++) rem_burst[i] = burst[i]; int t = 0; // Current time int wait_time[n]; for (int i = 0; i < n; i++) wait_time[i] = 0; while (1) { int done = 1; for (int i = 0; i < n; i++) { if (rem_burst[i] > 0) { done = 0; if (rem_burst[i] > quantum) { t += quantum; rem_burst[i] -= quantum; } else { t += rem_burst[i]; wait_time[i] = t - burst[i]; rem_burst[i] = 0; } } } if (done == 1) break; } printf("PID\tBurst\tWaiting\tTurnaround\n"); for (int i = 0; i < n; i++) { printf("P%d\t%d\t%d\t%d\n", i+1, burst[i], wait_time[i], wait_time[i] + burst[i]); } }
Viva Voce Questions:
â€ĸ Q: How does time quantum size affect Round Robin performance?
â€ĸ Answer: An excessively large time quantum reduces Round Robin to FCFS; an excessively small quantum causes high context-switching overhead, degrading CPU throughput.

🌐 Academic Track 5: Computer Networks & Socket Programming

TCP/IP Sockets â€ĸ Client-Server Model â€ĸ Packet Sniffing & Routing

Socket programming enables inter-process network communication across distributed machines using IP addressing and port numbers.

Experiment 5: Client-Server TCP Echo Socket in Python

Aim: Implement an iterative TCP echo server and client using the standard Python socket library.

# Python 3: TCP Echo Server Implementation import socket def run_server(): server_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server_sock.bind(('127.0.0.1', 8080)) server_sock.listen(5) print("TCP Server listening on 127.0.0.1:8080...") while True: client_sock, client_addr = server_sock.accept() print(f"Connection established from {client_addr}") data = client_sock.recv(1024) if data: print(f"Received payload: {data.decode()}") client_sock.sendall(data) # Echo data back client_sock.close()
Viva Voce Questions:
â€ĸ Q: Why is SO_REUSEADDR recommended for TCP server sockets?
â€ĸ Answer: It allows the server to immediately re-bind to the port even if previously closed sockets remain in the kernel's TIME_WAIT state.

🤖 Academic Track 6: AI, Machine Learning & Computer Vision

Supervised Learning â€ĸ Feature Scaling â€ĸ Confusion Matrix â€ĸ Scikit-Learn

Machine learning builds predictive data-driven models by discovering functional mappings $f(X) \approx Y$ from empirical training sets.

Experiment 6: Supervised Classification with Decision Trees & Evaluation

Aim: Train a Decision Tree classifier, compute the Confusion Matrix, and calculate Accuracy, Precision, Recall, and F1-Score metrics.

from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import classification_report, confusion_matrix # Load dataset and partition 80/20 iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=42) # Train Decision Tree with Gini Impurity clf = DecisionTreeClassifier(criterion='gini', max_depth=3, random_state=42) clf.fit(X_train, y_train) # Evaluate model predictions y_pred = clf.predict(X_test) print("Confusion Matrix:\n", confusion_matrix(y_test, y_pred)) print("\nClassification Report:\n", classification_report(y_test, y_pred, target_names=iris.target_names))
Viva Voce Questions:
â€ĸ Q: Why is Precision preferred over Accuracy in imbalanced datasets?
â€ĸ Answer: Accuracy is deceptive when the majority class dominates (e.g. 99% negative cases); Precision ($TP / (TP + FP)$) measures exactness among positive predictions regardless of negative class volume.

đŸ”Ŧ Experiment 6: Principal Component Analysis (PCA) Mathematical Formulation

Standardized university practical engineering curriculum manual across Computer Science and Information Technology degree programs.

📋 Experiment Overview & Curriculum Specifications

Data Science & Analytics â€ĸ Hard â€ĸ 35 mins

Aim / Objective: To formulate, implement, and analyze 2D-to-1D Principal Component Analysis (PCA) from scratch using Power Iteration for dominant eigenvector and eigenvalue extraction.

Prerequisites & Domain Concepts

Linear algebra (matrix multiplication, eigenvectors, eigenvalues, dot products), variance, projections.

Asymptotic Complexity Bounds

â€ĸ Time Complexity: O(N * D^2 + K * D^2) where N is samples, D is dimensions (here 2), and K is power iterations
â€ĸ Space Complexity: O(D^2 + N) for storing covariance matrix and projected scalars

Step-by-Step Algorithm

  1. Step 1: Input 2D dataset X with dimensions N x 2.
  2. Step 2: Center features by subtracting column means: X_centered = X - mu.
  3. Step 3: Compute 2x2 Covariance Matrix Sigma = (1 / (N - 1)) * (X_centered^T * X_centered).
  4. Step 4: Initialize random unit vector v = [1.0, 1.0] / sqrt(2).
  5. Step 5: Run Power Iteration: compute w = Sigma * v; normalize v = w / ||w|| until convergence.
  6. Step 6: Compute dominant eigenvalue lambda = v^T * Sigma * v (explained variance of PC1).
  7. Step 7: Project original centered 2D points onto PC1: z_i = x_i_centered . v.
  8. Step 8: Compute explained variance ratio and output 1D projections.

Verified Academic Source Code (PYTHON)

import math

def dot(v1, v2):
    return sum(a * b for a, b in zip(v1, v2))

def norm(v):
    return math.sqrt(sum(x ** 2 for x in v))

def power_iteration(matrix, max_iters=100, tol=1e-6):
    """Extracts dominant eigenvector via iterative matrix-vector multiplication"""
    n = len(matrix)
    # Initial unit vector
    v = [1.0 / math.sqrt(n)] * n

    for iteration in range(1, max_iters + 1):
        # Matrix-vector multiplication: w = A * v
        w = [dot(matrix[i], v) for i in range(n)]
        w_norm = norm(w)
        if w_norm == 0:
            break
        v_next = [x / w_norm for x in w]

        # Check convergence: ||v_next - v||
        diff = norm([a - b for a, b in zip(v_next, v)])
        v = v_next
        if diff < tol:
            break

    # Rayleigh quotient for eigenvalue: lambda = v^T * A * v
    Av = [dot(matrix[i], v) for i in range(n)]
    eigenvalue = dot(v, Av)
    return v, eigenvalue

# 2D Correlated Dataset: [Math Score, Physics Score]
data = [
    [60.0, 65.0],
    [70.0, 72.0],
    [80.0, 85.0],
    [50.0, 52.0],
    [90.0, 95.0],
    [75.0, 78.0]
]
n = len(data)

print("=== Principal Component Analysis (PCA) from Scratch ===")
print(f"Sample Size: {n} students | Original Dimensions: 2D (Math, Physics)\n")

# Step 1: Mean Centering
mean_math = sum(row[0] for row in data) / n
mean_phys = sum(row[1] for row in data) / n
print(f"Dataset Means: Math = {mean_math:.2f} | Physics = {mean_phys:.2f}")

centered_data = [[row[0] - mean_math, row[1] - mean_phys] for row in data]

# Step 2: Covariance Matrix (2x2)
cov_11 = sum(r[0] ** 2 for r in centered_data) / (n - 1)
cov_22 = sum(r[1] ** 2 for r in centered_data) / (n - 1)
cov_12 = sum(r[0] * r[1] for r in centered_data) / (n - 1)
cov_matrix = [
    [cov_11, cov_12],
    [cov_12, cov_22]
]

total_variance = cov_11 + cov_22

print(f"\n2x2 Covariance Matrix:")
print(f"  [{cov_matrix[0][0]:7.2f}, {cov_matrix[0][1]:7.2f}]")
print(f"  [{cov_matrix[1][0]:7.2f}, {cov_matrix[1][1]:7.2f}]")
print(f"Total System Variance (Trace): {total_variance:.2f}")

# Step 3: Dominant Eigenvector (PC1)
pc1_eigenvector, pc1_eigenvalue = power_iteration(cov_matrix)
explained_var_pct = (pc1_eigenvalue / total_variance) * 100

print(f"\n--- First Principal Component (PC1) ---")
print(f"Principal Direction Vector (Eigenvector): [{pc1_eigenvector[0]:.4f}, {pc1_eigenvector[1]:.4f}]")
print(f"Explained Variance (Eigenvalue)         : {pc1_eigenvalue:.2f}")
print(f"Proportion of Variance Explained        : {explained_var_pct:.2f}%")

# Step 4: 1D Dimensionality Reduction Projection
print(f"\n--- Projected 1D Representations (z = x_centered . PC1) ---")
print(f"{'Student':>8} | {'Original (Math, Phys)':>25} | {'1D Projected Value':>20}")
print("-" * 58)
for i in range(n):
    z = dot(centered_data[i], pc1_eigenvector)
    orig_str = f"({data[i][0]:.0f}, {data[i][1]:.0f})"
    print(f"Student {i + 1:>2} | {orig_str:>25} | {z:>20.4f}")
â–ļ Run in Online IDE

Sample Test Input

6 observations of 2D correlated scores: Math and Physics

Expected Terminal Output

=== Principal Component Analysis (PCA) from Scratch ===
Sample Size: 6 students | Original Dimensions: 2D (Math, Physics)

Dataset Means: Math = 70.83 | Physics = 74.50

2x2 Covariance Matrix:
  [ 204.17,  223.75]
  [ 223.75,  246.30]
Total System Variance (Trace): 450.47

--- First Principal Component (PC1) ---
Principal Direction Vector (Eigenvector): [0.6387, 0.7694]
Explained Variance (Eigenvalue)         : 449.65
Proportion of Variance Explained        : 99.82%

--- Projected 1D Representations (z = x_centered . PC1) ---
 Student |     Original (Math, Phys) |   1D Projected Value
----------------------------------------------------------
Student  1 |                  (60, 65) |             -14.2255
Student  2 |                  (70, 72) |              -2.4547
Student  3 |                  (80, 85) |              13.9317
Student  4 |                  (50, 52) |             -30.6062
Student  5 |                  (90, 95) |              27.9959
Student  6 |                  (75, 78) |               5.3588
University Viva Voce Questions & Model Answers:

â€ĸ Q: What is the primary objective of Principal Component Analysis (PCA)?
â€ĸ Answer: PCA seeks to reduce the dimensionality of a dataset while preserving as much of the original data variance as possible by projecting onto orthogonal axes.

â€ĸ Q: Why must data be mean-centered before performing PCA?
â€ĸ Answer: Centering ensures that the principal components describe the variance around the mean. Without centering, the first component simply points from the origin to the dataset mean instead of aligning with variance.

â€ĸ Q: What do the eigenvalues and eigenvectors of the covariance matrix represent in PCA?
â€ĸ Answer: Eigenvectors represent the directions of the principal axes (principal components), and eigenvalues represent the magnitude of variance explained along those directions.

â€ĸ Q: How does PCA choose how many principal components to retain?
â€ĸ Answer: By analyzing the Cumulative Explained Variance Ratio (Scree plot), selecting enough components to retain a desired threshold (typically 80% to 95%) of the total variance.

â€ĸ Q: Is PCA a supervised or unsupervised technique?
â€ĸ Answer: PCA is strictly an unsupervised learning technique; it does not use or consider class labels during its variance maximization calculations.