1) Which type of lists or data sets are linear searching algorithms used for? a) Unsorted lists or data sets b) Sorted lists or data sets 2) Which type of lists or data sets are binary searching algorithms used for? a) Unsorted lists or data sets b) Sorted lists or data sets 3) Select the best description to explain what a linear search algorithm is. a) Put the elements in order, check each item in turn. b) Elements do not need to be in order, check each item in turn. c) Put the elements in order, compare with the middle value, split the list in order and repeat. d) Elements do not need to be in order, compare to the middle value, split the list in order and repeat 4) Select the best description to explain what a binary search algorithm is. a) Put the elements in order, check each item in turn. b) Elements do not need to be in order, check each item in turn. c) Put the elements in order, compare with the middle value, split the list in order and repeat. d) Elements do not need to be in order, compare to the middle value, split the list in order and repeat 5) A linear search is to be performed on the list: [12 6 8 1 3]. How many comparisons would it take to find 1? a) 1 b) 3 c) 2 d) 4 6) A binary search is to be performed on the list: [3 5 9 10 23]. How many comparisons would it take to find 9? a) 0-1 b) 4-5 c) 2-3 d) I can't find 9 7) A binary search is to be performed on the list: [1 5 10 13 48 68 100 101]. How many comparisons would it take to find 101? a) -01 b) 3-4 c) 1-2 d) 4-5 8) Describe an advantage of a linear search algorithm a) Data does not need to be in order. b) Can only work on an ordered list. If unordered must use a linear search. c) Performs well over large ordered lists. d) Slow with large data sets. 9) Describe a disadvantage of a linear search algorithm a) Data does not need to be in order. b) Can only work on an ordered list. If unordered must use a linear search. c) Performs well over large ordered lists. d) Slow with large data sets. 10) Describe an advantage of a binary search algorithm a) Data does not need to be in order. b) Can only work on an ordered list. If unordered must use a linear search. c) Performs well over large ordered lists. d) Slow with large data sets. 11) Describe a disadvantage of a binary search algorithm a) Data does not need to be in order. b) Can only work on an ordered list. If unordered must use a linear search. c) Performs well over large ordered lists. d) Slow with large data sets. 12) Describe an advantage of a linear search algorithm a) If the criteria matches the last item in list, entire list has to be checked. b) Quicker than a linear search. c) Simple to code than a binary search. d) Can only work on an ordered list. If unordered must use a linear search. 13) Describe a disadvantage of a linear search algorithm a) If the criteria matches the last item in list, entire list has to be checked. b) Quicker than a linear search. c) Simple to code than a binary search. d) Can only work on an ordered list. If unordered must use a linear search. 14) Describe an advantage of a binary search algorithm a) If the criteria matches the last item in list, entire list has to be checked. b) Quicker than a linear search. c) Simple to code than a binary search. d) Can only work on an ordered list. If unordered must use a linear search. 15) Describe a disadvantage of a binary search algorithm a) If the criteria matches the last item in list, entire list has to be checked. b) Quicker than a linear search. c) Simple to code than a binary search. d) More complicated to code than a linear search.
0%
Searching Algorithms
共享
共享
共享
由
Dprice7
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?