wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Cấu trúc dữ liệu - Sắp xếp

Total questions: 19

Worksheet time: 14mins

Name
Class
Date
1.

Thuật toán sắp xếp là gì?

a)

Thuật toán sắp xếp chỉ dùng cho số nguyên

b)

Thuật toán sắp xếp là một phương pháp để sắp xếp các phần tử trong một tập hợp theo một thứ tự nhất định.

c)

Thuật toán sắp xếp là một cách để ngẫu nhiên xếp các phần tử

d)

Thuật toán sắp xếp không liên quan đến việc sắp xếp

2.

Insertion sort hoạt động như thế nào?

a)

Insertion sort chỉ so sánh phần tử hiện tại với phần tử liền kề

b)

Insertion sort hoạt động bằng cách đảo ngược mảng ban đầu

c)

Insertion sort hoạt động bằng cách lặp qua mảng từ trái sang phải, so sánh mỗi phần tử với các phần tử bên trái của nó, và chèn nó vào vị trí đúng trong phần đã được sắp xếp của mảng.

d)

Insertion sort không thay đổi vị trí của các phần tử trong mảng

3.

Selection sort hoạt động như thế nào?

a)

Selection sort picks elements randomly from the array

b)

Selection sort repeatedly selects the smallest element from the unsorted portion of the array and swaps it with the element at the beginning of the unsorted portion.

c)

Selection sort always swaps adjacent elements

d)

Selection sort starts from the middle of the array

4.

Merge sort hoạt động như thế nào?

a)

Merge sort works by selecting the largest element in the array and moving it to the end.

b)

Merge sort sorts the input array by repeatedly swapping adjacent elements.

c)

Merge sort randomly shuffles the input array before sorting it.

d)

Merge sort works by recursively dividing the input array into two halves, sorting each half, and then merging the sorted halves back together.

5.

Quick sort hoạt động như thế nào?

a)

Quick sort hoạt động bằng cách chọn một phần tử làm pivot, chia mảng thành 2 phần dựa vào pivot đó, và tiếp tục sắp xếp đệ quy trên 2 phần đó.

b)

Quick sort sắp xếp ngẫu nhiên các phần tử trong mảng

c)

Quick sort chia mảng thành 3 phần dựa vào pivot

d)

Quick sort chỉ hoạt động trên mảng đã sắp xếp

6.

Thuật toán nào hiệu quả hơn giữa Insertion sort và Selection sort?

a)

Merge sort

b)

Selection sort

c)

Bubble sort

d)

Quick sort

7.

Thuật toán nào hiệu quả hơn giữa Merge sort và Quick sort?

a)

Quick sort

b)

Bubble sort

c)

Selection sort

d)

Insertion sort

8.

Lợi ích của việc sử dụng Insertion sort?

a)

Insertion sort is beneficial for small data sets or nearly sorted arrays due to its simplicity and efficiency. It is also stable and in-place, meaning it does not require additional memory.

b)

Insertion sort requires additional memory and is not in-place

c)

Insertion sort is not stable and may change the order of equal elements

d)

Insertion sort is only suitable for large data sets

9.

Lợi ích của việc sử dụng Selection sort?

a)

Selection sort is the fastest sorting algorithm

b)

Selection sort requires a large amount of memory

c)

Selection sort is not stable

d)

One benefit of using Selection sort is its simplicity and ease of implementation.

10.

Lợi ích của việc sử dụng Merge sort?

a)

Not suitable for large datasets

b)

Not applicable for arrays

c)

Efficient for large datasets, stable sorting algorithm, suitable for linked lists and external sorting

d)

Unstable sorting algorithm

11.

Lợi ích của việc sử dụng Quick sort?

a)

Lợi ích của Quick sort là sắp xếp chậm hơn so với các thuật toán khác

b)

Quick sort không thể sắp xếp được các tập dữ liệu lớn

c)

Quick sort không ổn định và dễ gây lỗi

d)

Lợi ích của việc sử dụng Quick sort là thời gian chạy nhanh hơn so với các thuật toán sắp xếp khác và dễ dàng cài đặt trên các tập dữ liệu lớn.

12.

Trường hợp tốt nhất của Insertion sort là khi nào?

a)

When the input array is sorted in descending order

b)

When the input array is already sorted in ascending order

c)

When the input array has only one element

d)

When the input array is empty

13.

Trường hợp tốt nhất của Selection sort là khi nào?

a)

Khi mảng đã được sắp xếp hoặc gần như đã sắp xếp từ trước.

b)

Khi mảng chứa các phần tử trùng lặp

c)

Khi mảng chứa các phần tử ngẫu nhiên

d)

Khi mảng đã được sắp xếp ngược

14.

Trường hợp tốt nhất của Merge sort là khi nào?

a)

When the input array is reversed

b)

When the input array is partially sorted

c)

When the input array is already sorted or consists of equal elements

d)

When the input array is empty

15.

Trường hợp tốt nhất của Quick sort là khi nào?

a)

Khi mảng đầu vào được sắp xếp ngược lại

b)

Khi mảng đầu vào chứa các phần tử trùng nhau

c)

Khi mảng đầu vào được chia đều thành các phần nhỏ nhất có thể.

d)

Khi mảng đầu vào đã được sắp xếp tăng dần

16.

Trường hợp xấu nhất của Insertion sort là khi nào?

a)

Khi mảng đầu vào đã được sắp xếp theo thứ tự ngược lại

b)

Khi mảng đầu vào đã được sắp xếp ngẫu nhiên

c)

Khi mảng đầu vào chỉ chứa một phần tử

d)

Khi mảng đầu vào đã được sắp xếp theo thứ tự tăng dần

17.

Trường hợp xấu nhất của Selection sort là khi nào?

a)

Khi mảng đầu vào chỉ chứa một phần tử.

b)

Khi mảng đầu vào đã được sắp xếp ngược chiều.

c)

Khi mảng đầu vào chứa các phần tử trùng nhau.

d)

Khi mảng đầu vào đã được sắp xếp tăng dần.

18.

Trường hợp xấu nhất của Merge sort là khi nào?

a)

When the input array is already sorted

b)

When the input array contains only one element

c)

When the input array is in reverse order or nearly sorted

d)

When the input array is empty

19.

Trường hợp xấu nhất của Quick sort là khi nào?

a)

Khi mảng rỗng

b)

Khi mảng chứa các phần tử trùng nhau

c)

Khi mảng đã sắp xếp hoặc đảo ngược sắp xếp

d)

Khi mảng có kích thước lớn