Notes, summaries, assignments, exams, and problems for Computers

Sort by
Subject
Level

String and Linked List Data Structures Explained

Posted by Anonymous and classified in Computers

Written on in English with a size of 6.48 KB

1. Storage of Strings

At its core, a string is a sequence of characters. How computer systems store and manipulate these characters determines code performance and memory usage. Computer memory is linear, so strings must be mapped to sequential data structures using three primary methods:

A. Fixed-Length Storage (Static Allocation)

Each string variable is assigned a fixed number of bytes at compile time.

  • Mechanics: If a string is smaller than the allocated size, the remaining space is padded with blanks or null characters. If it exceeds it, the string is truncated.
  • Pros/Cons: Very fast to access, but highly inefficient with memory.

B. Variable-Length Storage (Contiguous Array)

The string occupies only the space it needs, stored side-by-side in memory.... Continue reading "String and Linked List Data Structures Explained" »

Python Best Practices: Style, Concepts, and Comprehensions

Classified in Computers

Written on in English with a size of 386.58 KB

Python Coding Style: PEP 8

PEP 8: Indentation: Use 4 spaces. Line Length: Limit to 79 characters. Imports: Import on separate lines. Naming: Follow naming conventions. Comments: Explain non-obvious code. Whitespace: Use blank lines judiciously. Function Arguments: Use spaces after commas. Annotations: Follow type annotation guidelines.

Documentation: Use docstrings. Vertical Whitespace: Separate code logically. Imports Formatting: Organize import statements. Avoid Wildcard Imports: Be explicit. Consistency: Maintain consistency in style.

Four Core Programming Concepts

Four Big Programming Concepts: Abstraction and encapsulation, Parameterization, Iteration (loops), Expressions (calculations).

Understanding NamedTuple

NamedTuple: Named Fields: namedtuple... Continue reading "Python Best Practices: Style, Concepts, and Comprehensions" »

Software Architecture Essentials: Design Principles & Patterns

Posted by Anonymous and classified in Computers

Written on in English with a size of 7.09 KB

Software Architecture Fundamentals

  • Definition (IEEE): The fundamental organization of a software system, including components, their relationships, and design principles.

  • Purpose: To ensure reliability, efficiency, security, and maintainability.


Architectural Design Process

  • Goal: Design the system’s overall structure and its communication.

  • Outputs: An architectural model showing component interaction.

  • Key Link: Connects requirements to design.


Software Architecture Documentation

  • Includes:

    • Product Overview

    • Static and Dynamic Architectural Models

    • Mapping Between Models

    • Design Rationale


Architectural Abstraction Levels

  • In the Small: Structure of a single program.

  • In the Large: Structure of enterprise-level systems across networks.


Benefits of Explicit Architecture

  • Stakeholder

... Continue reading "Software Architecture Essentials: Design Principles & Patterns" »

JavaScript Fundamentals: Quick Reference Cheat Sheet

Classified in Computers

Written on in English with a size of 2.61 KB

JavaScript Fundamentals Cheat Sheet

1. Variables

  • let: Used to declare variables that are block-scoped. This means they only exist within the block they are defined in (e.g., inside a loop or an if statement).
  • const: Used for constants, which are also block-scoped. Once assigned a value, they cannot be reassigned.
  • var: Declares variables that are function-scoped. This can lead to issues with variable hoisting and is generally less preferred in modern JavaScript.

2. Functions

  • Functions are reusable blocks of code designed to perform a specific task. They can take parameters (inputs) and can return values.
  • Functions can be defined in different ways, including traditional function declarations and arrow functions, which provide a more concise syntax.

3.

... Continue reading "JavaScript Fundamentals: Quick Reference Cheat Sheet" »

Key Characteristics of Effective Database Management

Classified in Computers

Written on in English with a size of 2.4 KB

A database has several key characteristics that make it an essential tool for managing information efficiently. Here are the main characteristics explained in simple language:

  • Structured Data Storage: Databases store data in a structured format, usually in tables with rows and columns. This structure makes it easy to organize, manage, and retrieve information.
  • Data Integrity: Databases ensure the accuracy and consistency of data. Rules can be set to prevent errors, such as entering text into a field meant for numbers or duplicating records.
  • Data Security: Databases provide features to protect data from unauthorized access. You can set permissions to control who can view, update, or delete data, ensuring that sensitive information remains secure.
