Skip to content

Files

Latest commit

 

History

History
11 lines (6 loc) · 401 Bytes

stlSize.md

File metadata and controls

11 lines (6 loc) · 401 Bytes

Pattern: Use of list.size() instead of list.empty()

Issue: -

Description

Checking for list emptiness might be inefficient. Using list.empty() instead of list.size() can be faster. list.size() can take linear time but list.empty() is guaranteed to take constant time.

Further Reading