|
|
|
|
|
by quchen
4607 days ago
|
|
Yes. oneTwo = 1 : 2 : oneTwo
is a circular singly-linked list containing 1 and 2. If you wanted to change the 1 to a 4 though, you would not be able to do so without creating an entire new list. You can use Vector or Array (i.e. fixed-size containers) to make yourself a circular buffer, but the implementation will be very similar to what you would do in C. |
|
Seriously: sometimes things are hard because you don't know the language all that well. Consider that possibility.