Deck 18: Searching and Sorting
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/19
العب
ملء الشاشة (f)
Deck 18: Searching and Sorting
1
What is the efficiency of linear search
A) O(1).
B) O(log n).
C) O(n).
D) O(n2).
A) O(1).
B) O(log n).
C) O(n).
D) O(n2).
C
2
The merge sort algorithm sorts an array by splitting it into two equal-sized subarrays,sorting each subarray and merging them in one larger array.
True
3
The Big O Notation measures the average case run time of an algorithm.
False
it measures the worst case run time of an algorithm.
it measures the worst case run time of an algorithm.
4
What is the efficiency of selection sort
A) O(n2)
B) O(n log n)
C) O(n)
D) O(1)
A) O(n2)
B) O(n log n)
C) O(n)
D) O(1)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
5
O(1)means that the algorithm has a constant run time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
6
Linear search is faster and more complex than the binary search.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
7
Searching data involves determining whether a search key is present in the data and,if so,finding its location.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
8
A linear search algorithm will always search each and every element.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
9
Insertion sort is a simple and inefficient algorithm.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
10
If the search key is not in an array of 10 elements,how many comparisons must the linear search algorithm make
A) 0
B) 10
C) 9
D) 5
A) 0
B) 10
C) 9
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
11
What is the term used for binary search's run time
A) Linear run time.
B) Quadratic run time.
C) Constant run time.
D) Logarithmic run time.
A) Linear run time.
B) Quadratic run time.
C) Constant run time.
D) Logarithmic run time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
12
The selection sort is a simple and efficient algorithm.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
13
After the ith iteration of an ascending order selection sort,the smallest i items of the array will be sorted in increasing order in the first i elements of the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
14
What is the efficiency of merge sort
A) O(log n)
B) O(n)
C) O(n log n)
D) O(n2)
A) O(log n)
B) O(n)
C) O(n log n)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of the following is a negative aspect of binary search
A) It requires significantly more memory than linear search
B) It is slower than linear search
C) The data must be in sorted order
D) None of the above
A) It requires significantly more memory than linear search
B) It is slower than linear search
C) The data must be in sorted order
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
16
How much faster is the insertion sort with a 15-element array than with a 60-element array
A) 60 times
B) 4 times
C) 15 times
D) 16 times
A) 60 times
B) 4 times
C) 15 times
D) 16 times
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
17
What does the first pass of selection sort do
A) Splits the array into two approximately equal pieces.
B) Orders the first two elements of the array.
C) Partitions the array into two unequal pieces depending on whether each element in the array is greater or less that some pivot element.
D) Locates the smallest element in the array and swaps it into the zeroth position.
A) Splits the array into two approximately equal pieces.
B) Orders the first two elements of the array.
C) Partitions the array into two unequal pieces depending on whether each element in the array is greater or less that some pivot element.
D) Locates the smallest element in the array and swaps it into the zeroth position.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
18
At the ith iteration of the insertion sort algorithm,the array will be sorted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following sorting algorithms is the fastest when sorting a large array
A)Selection sort
B)Insertion sort
C)Merge sort
D)They all run at roughly the same speed
A)Selection sort
B)Insertion sort
C)Merge sort
D)They all run at roughly the same speed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck