Sorting and Graph Algorithms in C

Sorting Algorithms

Quick Sort

#include <stdio.h>
#include <time.h>

void quickSort(int arr[], int low, int high);
int partition(int arr[], int low, int high);

void quickSort(int arr[], int low, int high) {
    if (low < high) {
        int pi = partition(arr, low, high);
        quickSort(arr, low, pi - 1);
        quickSort(arr, pi + 1, high);
    }
}

int partition(int arr[], int low, int high) {
    int pivot = arr[high];
    int i = (low - 1);
    for (int j = low; j <= high 
Read More

Understanding Process Management in Operating Systems

What is a Process?

A process is a running program. When a process is in a ready state, the only thing that’s missing is the allocation of the processor.

Process States

The completed state of a process always comes from the state of execution.

Reasons for a Suspended Process State

A suspended state exists to incorporate more ready processes, preventing the internal memory to the processor from being occupied for too long. This increases system productivity by allowing a larger number of processes to be

Read More

VHDL Code Examples for Digital Logic Circuits

bit ALU

Entity ALU is

Port ( A, B : in STD_LOGIC_VECTOR (3 downto 0);
OP : in STD_LOGIC_VECTOR (1 downto 0);
Result : out STD_LOGIC_VECTOR (3 downto 0));
end ALU;

architecture Behavioral of ALU is
begin
process(A, B, OP)
begin
case OP is
when “00” => Result
when “01” => Result
when “10” => Result
when “11” => Result
when others => Result
end case;
end process;
end Behavioral;

MUX Using When Else Statement

entity MUX41 is

Port ( I0, I1, I2, I3 : in STD_LOGIC;

S : in STD_LOGIC_VECTOR (1 downto 0);

Y

Read More

Database Management Systems: Concepts and Users

Database Definition and the Database

The database aims at resolving the problems of storage and data management. Databases also have file management systems. A file management system presents different problems of management and storage of information, such as:

  • Redundancy and inconsistency of data
  • Difficulty in searching
  • Data isolation within programs
  • Security problems

A database is a system formed by a collection of files that controls the storage of redundant data. Data is independent of programs and

Read More

Understanding the Android Software Stack and Operating Systems

Understanding the Role of the Linux Kernel in the Android Software Stack

The Linux Kernel plays a central role in the Android software stack as the foundation layer that interacts directly with the hardware and provides basic services for all other software layers above it. It handles tasks such as memory management, process scheduling, device drivers, and hardware abstraction, which are essential for running applications and services in Android.

Role of the Linux Kernel in Android:

  • Hardware Abstraction:
Read More

Understanding P2P Networks, Software Licensing, and Data Privacy

P2P (Peer-to-Peer) Networks

A P2P network is a peer computer network where all participants behave as both clients and servers. The main idea is that all users share resources. The more a user shares, the more privileges they have, and the faster their access will be. To download a file, it is broken into small pieces. These parts are then requested and downloaded. You also become a server for the parts you are downloading. This allows the same file to be downloaded from many places at once, so the

Read More