menu_book Course Curriculum (Data Structures & Algorithms) expand_more
Complexity & Foundations
Arrays & Strings
Linked Lists
Stacks & Queues
Hashing
Trees & Heaps
Graphs
Longest increasing subsequence
Learn Longest increasing subsequence in Data Structures & Algorithms with a focused explanation, a topic-specific example, edge guidance, and a mastery check.
12 min read
•
Advanced
data-structures-algorithms-080.py
python
from bisect import bisect_left
tails=[]
for x in [10,9,2,5,3,7,101,18]:
i=bisect_left(tails,x)
if i==len(tails):tails.append(x)
else:tails[i]=x
print(len(tails),tails)
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content