Back to marketplace

Sortingn And Searching

No description yet. This curated deck is ready for daily study.

Total cards: 11•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (11)

#1
Front (Question)

What is a linear search most effective for?

Back (Answer)

Small or unsorted lists where simplicity is more important than speed.

#2
Front (Question)

What is the time complexity of a linear search?

Back (Answer)

O(n) — it checks each item until the target is found or the end is reached.

#3
Front (Question)

What is the time complexity of a binary search?

Back (Answer)

O(log n) — the list is halved with each step, making it much faster than linear search for large datasets.

#4
Front (Question)

What is the main drawback of binary search?

Back (Answer)

The data must be sorted beforehand — if not, it won’t work correctly.

#5
Front (Question)

What does a sort algorithm do?

Back (Answer)

It arranges data into a specific order — usually ascending or descending.

#6
Front (Question)

What are the steps of the bubble sort algorithm?

Back (Answer)

• Compare two adjacent items • Swap them if they are in the wrong order • Repeat until no swaps are needed (the list is sorted)

#7
Front (Question)

What is the worst-case time complexity of bubble sort?

Back (Answer)

O(n²) — very inefficient for large lists.

#8
Front (Question)

What are the steps of merge sort?

Back (Answer)

• Divide the list into halves • Recursively sort each half • Merge the sorted halves together

#9
Front (Question)

What is the time complexity of merge sort?

Back (Answer)

O(n log n) — efficient for large lists.

#10
Front (Question)

What are the pros and cons of merge sort?

Back (Answer)

• Pros: Fast and reliable for large lists • Cons: Uses more memory and can be harder to implement

#11
Front (Question)

Why is understanding sorting and searching algorithms important in Computer Science?

Back (Answer)

Because they are fundamental to handling data efficiently and are used in many real-world applications (e.g., search engines, databases).