Content deleted Content added
→Example problems not solvable by one-pass algorithms: typo fix: 'is'->'as' |
Find the ''n''th element from the end is not possible in a single pass. in a list of k elements there will be 2k-n reads which is >1 pass |
||
Line 17:
Given any list as an input:
* Count the number of elements.
* Find the ''n''th element (or report that the list has fewer than ''n'' elements).▼
Given a list of numbers:
Line 32 ⟶ 30:
==Example problems not solvable by one-pass algorithms==
Given any list as an input:
▲* Find the ''n''th element from the end (or report that the list has fewer than ''n'' elements).
* Find the middle element of the list.
|