Notes, summaries, assignments, exams, and exercises for Computer science for Secondary education

Essential Data Structures and Runtime Concepts Explained

Computer science2.47 KB

B-Trees

B-trees are tree data structures commonly found in database and file system implementations. Unlike standard binary search trees, each node in a B-tree can have more than two children.

Binary Trees

A binary tree is a data structure where each node has at most two children: a left child and a right child. If a child reference is null, it is called an external node; otherwise, it is an internal node.

Hashing Functions

Hashing refers to a method used to generate keys that uniquely represent documents, records, or files. A hash is the result of this function. A fundamental property of hashing is that if two results are different, the inputs that generated them must also be different. Note that collisions can occur, as the range of possible keys...

Continue reading "Essential Data Structures and Runtime Concepts Explained" »

Web Page Creation: Design, Structure, and Optimization

Computer science2.99 KB

Creating an Effective Home Page

Once you have selected the content and structure of your website, it is crucial to understand how to effectively combine text and images to create an attractive site that draws in visitors. Keep in mind that design is merely a vehicle for presenting your content, which is ultimately what matters most. Both concepts must be balanced. Avoid saying too little with poor execution or having a visually appealing design with meaningless content. You may also encounter pages overloaded with pretty pictures that take minutes to download. A page that takes longer than 15 seconds to load will likely not be very user-friendly. Visitors prefer to go elsewhere.

Reading extensive text on a computer screen is uncomfortable and...

Continue reading "Web Page Creation: Design, Structure, and Optimization" »

Essential Computer Networking Terminology and Setup

Computer science51.93 KB

Key Networking Concepts and Components

Definitions of Wireless and Wired Technologies

  • Wi-Fi: Short for Wireless Fidelity, this term names the set of protocols for wireless networking through radio frequency.
  • Bluetooth: A wireless communication protocol that uses radio frequencies and allows a range of up to 10 meters.
  • Switch: A device used in cable network connections that toggles or selects the position to prioritize information at any time, ensuring data packets reach only their intended recipient.
  • Hub: A device that allows the connection of multiple computers using a wired network. Data received are sent to all computers connected to it.
  • PCI Bus: A bus or connector device located on the motherboard. Sound cards, network cards, capture cards, TV
...
Continue reading "Essential Computer Networking Terminology and Setup" »

Television Transmission Standards and Network Protocols Explained

Computer science2.73 KB

Television Transmission and Reception

Analogue Television (TV)

Analogue TV signals are composed of video information, including synchronization and illumination lines, and the color of the points that form the images. Audio is also added. The video signal is modulated in AM, and the audio signal in FM.

Digital Television (DTV)

Digital TV signals are transmitted in binary form (digital).

Digital TV Service Models

  • DVB Model: Developed for multimedia standard definition television.
  • ATSC Model: Offers superior technical quality compared to traditional television services.
  • ISDB Model: A combination of the DVB and ATSC models.

Digital TV Transmission Techniques

  • Digital Terrestrial Television (DTT): Broadcasts over land-based transmitters.
  • Satellite Television:
...
Continue reading "Television Transmission Standards and Network Protocols Explained" »

Essential Computer Hardware and Software Components Explained

Computer science2.23 KB

Understanding Computer Hardware and Software

Hardware refers to the physical, electronic components of a computer that you can touch. Software is the general term used to describe all programs that run on computer hardware.

Core Hardware Components

  • Power Supply Unit (PSU): Supplies power to the computer by converting AC current to DC current. It also regulates voltage to eliminate spikes and surges.
  • Motherboard: The main printed circuit board in the computer, designed to connect all internal components together.
  • Microprocessor (CPU): An electronic circuit that processes programs, stores information, and performs calculations.
  • Chipset: A group of microcircuits that orchestrate data flow between key components, including the CPU, main memory, secondary
...
Continue reading "Essential Computer Hardware and Software Components Explained" »

JavaScript Regular Expressions and Type Conversion

Computer science7.08 KB

Introduction to Regular Expressions

