Notes, summaries, assignments, exams, and exercises for Computer science for University

Memory Paging and Virtual Address Space Management

Computer science3.18 KB

Memory Paging Fundamentals

Paging consists of dividing physical memory into fixed-size sections called frames and logical memory into sections of the same size called pages.

The paging system solved the problem of allocating blocks of equal size using physical memory called page frames.

Page Faults and Replacement

A page fault occurs when referring to a page that is not loaded in any page frame. A page replacement (or page out) is required because the total virtual address space of all processes exceeds the size of physical storage.

Functional Requirements

  • Administration of address space.
  • Address translation.
  • Management of physical memory.
  • Memory protection.
  • Shared memory.
  • Load monitoring system.
  • Mapping files into memory, program execution on remote nodes,
...
Continue reading "Memory Paging and Virtual Address Space Management" »

IP Multicast, QoS Standards, and ADSL Modulation

Computer science3.43 KB

IP Multicast and Group Management

Multidifusion (multicast) refers to the shipment of data to multiple destinations simultaneously. This process requires reserved multicast group addresses, specifically Type D addresses (e.g., 239.255.255.255). The IGMP (Internet Group Management Protocol) is used for IP Multicast management.

Internet multicast protocols include:

  • IP Multicast
  • NNTP (Network News Transfer Protocol)
  • Internet Relay Chat (IRC)
  • PSYC
  • Peercasting

At Layer 3, the IP protocol is used alongside ICMP and IGMP.

Quality of Service (QoS) in Multimedia Networks

QoS is defined by the H.323 standard, which allows multimedia traffic over an IP network. Several parameters influence the behavior of voice streams, which are often challenged by:

  • Packet Jitter:
...
Continue reading "IP Multicast, QoS Standards, and ADSL Modulation" »

Essential Computer Science and Programming Fundamentals

Computer science5.83 KB

Core Concepts in Computer Science and Programming

Microprocessor Components

Arithmetic Logic Unit (ALU) Explained

The Arithmetic Logic Unit (ALU) performs all mathematical and logical operations, such as comparisons, within the CPU.

Role of the Control Unit

The Control Unit is responsible for controlling all operations of both internal microprocessor components and external peripherals.

Memory and Data Storage

Understanding RAM (Random Access Memory)

Another name for volatile memory is RAM (Random Access Memory). It is generally used to store two primary types of information:

  • Program instructions
  • Operating data associated with those instructions

Algorithm Fundamentals

Defining an Algorithm

An algorithm is defined as a finite set of well-defined, unambiguous...

Continue reading "Essential Computer Science and Programming Fundamentals" »

Fundamentals of Computer Programming and Algorithm Design

Computer science3.04 KB

Program Structure

Program: Legible instructions for the computer, sorted sequentially to perform a particular job or solve a problem, using a language understood by the machine. The program represents a man-machine relationship, while the algorithm represents a relationship between man and man.

Types of Programs

  • Linear Programs: The development of the program is done in the same sequential order in which instructions are written.
  • Cyclic: They contain a group of statements to be repeated a number of times and therefore must contain branch instructions or supervision.
  • Alternatives: There are those who can go through different paths depending on the values that make certain variables.

Glossary

Why is the program run in sequence?

Because it is the computer...

Continue reading "Fundamentals of Computer Programming and Algorithm Design" »

Relational Algebra and SQL Fundamentals Explained

Computer science2.74 KB

Relational Algebra Operations

The Divide Operation

The Divide operation takes two relations—one binary and one unary—to build a relationship consisting of all attribute values of the binary relation that match all values of the unary relation. It is represented by the operator DIVIDEBY:

NomTablaBin DIVIDEBY NomTablaUna

The Difference Operation

The Difference operation builds a relationship consisting of all tuples (rows) of the first relation that do not appear in the second relation. It is represented by the operator MINUS:

Nom_tablaA MINUS NomTablaB

The Union Operation

The Union operation builds a relationship consisting of all tuples from the first relation and all tuples from the second relation. The requirement is that both relationships must...

Continue reading "Relational Algebra and SQL Fundamentals Explained" »

Essential C Programming Exam Questions and Solutions

Computer science37.36 KB

x4jbIeyLsADAAAAAElFTkSuQmCC

Store Fibonacci Series in an Array

Exam Source: 2024 Q6(b)

Note: fib[0]=0, fib[1]=1, fib[i] = fib[i-1] + fib[i-2] for i >= 2.