... Continue reading "Key Characteristics of Effective Database Management" »

Essential Authentication Methods, Linux Filters, and Network Topologies

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.73 KB

Authentication Methods

  • Password-Based Authentication
    • User logs in with username + password.
    • Common but vulnerable to brute-force and phishing attacks.
  • Multi-Factor Authentication (MFA)
    • Uses two or more factors:
      • Something you know (password)
      • Something you have (OTP, token)
      • Something you are (biometric)
    • Much more secure.
  • Biometric Authentication
    • Uses fingerprint, face, iris, or voice.
    • Fast and secure; used in phones and high-security systems.
  • Token-Based Authentication
    • Uses a hardware or software token to generate OTP.
    • Examples: Google Authenticator, RSA token.
  • Certificate-Based Authentication
    • Uses digital certificates (public/private key).
    • Used in HTTPS, VPNs, and secure enterprise systems.
  • Single Sign-On (SSO)
    • Login once to access multiple apps (e.g., Gmail and
... Continue reading "Essential Authentication Methods, Linux Filters, and Network Topologies" »

Neural Networks: Neurons, Activation, Structure

Classified in Computers

Written on in English with a size of 3.62 KB

Biological Neurons

A biological neuron is the fundamental unit of the nervous system, responsible for transmitting information throughout the body. It consists of three main parts:

  • Dendrites: These are branch-like structures that receive signals from other neurons and transmit them to the cell body.
  • Cell Body (Soma): Contains the nucleus and other essential organelles responsible for processing information.
  • Axon: A long, thread-like extension that carries nerve impulses away from the cell body to other neurons, muscles, or glands.

Neurons communicate using electrical and chemical signals through synapses, where neurotransmitters help in transmitting the signals. The brain contains billions of neurons that work together to perform cognitive functions,... Continue reading "Neural Networks: Neurons, Activation, Structure" »

It used to define the member functions of a class outside

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.65 KB

Q1. Difference between Object Oriented Programming (OOP) and Procedure Oriented Programming (POP)

(12 Marks – Expanded Answer)

Programming is the process of writing instructions for a computer.
Based on program design, programming languages are mainly divided into Procedure Oriented Programming (POP) and Object Oriented Programming (OOP).


Procedure Oriented Programming (POP)

Procedure Oriented Programming is a traditional approach of programming in which functions play the main role.
The program is divided into a number of functions and these functions work on shared data.

In POP, data is not secure because most data is declared globally and can be accessed by any function.
Due to this reason, POP is suitable only for small and simple programs.

Main

... Continue reading "It used to define the member functions of a class outside" »

Understanding Constructors and Class Variables in OOP

Classified in Computers

Written on in English with a size of 3.89 KB

Constructor

A constructor is a special method in object-oriented programming that is automatically called when an instance (object) of a class is created. The main purpose of a constructor is to initialize the object's attributes (properties) and allocate resources if needed. Constructors have the same name as the class and do not have a return type.

Example of a Constructor

Here is an example in Python:

class Person:
    def __init__(self):
        self.name = "John Doe"
        self.age = 30

# Creating an instance of the Person class
person = Person()

print(person.name)  # Output: John Doe
print(person.age)   # Output: 30

In this example, __init__ is the constructor method in the Person class. It initializes the name and age attributes of the... Continue reading "Understanding Constructors and Class Variables in OOP" »

Understanding Algorithms: Characteristics and Examples

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.84 KB

What Is an Algorithm?

An algorithm is a finite sequence of well-defined instructions designed to solve a specific problem or perform a computation. Algorithms are the foundation of computer programming and data processing. In the context of data structures, algorithms are used to manipulate and manage data efficiently, such as searching, sorting, inserting, or deleting elements.

Characteristics of an Algorithm

  • Finiteness: The algorithm must always terminate after a finite number of steps. It should not run indefinitely.
  • Definiteness: Each step of the algorithm must be precisely and unambiguously defined. There should be no confusion about what needs to be done at any step.
  • Input: An algorithm should have zero or more inputs, which are externally
... Continue reading "Understanding Algorithms: Characteristics and Examples" »