A Regular Expression (often abbreviated as RegExp or regex) is a sequence of characters that forms a search pattern. This pattern can be used for text search, text replace, and data validation operations.

In JavaScript, regular expressions are objects. You can create a RegExp object in two ways:

  • Using a RegExp Literal (Recommended): The pattern is enclosed between forward slashes.
    const regex = /pattern/modifiers;
  • Using the RegExp Constructor:
    const regex = new RegExp('pattern', 'modifiers');
    

RegExp Modifiers and Flags

Modifiers change how a regular expression searches text. They are appended to the end of the regex literal (e.g., /abc/g) or passed as the second argument to the constructor.

ModifierDescription
iCase-
...
Continue reading "JavaScript Regular Expressions and Type Conversion" »

Understanding Computer Output Devices and Printing Technology

Computer science3.64 KB

Output Devices

Dot Matrix Printers

Dot matrix printers are known for their ability to handle continuous forms and harsh environments.

Advantages

  • Can print long jobs.
  • Inexpensive to maintain.
  • Can work in dirty atmospheres.
  • Can print different characters.

Disadvantages

  • Expensive to purchase.
  • Noisy operation.
  • Poor quality printing.

Inkjet Printers

Inkjet printers are made up of a print head, ink cartridge, motor, and paper feed mechanism.

General Printer Operation

The following steps describe how a typical printer processes a job:

  1. Data is sent to the printer driver via USB.
  2. The data is converted into a form the printer understands.
  3. The system checks whether the job is able to be printed.
  4. The printer receives data in the printer buffer (temporary memory), allowing
...
Continue reading "Understanding Computer Output Devices and Printing Technology" »

Common C++ Programming Errors and Memory Pitfalls

Computer science6.93 KB

L-Values, R-Values, and Stack Variables

An l-value can be modified, while an r-value cannot be accessed again. Additionally, a stack variable is destroyed when it is popped from the stack.

Container Errors and Undefined Behavior

std::list Indexing Error

Code:

list<int> li;
li.push_front(5);
cout << li[1] << endl;

Error: The subscript operator or function is not defined for this type. std::list does not have a [] operator because it does not support random access.

std::vector Out-of-Bounds Access

Code:

vector<string> v;
string h = "hello";
v[0] = h;
cout << v[0] << endl;

Error: Indexing out of the bounds of the container. Since the vector is empty, this behavior is undefined.

Pointer and Reference Pitfalls

Uninitialized

...
Continue reading "Common C++ Programming Errors and Memory Pitfalls" »

Understanding Semantics and Characteristics of Programming Languages

Computer science2.46 KB

Semantics in Programming

Semantics indicate the meaning of the code, specifically:

  • What the code will actually do
  • Can we effectively define this in a formal way?

In essence, semantics refers to the meaning of a statement.

Characteristics of Effective Programming Languages

  1. Clarity, Simplicity, and Unity

    A programming language should be clear and simple, enabling users to understand it easily. Unity contributes to understandability.

  2. Orthogonality

    This term refers to the ability to combine various features of a language in all possible combinations, with each combination being meaningful. For example, if a language provides an expression that can produce a value and a conditional statement that evaluates an expression to yield a true or false result, these

...
Continue reading "Understanding Semantics and Characteristics of Programming Languages" »

Object-Oriented Data Encapsulation & Types

Computer science2.63 KB

Chapter 1: Foundations of Object-Oriented Programming

Data Encapsulation with Classes

The starting point of object-oriented programming is to provide a more faithful implementation of the notion of “type” in programming. The programming languages we are familiar with come with standard built-in types that we can assign to variables and values:

Built-in Programming Types

  • In C, we can use int, float, double, char, etc.
  • In Haskell, similarly, we can use Int, Float, Char, Bool, etc.

In addition, programming languages provide a way to assign a single name to a collection of values of the same type. The nature of this collection is determined by the underlying architecture assumed by the programming language.

Collections and Data Structures

Arrays in
...
Continue reading "Object-Oriented Data Encapsulation & Types" »