Data Link Layer: Framing, ARQ, HDLC, PPP, Channel Access and Ethernet Explained

Unit 2: Data Link Layer, Complete Notes with Solved PYQs

Your exam is today, so the ★ boxes (exam-ready answers) and the PYQ solutions come first in priority. Read the basics only if you have time.

One correction to the earlier numbers: the 1 Mbps / 20 ms question has two valid answers. The textbook method (Forouzan, which the paper’s wording follows) gives 5% and 75%. The formula Tₜ/(Tₜ+RTT) gives 4.76% and 71.4%. Write the textbook method in the exam and add the formula as a one-line remark.

Read More

Complete JavaScript Roadmap and Topic-Wise Tutorial

JavaScript Complete Topic-Wise Explanation

1. JavaScript kya hai?

JavaScript ek programming language hai jo website ko interactive aur dynamic banati hai.

Simple example:

  • HTML → Website ka structure
  • CSS → Website ka design
  • JavaScript → Website ka behavior/functionality

Example: Button click karne par text change karna.

Click Me

Hello


2. JavaScript ko HTML me add karna

Internal JavaScript

External JavaScript

HTML:

script.js:

console.log("Hello JavaScript");

External JS real projects me commonly use hoti

Read More

C++ Algorithms for Binary Search and Prefix Sums

C++ Competitive Programming Solutions

This document contains several C++ solutions for common algorithmic problems involving prefix sums, binary search, and matrix manipulation.

1. Prefix Sum and Lower Bound Algorithm

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    long long k;

    cin >> n >> k;

    vector<long long> pref(n + 1, 0);

    for (int i = 1; i <= n; i++) {
        long long x;
        cin >> x;
        pref[i] = pref[i - 1] 
Read More

C++ Algorithms and Binary Search Implementation Codes

C++ Binary Search and Algorithms Collection

1. Binary Search Implementation

#include <iostream> 
using namespace std;
int main(){
    int n; 
    cin >> n;
    int a[100000];
    for (int i = 0; i < n; i++)
        cin >> a[i];
    int x;
    cin >> x;
    int l = 0, r = n - 1;
    while (l <= r) {
        int m = (l + r) / 2;
        if (a[m] == x) {
            cout << "Yes";
            return 0;
        }
        if (a[m] < x)
            l = m + 1;
     
Read More

Altair Cheat Sheet Python: Data Visualization Reference

Altair Cheat Sheet Python

01 Build a chart


1. Import + general pattern

import altair as alt
chart = (
    alt.Chart(data).mark_…()
    .encode(x=…, y=…, color=…)
    .transform_…(…).properties(…)
    .interactive()
)

2. Choose a chart type

mark_bar   bars / aggregated comparison
mark_line   trends over an ordered axis
mark_circle   scatter plots
mark_area   filled trends / totals
mark_rect   heat maps
mark_arc   pie or donut charts
mark_boxplot   distribution summaries
mark_geoshape

Read More

Essential Web Development and Java Networking Concepts

CSS Box Model Explained

Every HTML element is treated as a rectangular box made up of four layers, from inside out:

┌─────────────────────────────┐
│          MARGIN             │
│  ┌─────────────────────────┐ │
│  │        BORDER           │ │
│  │  ┌─────────────────────┐ │ │
│  │  │      PADDING        │ 
Read More