Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bochoh
on Dec 14, 2019
|
parent
|
context
|
favorite
| on:
Challenging projects every programmer should try
I'd probably do a doubly linked list for the test document. Then you're looking at O(1) for operations I think.
zabzonk
on Dec 14, 2019
|
next
[–]
Not for searching. Linked lists are fine if you are at the point where you need to do an operation, but getting to that point can be expensive.
DonaldFisk
on Dec 14, 2019
|
prev
[–]
I'd strongly recommend using a gap buffer for storing the text in while it's being edited, and within reason I wouldn't worry too much about runtime performance, as any reasonable solution should be able to keep up with a user typing.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: