Notes, summaries, assignments, exams, and exercises for Computer science for Baccalaureate

C++ Standard Library Data Structures and Algorithms

Computer science146.78 KB

C-Style Arrays

In stack: int a[3] = {0, 1, 2};

In heap: int* b = new int[3];

Sorting

std::sort(myvector.begin(), myvector.end());

Example 2: std::sort(myvector.begin(), myvector.end(), myCompFunction);

mylist.sort() or mylist.sort(compare_nocase);

bool compare_nocase(const std::string& first, const std::string& second) { return first < second; }

Templated Classes

Include template <typename T> above the header.

Each function has a template declaration:

template <typename T>
class_name<T>::getmax () {
  // ...
}

typedef list_iterator iterator;

Strings

str.substr(3, 5) (starts at position 3, length 5)

str1.compare(str2) != 0

str.length()

Lists

iterator insert(iterator position, const value_type& val); (returns pair)

Maps

std::map&

...
Continue reading "C++ Standard Library Data Structures and Algorithms" »

JavaScript Calculator

Computer science292 bytes

Instructions:

  1. Refer to the files using a relative path.
  2. Save all files, including the HTML file, before using this feature.

Value 1


Value 2


Add Minus Divide Multiply


Submit


CPU Architecture and Computer Memory Systems

Computer science3.16 KB

Intel Pentium Processors and CPU Sockets

Intel Pentium processor: The processor is placed and secured into a compatible CPU socket found on the motherboard. Processors produce heat, so they are covered with a heat sink to keep them cool and running smoothly.

The CPU chip is usually in the shape of a square or rectangle and has one notched corner to help place the chip properly into the CPU socket. On the bottom of the chip are hundreds of connector pins that plug into each of the corresponding holes in the socket. Intel and AMD have also experimented with slot processors that were much larger and slid into a slot on the motherboard. Also, over the years, there have been dozens of different types of sockets on motherboards. Each socket only supports...

Continue reading "CPU Architecture and Computer Memory Systems" »

Mobile Technology Integration in Modern Classrooms

Computer science3.06 KB

Benefits of Mobile Technology in Education

Statistics concluded that 20% of laptops will be mobile in the next 10 years. 40% of children aged 6-8 years old have used a smart device. Smart devices allow access to large amounts of information and feature quick boot times, wireless capabilities, portability, and long battery life.

Desktop vs Mobile Devices: A Comparison

Although mobile is continuously increasing its capabilities, it still has limits when using intense resource applications (e.g., AutoCAD).

Mobile Devices

  • Instant on
  • Portable
  • Longer battery life
  • Built-in cameras, video cameras, and microphones
  • Touch-enabled, engaging content
  • Wireless capabilities

Desktop and Laptop Computers

  • More storage and more processing power
  • Larger screen and full keyboard
  • Easier
...
Continue reading "Mobile Technology Integration in Modern Classrooms" »

Disney Transport Layer: Understanding Network Communication

Computer science4.2 KB

Disney Transport Layer Considerations

The transport layer is the heart of the whole hierarchy of protocols.

Function: To provide efficient, reliable, and economic data transport processes for the application layer, regardless of the physical network or networks.

There are two types of service: connection-oriented and connectionless.

If there is an error in the lower layers, where n can be controlled at higher x, the error is corrected at the transport layer.

  • Disorders
  • Duplication
  • Loss

Causes of errors:

  • Cable errors
  • Interference
  • Inadequate blockade operation

Functions in the Transport Layer

  • End-to-end reliable communication
  • Error control
  • Flow control
  • Multiplexing of several connections

Origin and destination communicate through a network. The transport layer...

Continue reading "Disney Transport Layer: Understanding Network Communication" »

Core Networking Concepts: TCP/IP, Routers, and DNS

Computer science4.44 KB

