C Programming Concepts and Examples

What is an Expression and Operator? Discuss Operator Associativity in C. Write a program to find the factorial of a given integer using recursion.

In programming, an expression is a combination of variables, constants, and operators that yields a value. Operators are symbols that perform operations on operands (variables or values).

In C, operator associativity determines the order in which operators of the same precedence are evaluated in an expression. Operators can be left-associative (evaluated

Read More

Network Communication Models and Technologies

TCP/IP Model

Developed by the Department of Defense, the TCP/IP Model is a practical, four or five-layer framework focused on reliable data transfer. It simplifies the OSI Model, aiming to ensure accurate data transmission across networks.

Layers of the TCP/IP Model

Application Layer

Responsible for end-to-end communication and error-free data delivery.

Key protocols include HTTP, HTTPS, SSH, and NTP.

Transport Layer (TCP/UDP)

Ensures reliable data transmission by handling acknowledgment and retransmission

Read More

Python Basics

Expressions and Statements

An expression is a combination of values and operations that creates a new value, which we call a return value—i.e., the value returned by the operation(s). A statement does not return a value, but does perform some task. A statement may have a side effect. Evaluation of a Python expression may not produce a side effect. An expression has a value, but a statement does not!

Tokens

Special Python elements (e.g., keywords, operators, punctuators and delimiters, literals)

Every

Read More

Understanding Physical Media and Modulation in Telecommunications

Previous Concepts: Physical Concepts

Dun Signal Spectrum and Bandwidth

We have seen that signals have an associated RMS frequency, called the fundamental parameter. We have also seen that any continuous and differentiable signal can be decomposed into a sum (finite or infinite) of sinusoidal signals. Each of these sine components will therefore also be associated with a maximum amplitude. The spectrum of a signal is nothing other than the two-dimensional graphical representation of amplitude vs. frequency.

Read More

Asymptotic Notations, Recurrence Relations, and Dynamic Programming

Asymptotic Notations and Correctness of Algorithms

1. Is the following a property that holds for all non-decreasing positive functions f and g? (True=Yes/ False=No) If f(n) = O(n2) for c=1 and n0=0 and g(n) = Theta(n2) for n0=0 and c1 =1 and c2=1 then f(n) = O(g(n)).

2. Rank the following functions by increasing order of growth: log( n! ),   10000n^2,  log(n^3),  2^n,   n^2log(n)    log(n3), log( n! ), 10000n2, n2log(n), 2n9k=

3. Let W(n) and A(n) denote respectively, the worst case and average

Read More

Python 3 Cheat Sheet

Python 3 Cheat sheet – CWK

Comments

A comment is a piece of text within a program that is not executed. It can be used to provide additional information to aid in understanding the code.

The # character is used to start a comment and it continues until the end of the line.

# Comment on a single lineuser “JDo”# Comment after code

Arithmetic Operations

Python supports different types of arithmetic operations that can be performed on literal numbers, variables, or some combination. The primary arithmetic

Read More