en
th
‹ set
01
Get the first element
1 / 26
read the snippet · pick its Big-O
1
function
head
(
arr
)
{
2
return
arr
[
0
]
;
3
}
O(1)
O(log n)
O(n)
O(n log n)
O(n²)
O(n³)
O(2^n)
O(n!)
⏵ submit
next · Cache hit check before a slow API call ›