Algorithms - Discrete Mathematics Questions and Answers - Sanfoundry
Algorithms - Discrete Mathematics Questions and Answers - Sanfoundry
Algorithms
« Prev Next »
This set of Discrete Mathematics Multiple Choice s & Answers (MCQs) focuses on “Algorithms”.
View Answer
Answer: b
Explanation: By the de nition of an algorithm.
advertisement
BYJU'S
Best Science Learning App
View Answer
Answer: d
Explanation: All the others are the properties of algorithms.
View Answer
Answer: b
Explanation: In linear or sequential search entire list is searched sequentially for x.
4. If the entire list is searched sequentially without locating x in linear search, the solution is
__________
a) 0
b) -1
c) 1
d) 2
View Answer
Answer: a
Explanation: If the element is not found in the entire list, then the solution is 0.
5. To sort a list with n elements, the insertion sort begins with the __________ element.
a) First
b) Second
c) Third
d) Fourth
View Answer
Answer: b
Explanation: The insertion sort compares the second element with the rst element to start
sorting.
advertisement
How to Install Unity on Ubuntu 1…
6. __________ comparisons required to sort the list 1, 2, 3…….n using insertion sort.
a) (n2 + n + 2) / 2
b) (n3 + n – 2) / 2
c) (n2 + n – 2) / 2
d) (n2 – n – 2) / 2
View Answer
Answer: c
Explanation: 2+3+4+….6n = (n2 + n – 2) / 2.
View Answer
Answer: d
Explanation: The Worst case occur in linear search algorithm when Item is the last element in the
array or is not there at all.
View Answer
Answer: b
Explanation: The selection sort begins with nding the least element in the list. This element is
moved to front and then the least element among the remaining elements. Is found and put into
the second position and so on.
View Answer
Answer: d
Explanation: The operation of processing each element in the list is known as Traversal.
advertisement
10. The complexity of Bubble sort algorithm is _________
a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)
View Answer
Answer: c
Explanation: The complexity of Bubble sort algorithm is O(n2).
To practice all areas of Discrete Mathematics, here is complete set of 1000+ Multiple Choice
Questions and Answers.
Participate in the Sanfoundry Certi cation contest to get free Certi cate of Merit. Join our social
networks below and stay updated with latest contests, videos, internships and jobs!
advertisement
Recommended Posts:
1. C Programming Examples on Numerical Problems & Algorithms
2. C++ Programming Examples on Hard Graph Problems & Algorithms
3. C Programming Examples on Set & String Problems & Algorithms
4. C++ Programming Examples on Computational Geometry Problems & Algorithms
5. Java Programming Examples on Computational Geometry Problems & Algorithms
6. C Programming Examples on Computational Geometry Problems & Algorithms
7. C Algorithms, Problems & Programming Examples
8. C++ Programming Examples on Graph Problems & Algorithms
9. Java Programming Examples on Graph Problems & Algorithms
10. Java Algorithms, Problems & Programming Examples
11. C Programming Examples on Graph Problems & Algorithms
12. Discrete Mathematics Questions and Answers
13. Data Structures & Algorithms II – Questions and Answers
14. C# Programming Examples on Sorting
15. C++ Programming Examples on Combinatorial Problems & Algorithms
16. Discrete Mathematics Questions and Answers – Transpose of Matrices
17. Database Questions and Answers – Sorting
18. Quicksort Multiple Choice Questions and Answers (MCQs) – 1
19. C++ Algorithms, Problems & Programming Examples
20. C++ Program to Compare Binary and Sequential Search
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is
Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect
and is passionate about competency developments in these areas. He livesin
Bangalore and delivers focused training sessions to IT professionals in Linux
Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage,
Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage
Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn
Subscribe Sanfoundry Newsletter and Posts
Name*
Email*
Subscribe
About | Certi cations | Internships | Jobs | Privacy Policy | Terms | Copyright | Contact