Pearson Edexcel IGCSE · Computer Science

Algorithms: แบบฝึกหัด

ข้อปรนัย 5 ข้อ ตรวจให้ทันทีที่ตอบ และข้อเขียน 4 ข้อ พร้อมวิธีทำละเอียด ทั้งหมดจากเรื่อง Algorithms

9 ข้อ24 คะแนนฟรี ไม่ต้องสมัคร
ข้อ 1
1 คะแนน

A developer needs to search for a specific name in a sorted list of 10,000 entries. Why would they choose a binary search instead of a linear search?

ข้อ 2
1 คะแนน

How many times will the total variable be incremented in the following nested loop structure?
FOR \(i\) FROM 1 TO 4
  FOR \(j\) FROM 1 TO 3
    SET \(total\) TO \(total + 1\)
  ENDFOR
ENDFOR

ข้อ 3
1 คะแนน

Which of these is the primary purpose of using a trace table during the development of an algorithm?

ข้อ 4
1 คะแนน

What is the maximum number of comparisons a binary search algorithm would need to find a value in a sorted list of \(15\) elements?

ข้อ 5
1 คะแนน

Given the list \([5, 2, 8, 1]\), what will the list look like after the first complete pass of a standard ascending bubble sort?

ข้อ 6
3 คะแนน

State the specific requirement that must be met by a data set before a binary search algorithm can be successfully performed.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 7
5 คะแนน

A sorted list contains 1,000 items. Determine the maximum number of comparisons required to find an item using a binary search and briefly justify your answer using powers of 2.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 8
4 คะแนน

A list of 1,000 student IDs is stored in an array. The IDs are already sorted in ascending order.
(a) State which search algorithm would be more efficient to find a specific ID in this sorted list.
(b) Explain why this algorithm is more efficient than a linear search by comparing the maximum number of checks required for each method.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 9
7 คะแนน

An array contains the following sequence of integers: [12, 5, 8, 2].
(a) Show the state of the array after each complete pass of a Bubble Sort algorithm until the numbers are in ascending order.
(b) Explain why a Merge Sort is generally considered more efficient than a Bubble Sort for very large datasets.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

* เนื้อหาของ thinka สร้างโดย AI อาจไม่ถูกต้องสมบูรณ์ในทุกกรณี กรุณาใช้เป็นสื่อเสริมและตรวจสอบกับเอกสารอ้างอิงอย่างเป็นทางการ

คุณเห็นเฉลยแล้ว ทีนี้มาตรวจคำตอบของคุณบ้าง

หน้านี้บอกได้ว่าคำตอบที่ดีเป็นอย่างไร แต่บอกไม่ได้ว่าคำตอบของคุณขาดอะไร thinka ตรวจข้อเขียนของคุณตามเกณฑ์ให้คะแนนจริงในราว 15 วินาที

อยากฝึกโจทย์แบบนี้เพิ่มไหม เริ่มฝึกหัวข้อนี้ได้เลย ตรวจให้ทันทีทุกข้อ

เริ่มฝึกเลย