मराठी

How is linear search different from binary search?

Advertisements
Advertisements

प्रश्न

How is linear search different from binary search?

फरक स्पष्ट करा
Advertisements

उत्तर

Basis of Difference Linear Search Binary Search
Method Checks elements one by one from the beginning. Checks the middle element and repeatedly halves the search range.
Requirement Works on sorted as well as unsorted lists. Requires the list to be sorted.
Speed Slower for large lists. Faster for large sorted lists.
Comparisons May compare every element. Makes far fewer comparisons by eliminating half the list at each step.
Best use Small or unsorted lists. Large sorted lists.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 5: Liner List Manipulation - EXERCISE [पृष्ठ १०४]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
पाठ 5 Liner List Manipulation
EXERCISE | Q 8. | पृष्ठ १०४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×