TCP/IP Protocol Suite Characteristics

  • Based on open and free protocols and standards.
  • Provides software and hardware independence.
  • Uses a common addressing scheme allowing any TCP/IP device to locate another anywhere on the network.
  • Includes high-level, standardized protocols supporting widely available and consistent user services.
  • Acts as a de facto standard for networking.
  • Allows the interconnection of networks with diverse features and technologies.

Internet Protocol Family Fundamentals

The Internet protocol family, commonly known as TCP/IP, is a set of network protocols fundamental to the Internet, enabling data transmission between computer networks. Examples include HTTP, ARP, Telnet, and POP.

Understanding Routers and Their Function

Routers are...

Continue reading "Core Networking Concepts: TCP/IP, Routers, and DNS" »

Essential IT Project Management Frameworks and Practices

Computer science8.73 KB

Waterfall Model Phases and Deliverables

The Waterfall model follows a sequential process where each phase must be completed before the next begins. Deliverables serve as proof of completion:

  • Requirements: Requirements Specification document
  • Design: System/architecture design document
  • Implementation: Working source code
  • Testing: Test report
  • Deployment: Live released system
  • Maintenance: Bug-fix and update log

Scrum Sprint Plan (2-Week Sprint)

Sprint Goal: Deliver a working login and registration feature.

User Stories:

  1. As a user, I can register with email and password.
  2. As a user, I can log in.
  3. As a user, I can reset my password.

Daily Standup: Every day at 10:00 AM for 15 minutes. The sprint concludes with a review and retrospective.

Kanban Board Structure

Columns:

...
Continue reading "Essential IT Project Management Frameworks and Practices" »

Software Testing Levels: Integration, Functional, and System

Computer science7.41 KB

Integration Testing Essentials

Integration Testing is the second level of software testing, performed immediately after Unit Testing. In this phase, individual software modules or units that have already been tested in isolation are combined and tested as a group.

While unit testing answers the question, "Does this single component work?" integration testing answers, "Do these components work together smoothly when combined?"

Why is Integration Testing Needed?

Even if every individual function or module passes its unit tests with 100% accuracy, they can still fail when put together. Integration testing is crucial because:

  • Data Incompatibility: One module might output data in a format or structure that the receiving module does not expect.
  • Interface
...
Continue reading "Software Testing Levels: Integration, Functional, and System" »

ECSE 427 Operating Systems Final Exam Cheat Sheet

Computer science4.38 KB

ECSE 427 Final Exam Cheat Sheet

Process Management

  • Fork: Each fork() creates a new process (2^n processes after n forks).
  • Fork Output: for(i=0; i<3; i++) fork(); printf("hello\n"); prints "hello" 8 times (2^3).
  • Child/Parent Sharing: Only code, static data, and disk content are shared; heap, stack, and registers are copied.
  • Process vs. Thread Switch: Process switching is more expensive due to address space switches, TLB flushes, and cache pollution.
  • Multithreading Benefits: Even on single-core CPUs, threads are useful for blocking I/O operations.
  • Trap Steps:
    • Hardware: Save state → Change to kernel mode → Jump to trap handler.
    • OS: Identify cause → Handle trap → Return to user mode.

Memory & Paging

  • Address Translation (Virtual → Physical)
...
Continue reading "ECSE 427 Operating Systems Final Exam Cheat Sheet" »

Core Principles of Computer Networking and Architecture

Computer science2.85 KB

Internet and Computer Networks

  • The Internet is a network of interconnected networks, linked by routers that forward data packets.
  • Computer networks consist of:
    • Intermediary devices (e.g., routers, switches)
    • Network media (e.g., cables, wireless signals)
    • End devices (hosts) that serve users

Network Documentation

  • Networks are represented using topology diagrams:
    • Physical topology – shows actual hardware connections
    • Logical topology – shows data flow and addressing
  • Logical topology diagrams indicate:
    • Devices, media, ports, and addressing schemes

Layered Network Architecture

  • Ensures interoperability between networks with different technologies.
  • The TCP/IP model is the practical standard, while the OSI model is used for reference.
  • Layers break down networking
...
Continue reading "Core Principles of Computer Networking and Architecture" »