📚 IB Computer Science: Key Comparisons | IB 计算机:知识点对比
In IB Computer Science, distinguishing between closely related concepts is essential for tackling exam questions and writing accurate code. The following comparisons highlight core differences, practical uses and theoretical underpinnings that frequently appear across the syllabus.
在 IB 计算机科学课程中,区分相似的概念对于应对考题和编写准确代码至关重要。下文通过对比展示了关键差异、实际用途以及贯穿教学大纲的理论基础。
1. Compiler vs Interpreter | 编译器与解释器
A compiler translates the entire source code into machine code before execution, generating a standalone executable file.
编译器在执行前将整个源代码翻译为机器代码,并生成独立的可执行文件。
An interpreter, in contrast, reads and executes source code line by line without producing a separate executable, which simplifies debugging but runs more slowly.
解释器则逐行读取并执行源代码,不生成单独的可执行文件,这便于调试但运行速度较慢。
Compiled languages like C++ typically yield faster execution, while interpreted languages like Python offer greater platform flexibility and rapid development cycles.
C++ 等编译型语言通常执行更快,而 Python 等解释型语言则提供了更强的平台灵活性和更快的开发周期。
2. RAM vs ROM | 随机存取存储器与只读存储器
RAM (Random Access Memory) is volatile, meaning it loses all data when power is turned off; it serves as the working memory for the CPU, storing currently executing programs and data.
RAM(随机存取存储器)是易失性的,即断电后所有数据都会丢失;它作为 CPU 的工作内存,保存正在执行的程序和数据。
ROM (Read-Only Memory) is non-volatile and retains its contents without power; it stores firmware such as the BIOS/UEFI that is essential for booting the computer.
ROM(只读存储器)是非易失性的,断电后内容依然保留;它存储固件(如 BIOS/UEFI),是计算机启动所必需的。
Both are primary memory directly accessible by the CPU, but RAM offers read-write capability while ROM is pre-written and rarely modified.
两者都是 CPU 可直接访问的主存,但 RAM 具备读写能力,而 ROM 内容是预先写入且极少修改。
3. TCP vs UDP | 传输控制协议与用户数据报协议
TCP (Transmission Control Protocol) is connection-oriented, establishing a handshake before transmission and ensuring reliable, ordered delivery of data through acknowledgments and retransmissions.
TCP(传输控制协议)是面向连接的,在传输前通过握手建立连接,并通过确认和重传机制确保数据可靠、有序地送达。
UDP (User Datagram Protocol) is connectionless and sends packets without guaranteeing delivery, order or error recovery, making it faster and suitable for live streaming or online gaming.
UDP(用户数据报协议)是无连接的,发送数据包时不保证送达、顺序或错误恢复,因此速度更快,适合直播和在线游戏。
While TCP provides error checking and flow control, UDP sacrifices those features to achieve minimal latency and overhead.
TCP 提供错误校验和流量控制,而 UDP 则牺牲这些特性以换取最低的延迟和开销。
4. Array vs Linked List | 数组与链表
An array stores elements in contiguous memory locations and allows constant-time O(1) access via index, but its size is usually static and fixed at creation.
数组将元素存储在连续的内存位置,并支持通过索引在常数时间 O(1) 内访问,但其大小通常在创建时固定且为静态。
A linked list consists of nodes that are dynamically allocated and connected by pointers; it provides efficient O(1) insertion or deletion at known positions, but accessing an element requires O(n) time by traversing the list.
链表由动态分配并通过指针连接的节点组成;它在已知位置进行插入或删除时效率高 O(1),但访问某个元素需要遍历链表,时间复杂度为 O(n)。
Arrays are more memory-efficient with no pointer overhead, whereas linked lists use extra memory for storing references but can easily grow or shrink.
数组没有指针开销,内存效率更高;而链表虽然需要额外内存存储引用,但能够轻松地增长或缩小。
5. Stack vs Queue | 栈与队列
A stack follows a Last-In-First-Out (LIFO) principle: the last element added is the first to be removed, with operations push, pop and peek/top.
栈遵循后进先出(LIFO)原则:最后加入的元素最先被移除,操作包括压入(push)、弹出(pop)和查看顶部(peek/top)。
A queue adheres to First-In-First-Out (FIFO): elements are removed in the same order they were added, using enqueue and dequeue operations.
队列遵循先进先出(FIFO)原则:元素按照添加的顺序被移除,使用入队(enqueue)和出队(dequeue)操作。
Stacks are used for function call management, undo mechanisms and expression evaluation, while queues manage scheduling tasks, print spoolers and breadth-first search traversals.
栈用于函数调用管理、撤销操作和表达式求值;队列则管理调度任务、打印缓冲和广度优先搜索遍历。
6. White-Box Testing vs Black-Box Testing | 白盒测试与黑盒测试
White-box testing examines the internal structure and logic of the program; testers need full knowledge of the source code to design test cases that cover statements, branches and paths.
白盒测试检查程序的内部结构和逻辑;测试人员需要完全了解源代码,才能设计覆盖语句、分支和路径的测试用例。
Black-box testing focuses solely on the software’s external behaviour against specifications, ignoring the internal implementation; testers supply inputs and verify outputs without viewing the code.
黑盒测试仅关注软件的外部行为是否与规格一致,忽略内部实现;测试人员提供输入并验证输出,无需查看代码。
White-box methods include statement coverage and cyclomatic complexity, while black-box techniques involve equivalence partitioning and boundary value analysis.
白盒方法包括语句覆盖和圈复杂度;黑盒技术包括等价类划分和边界值分析。
7. Lossy vs Lossless Compression | 有损压缩与无损压缩
Lossy compression permanently discards some data to significantly reduce file size; the original data cannot be perfectly reconstructed, but the loss is often imperceptible in images and audio.
有损压缩会永久丢弃部分数据以大幅减小文件体积;原始数据无法完全还原,但这种损失在图像和音频中往往难以察觉。
Lossless compression reduces file size without any loss of information, allowing exact reconstruction of the original data; it is essential for text files, executable code and archival purposes.
无损压缩在不丢失任何信息的情况下缩小文件大小,能够精确还原原始数据;这对文本文件、可执行代码和存档用途至关重要。
Common lossy formats count JPEG and MP3, while PNG, FLAC and ZIP are typical lossless examples.
常见的有损格式包括 JPEG 和 MP3,而 PNG、FLAC 和 ZIP 则是典型无损格式。
8. LAN vs WAN | 局域网与广域网
A LAN (Local Area Network) connects computers within a limited area such as a building or campus, offering high data transfer rates and low latency; it is usually privately owned and uses Ethernet or Wi-Fi.
局域网(LAN)连接有限区域(如建筑或校园)内的计算机,提供高速数据传输和低延迟;通常为私有网络,使用以太网或 Wi-Fi。
A WAN (Wide Area Network) spans large geographic distances, interconnecting multiple LANs through routers and leased telecommunication lines; the Internet is the largest example of a WAN.
广域网(WAN)跨越广阔的地理距离,通过路由器和租用的通信线路连接多个局域网;互联网是最大的广域网实例。
LANs tend to have lower costs and are simpler to manage, whereas WANs face higher latency and rely on public or shared infrastructure.
局域网成本较低且易于管理,而广域网延迟较高并依赖公共或共享基础设施。
9. Object-Oriented vs Procedural Programming | 面向对象编程与面向过程编程
Object-oriented programming (OOP) organizes code around objects that combine data (attributes) and behaviour (methods), promoting encapsulation, inheritance and polymorphism.
面向对象编程(OOP)围绕对象组织代码,对象将数据(属性)与行为(方法)结合,促进封装、继承与多态。
Procedural programming structures code as a sequence of procedures or functions that operate on data, typically following a top-down design approach.
面向过程编程将代码构建为一系列操作数据的过程或函数,通常遵循自顶向下的设计方法。
Languages like Java and C# are object-oriented at their core, while C and Pascal exemplify procedural paradigms, though modern languages often support both styles.
Java 和 C# 等语言本质上以面向对象为核心,而 C 和 Pascal 则代表面向过程范式,尽管现代语言常同时支持两种风格。
10. CPU vs GPU | 中央处理器与图形处理器
A CPU (Central Processing Unit) is designed for sequential serial processing with a small number of powerful cores optimised for a wide variety of general-purpose tasks and low-latency execution.
CPU(中央处理器)专为串行顺序处理设计,拥有少量强大的内核,针对各类通用任务和低延迟执行进行了优化。
A GPU (Graphics Processing Unit) features hundreds or thousands of simpler cores that excel at parallel processing, making it ideal for rendering graphics and performing large-scale matrix calculations simultaneously.
GPU(图形处理器)拥有成百上千个结构更简单的核心,擅长并行处理,因此非常适合渲染图形和同时执行大规模矩阵运算。
While CPUs handle complex logic and operating system operations, GPUs accelerate tasks like machine learning, video encoding and scientific simulations through massive data parallelism.
CPU 处理复杂逻辑和操作系统操作,而 GPU 通过大规模数据并行处理加速机器学习、视频编码和科学模拟等任务。
11. ADT vs Data Structure | 抽象数据类型与数据结构
An Abstract Data Type (ADT) defines a collection of data and a set of operations on that data purely in terms of behaviour, without specifying how they are implemented.
抽象数据类型(ADT)定义了一组数据及其上的操作,仅为行为层面的描述,不规定实现方式。
A data structure is a concrete implementation that organises and stores data in memory so the operations defined by an ADT can be carried out efficiently.
数据结构是一种具体实现,在内存中组织和存储数据,以便高效执行 ADT 定义的操作。
For example, a Stack ADT only demands push, pop and isEmpty operations, but it can be implemented using either an array-based data structure or a linked-list-based one.
例如,栈 ADT 只要求实现压入、弹出和判空操作,但可以用基于数组的数据结构或基于链表的数据结构来实现。
12. Symmetric vs Asymmetric Encryption | 对称加密与非对称加密
Symmetric encryption uses a single secret key shared between sender and receiver for both encrypting and decrypting messages; it is computationally fast (e.g., AES) but faces the challenge of secure key distribution.
对称加密使用发送方和接收方共享的单一密钥来加密和解密消息;计算速度快(如 AES),但面临密钥安全分发的问题。
Asymmetric encryption employs a key pair — a public key for encryption and a private key for decryption — eliminating the need to share a secret key; however, it is significantly slower (e.g., RSA).
非对称加密使用密钥对——公钥用于加密,私钥用于解密——无需共享秘密密钥;但计算速度明显较慢(如 RSA)。
In practice, hybrid systems combine both: asymmetric encryption secures the exchange of a symmetric session key, which then encrypts the bulk data.
实践中采用混合系统:用非对称加密安全交换对称会话密钥,再用该密钥加密大规模数据。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导