AS Level Computer Science: CPU and Data Structures
34 Questions
1 Views

AS Level Computer Science: CPU and Data Structures

Created by
@ClearedBambooFlute

Questions and Answers

What should the pop() function return when the stack is empty?

  • 0
  • The current top index
  • The last item added
  • -1 (correct)
  • In the reverse function, which operation is performed to add each character of the name to the stack?

  • append()
  • push() (correct)
  • insert()
  • enqueue()
  • What variable accumulates the reversed name in the reverse function?

  • reverseString
  • reversedCharacters
  • reverseName (correct)
  • nameReversed
  • What operation would typically be performed after all characters have been pushed onto the stack in the reverse function?

    <p>pop()</p> Signup and view all the answers

    Which of the following best describes the final output of the reverse function when given the name 'Jack'?

    <p>'kcaJ'</p> Signup and view all the answers

    What describes how a queue operates?

    <p>First In First Out</p> Signup and view all the answers

    What is the result of performing the following operations on the queue: enqueue('Charlie'), dequeue(), enqueue('Ling'), dequeue(), enqueue('Sara') with initial queue contents: Alex, Kofi, Ben, Sundip, Tom?

    <p>Ben, Sundip, Tom, Ling, Sara</p> Signup and view all the answers

    What operation removes the last element added to a stack?

    <p>pop()</p> Signup and view all the answers

    What does the 'top' variable represent in a stack implementation?

    <p>The last item inserted into the stack</p> Signup and view all the answers

    What will the pop() operation return if the stack is empty?

    <p>-1</p> Signup and view all the answers

    Which of the following statements about queues is correct?

    <p>Elements are processed in the order they are added.</p> Signup and view all the answers

    Which operation cannot be performed on a queue?

    <p>push()</p> Signup and view all the answers

    What is the primary difference between a queue and a stack?

    <p>A queue is FIFO while a stack is LIFO.</p> Signup and view all the answers

    Which factor primarily affects the speed at which a CPU processes information?

    <p>Clock speed</p> Signup and view all the answers

    What role does cache size play in CPU performance?

    <p>It minimizes the time needed to access frequently used data.</p> Signup and view all the answers

    Which of the following is NOT a characteristic of a CPU core?

    <p>It always consumes the same power regardless of workload.</p> Signup and view all the answers

    How does multi-threading enhance a CPU's performance?

    <p>It enables simultaneous execution of multiple threads.</p> Signup and view all the answers

    When exporting a video, which aspect of the CPU's performance is crucial for speed?

    <p>Efficient instruction execution</p> Signup and view all the answers

    What is the impact of thermal management on CPU performance?

    <p>Overheating can cause the CPU to throttle and reduce its speed.</p> Signup and view all the answers

    In the context of video rendering, which CPU feature can enhance processing capability?

    <p>Hyper-threading technology</p> Signup and view all the answers

    What is a likely consequence of insufficient cache memory in a CPU during video rendering?

    <p>Higher latency in accessing data from RAM.</p> Signup and view all the answers

    What is one key difference between packet switching and circuit switching?

    <p>Packet switching allows multiple users to share the network resources simultaneously, while circuit switching allocates a dedicated channel.</p> Signup and view all the answers

    Why is packet switching often preferred over circuit switching in computer networks?

    <p>Packet switching can dynamically allocate bandwidth as needed, preventing wasted resources.</p> Signup and view all the answers

    Which characteristic benefits a peer-to-peer network as opposed to a client-server network?

    <p>In peer-to-peer networks, each device can act as both a client and a server.</p> Signup and view all the answers

    Which of the following is a disadvantage of using a client-server network?

    <p>The network's performance can be heavily reliant on the server's capacity.</p> Signup and view all the answers

    When discussing network types, what is generally a characteristic of a peer-to-peer network?

    <p>It allows for individual devices to connect and communicate directly without a dedicated server.</p> Signup and view all the answers

    What is the primary function of a primary key in a database table?

    <p>To uniquely identify each record in the table</p> Signup and view all the answers

    Which of the following statements correctly defines a foreign key?

    <p>It links to the primary key in another table.</p> Signup and view all the answers

    In the order table, which field acts as a foreign key?

    <p>ProductID</p> Signup and view all the answers

    Why might CustomerID not be a suitable primary key in the order table?

    <p>Customers can place multiple orders.</p> Signup and view all the answers

    What can be inferred about a customer placing an order?

    <p>Each order can include multiple products.</p> Signup and view all the answers

    Which of the following describes the relationship between Customers and Orders?

    <p>One customer can have multiple orders.</p> Signup and view all the answers

    If a customer wants to order the same product several times, what does that imply about the order system?

    <p>Products can be ordered multiple times within a single order.</p> Signup and view all the answers

    What is one significant characteristic of the Order table based on the provided information?

    <p>Every order is tied to both a customer and a product.</p> Signup and view all the answers

    Study Notes

    Exam Information

    CPU Performance Factors

    • Performance of a CPU can be affected by clock speed and cache size.
    • Higher clock speed results in faster processing capabilities.
    • Larger cache size improves access to frequently used data, reducing latency.

    Queue Data Structure

    • A queue follows the First In First Out (FIFO) principle.
    • Initial queue: Alex, Kofi, Ben, Sundip, Tom.
    • After operations (enqueue "Charlie", dequeue, enqueue "Ling", dequeue, enqueue "Sara"):
      • Final queue contents: Kofi, Ben, Sundip, Tom, Ling, Sara.

    Stack Data Structure

    • A stack operates under Last In First Out (LIFO) principle.
    • Variables used in a stack implementation:
      • items: array storing data.
      • top: index of the last inserted item.
    • Pseudocode for pop() operation checks if the stack is empty and returns appropriate values.

    Function to Reverse Name

    • A function called reverse utilizes a stack to reverse a string.
    • push() adds each character of the input string to the stack.
    • pop() retrieves characters in reverse order to construct the reversed string.

    Entity Relationship Diagram

    • Illustrates relationships between Product, Customer, and Order entities.
    • A customer can place multiple orders, and a single product can appear in various orders.

    Keys in Database Tables

    • Primary Key: Unique identifier for a record in a table.
    • Foreign Key: A field in one table that links to the primary key of another table.
    • Example of a foreign key in the order table: CustomerID or ProductID.

    Networking Concepts

    • Packet Switching: Data is broken into packets and transmitted separately, allowing efficient use of network resources.
    • Circuit Switching: A dedicated communication path is established for the duration of the transmission.
    • Advantage of packet switching in computer networks: More efficient use of bandwidth, better fault tolerance, and dynamic routing capabilities.

    Setting Up Networks

    • Peer-to-peer networks allow direct communication between devices without a centralized server.
    • Client-server networks utilize a centralized server to manage resources and provide services to clients.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Prepare for the AS Level Computer Science exam with this quiz focusing on CPU performance factors and data structures including queues and stacks. Test your knowledge on the fundamental principles of FIFO and LIFO, as well as the impact of clock speed and cache size on CPU performance.

    Use Quizgecko on...
    Browser
    Browser