Operating System Fundamentals and Linux Essentials
Operating System Concepts: Key Differences
This section outlines the differences between core operating system concepts:
- Preemptive and Non-Preemptive Scheduling
- Program and Process
- Hard Real-Time Systems and Soft Real-Time Systems
- Time Sharing and Multiprogramming
Preemptive vs. Non-Preemptive Scheduling
| Point | Preemptive Scheduling | Non-Preemptive Scheduling |
|---|---|---|
| 1 | CPU can be taken away from a running process before completion. | CPU cannot be taken away; the process runs until it finishes or waits. |
| 2 | Better response |
Essential Data Structures: Bags, Stacks, Queues, and Big O
Fundamentals of Data Structures and OOP
Data Structures (DS): Methods for storing and managing data efficiently so it can be reused.
Examples of Data Structures:
- Lists
- Queues
- Trees
- Bags
- Dictionaries
- Graphs
Object-Oriented Programming (OOP) Principles
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
Bags: Unordered Collections
A Bag is a finite collection of objects where the order of elements does not matter. Duplicates are allowed.
Examples: Shopping bags, piggy banks.
Core Bag Operations:
addremovecontainscleargetFrequencyOfisEmptytoArray
Core Algorithms in Computer Graphics: Clipping, Drawing & Displays
Cohen-Sutherland Line Clipping Algorithm
What is the Cohen-Sutherland Algorithm?
The Cohen–Sutherland algorithm is a line clipping method used to clip a line segment against a rectangular clipping window. It divides the area around the window into regions and assigns a 4-bit region code (Outcode) to each endpoint of the line.
Algorithm Steps
Assign 4-bit codes to each endpoint. Each bit represents a position relative to the window:
- Bit 1: Top
- Bit 2: Bottom
- Bit 3: Right
- Bit 4: Left
For example:
0000→
C# Programming Fundamentals: Arrays, Loops, and Decisions
Life Expectancy Analysis with Parallel Arrays
This exercise demonstrates the use of parallel arrays to store and process life expectancy data by gender.
Instructions
- Create four parallel arrays containing the life expectancy data as shown in Table 1.
- Iterate through the parallel arrays to count and display a list of country names where the life expectancy for both genders exceeds 80 years.
- Prompt the user to input a country code.
- Use a loop to display the country name and life expectancies for males,
Essential OS and Computer Networking Lab Exam Q&A
Operating System (OS) Lab Questions
Basic OS Concepts
What is an Operating System (OS)?
→ It is system software that acts as an interface between the user and the hardware.
What are the main functions of an OS?
→ Process management, memory management, file management, I/O management, and security.
What is a process?
→ A program in execution.
Difference between process and program?
→ A program is passive (stored on disk); a process is active (in execution).
What is a thread?
→ A lightweight process;
Essential Python and Command Line Programming Concepts
Essential Command Line Tools
Terminal Commands
mkdir: Creates a new directory.pwdorcd(orchdir): Shows the current working directory.- Changing Directory Example: To change the current directory to the ‘SI206’ folder (if you are currently in its parent folder, ‘Fall22’), use
cd SI206.
Git Commands (Version Control)
git clone url: Copies a repository to your local computer.git status: Shows what has changed and what is staged for commit.git add file: Adds a specific file to the staging area for the