#include <stdio.h>

int main() {
    int n, i;
    printf("How many terms? ");
    scanf("%d", &n);
    int fib[n];
    fib[0] = 0;
    if (n > 1) fib[1] = 1;
    for (i = 2; i < n; i++)
        fib[i] = fib[i-1] + fib[i-2];
    printf("Fibonacci series: ");
    for (i = 0; i < n; i++)
        printf("%d ", fib[i]);
    return 0;
}

Dynamic Memory Allocation and Average Calculation

Exam Source: 2024 Q7(c) / 2025 Q6(a) — Repeated both years!

Note: malloc returns void*, cast to int*. Always free() after use. If malloc returns NULL, memory allocation failed.

#include <stdio.h>
#include <stdlib.h&
...
Continue reading "Essential C Programming Exam Questions and Solutions" »

Essential Web Development: JavaScript, jQuery, and CSS Tips

Computer science4.31 KB

Use of Alert Box

An alert box is a JavaScript popup dialog box used to display messages or warnings to the user.

Uses of Alert Box

  • To display information messages
  • To show warning messages
  • To show error messages in form validation
  • To notify users about system events
  • Used for debugging purposes

JavaScript Program using RegExp Object

Definition: A Regular Expression (RegExp) is an object used to define a search pattern and perform matching operations on strings.

let text = "My email is [email protected]";
let pattern = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/;
let result = text.match(pattern);
if(result) { alert("Email found: " + result); } else { alert("No email found"); }

HTML and JavaScript Prompt Demo

<!DOCTYPE html>
<html>
<head&
...
Continue reading "Essential Web Development: JavaScript, jQuery, and CSS Tips" »

Sorting Algorithms and Hashing Techniques

Computer science1.17 MB

Sorting

Stable vs In-Place

Stable: The relative order of elements with the same key value is preserved by the algorithm.

If after the first sort, an element is at its final position and subsequent iterations do not change its position, it is considered stable.

In-Place: Requires only a constant amount, i.e., O(1), of extra space during the sorting process.

Assigning a temporary variable takes up a small amount of constant space but is still counted as in-place.

sy6xAAAAABJRU5ErkJggg==

tjMaqeYQAAAABJRU5ErkJggg==

Sorting Explanations

Merge Sort: For arrays, it requires significant space, but for Linked Lists, due to pointer manipulations, it does not require extra space.

Selection Sort: In each iteration, find the smallest element and swap it with the first index. Subsequent iterations process n-1 elements...

Continue reading "Sorting Algorithms and Hashing Techniques" »

Linear Algebra: Row Space, Null Space, Determinants, and Gram-Schmidt

Computer science2.02 MB

Finding the Basis of a Row Space

The easiest way to find the basis of a row space is to reduce matrix A to Reduced Row Echelon Form (RREF). The nonzero row vectors of R (which contain the leading 1s, or pivots) form a basis for row(A).

Finding the Basis of the Kernel

The following four steps outline the most effective method for finding a basis for null(A):

  1. Reduce A to RREF (R): Find the Reduced Row Echelon Form (R) of the matrix A.
  2. Solve the Homogeneous System: Use the RREF, R, to solve the equivalent homogeneous system Rx=0.
  3. Identify and Parameterize Variables:
    • Identify the leading variables (those corresponding to columns containing a leading 1 or pivot in the RREF) and the free variables.
    • Solve for the leading variables in terms of the free variables.
...
Continue reading "Linear Algebra: Row Space, Null Space, Determinants, and Gram-Schmidt" »

Data Mining and Knowledge Discovery: Core Concepts

Computer science1.43 MB

Multilevel Association Rules

Hierarchy Matters: Items in databases are structured from general to specific (e.g., Food → Dairy → Milk → Amul Milk).

Low-Level Items: Rarely appear, so have low support.

Support & Confidence: Support decreases as we get specific; confidence usually stays stable in the hierarchy.

Approaches: Uniform Minimum Support uses the same support for all levels, but may miss specific patterns. Reduced Minimum Support assigns different supports; higher levels get a higher threshold, while lower levels get a smaller threshold.

Search Strategies: Independent Search mines levels separately. Level-Cross Filtering explores child nodes only if the parent is frequent. Controlled Level-Cross Filtering balances exploration and...

Continue reading "Data Mining and Knowledge Discovery: Core Concepts" »