Parallel and Distributed Computing Models Explained

Parallel and Distributed Programming Models

Parallel Programming Models

Shared Memory Model: Allows all processors to use the same memory space.

Distributed Memory Model: Uses separate memory for each processor and relies on message passing.

Data Parallelism: Applies the same operation to many data items at once.

Task Parallelism: Runs different tasks in parallel on possibly different data.

Distributed Programming Models

  • Client-Server Model: Involves clients requesting services and servers providing them.
Read More

I is correct ii is correct

Explain the use of scanf() and printf() with examples


#include <stdio.H>

int main() {

    int a = 10;

    float b = 5.5;

    printf(“The value of a is %d and b is %.2f\n”, a, b);

    return 0;

}

The value of a is 10 and b is 5.50

#include <stdio.H>

int main() {

    int age;

    printf(“Enter your age: “);

    scanf(“%d”, &age);

    printf(“You are %d years old.\n”, age);

    return 0;

}         ,      You are 21 years old.


Explain the following types of function arguments

Read More

Kali Linux Command Reference: Basic to Intermediate Shell

This cheat sheet covers essential commands for system navigation, file management, user administration, and networking in Kali Linux, spanning foundational concepts (Lessons 1-2) and more advanced topics (Lessons 3-4).

System Information and Navigation

ConceptCommand / InfoKey Point
OS Infouname -aShow kernel, version, and architecture
HostnamehostnameShow the system’s hostname (L3-4)
List filesls, ls -l, ls -als-l = detailed listing, -a = show hidden files
Manualman <cmd>View command help documentation
Read More

System Programming Fundamentals: Linking, Memory, and Concurrency

Linking

  • The linker is unaware of local variables that exist only within functions.
  • Local variables with the same name as global variables follow their local scope.

Symbol Types in Linking

Global Symbols

  • Symbols defined by module m (e.g., m.cpp) that can be referenced by other modules.
  • Includes non-static C functions and non-static global variables.

External Symbols

  • Global symbols referenced by module m but defined by some other module.

Local Symbols

  • Symbols defined and referenced exclusively by module m.
  • Includes
Read More

Implementing Hash Tables with Chaining and Linear Probing

Hash Function Implementation

def hash_func(key, size):
return sum(ord(c) for c in key) % size

Hash Table with Chaining

class HashTableChaining:
def __init__(self, size):
self.table = [[] for _ in range(size)]
self.comparisons = 0

Insert Method

def insert(self, name, number):
index = hash_func(name, len(self.table))
self.table[index].append((name, number))

Search Method

def search(self, name):
index = hash_func(name, len(self.table))
for n, num in

Read More

Malware Types and Cyber Attack Defense Strategies

Malware: Malicious Software Defined

Malware is malicious software designed to disrupt systems, steal information, or gain unauthorized access. The primary goals of malware include:

  • Disruption: Shutting down processes or freezing systems.
  • Data Theft: Exfiltrating sensitive data like passwords.
  • Unauthorized Access: Providing attackers with a secret entry point.
  • Covert Control: Enabling remote command and control (C&C) operations, often forming botnets.

The fundamental concept of malware has remained

Read More