Write one difference between Linear Search and Binary Search.

Short Answer
Views 13

Answer:

Difference between Linear Search and Binary Search:

  • Linear Search:
    Searches each element of the list one by one sequentially until the target is found. It works on both sorted and unsorted lists.

  • Binary Search:
    Searches by repeatedly dividing the sorted list in half and comparing the target with the middle element. It works only on sorted lists and is more efficient than linear search.

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.