Linked-list exercise in the C++ track

Looking at the implementation status page for #48in24, I noticed that linked-list will be a featured exercise but isn’t in the C++ track. Can simple-linked-list (which the C++ track does have) work in that week?

If not, I could volunteer to work on the port of linked-list to C++, but I think we’d need to agree on the implementation requirements and desired difficulty level since that exercise is (IMHO) a prime candidate for practicing more advanced C++ topics.

  1. The problem specification involves creating a list of numbers only. Would we want to move beyond that and make the list a template?
  2. Some tracks seem to have added iterators as a requirement. Would we want that for the C++ track also? It ups the difficulty quite a bit of course.
  3. The simple-linked-list exercise has its difficulty set at 4; is that what we’d like to aim for with linked-list as well? (In retrospect that should’ve been the first question)

(Forgot to mention it, but I am currently recovering from COVID so might be slow to work on this at first; I’m still tired. If anyone was already working on this or wanted to, I can simply skip.)

So, firstly, yes. But secondly, I might ask Erik to change this and choose a different exercise as it was a real hassle for 12in23 having these two exercises that overlap.

So I’d say hold off for now?

Get well!

1 Like

Sounds reasonable. I guess it doesn’t help that some tracks renamed those exercises too.

If you need help later, just ping me :slightly_smiling_face:

1 Like

@vaeng already called dibs on linked-list,
see the TODO list for the C++ track on GitHub.

Hi there!

I started to implement linked-list and had a discussion with Siebenschläfer about it.

If you want to, you can take over. I have to check if I made more progress locally, than I pushed to the repository.

Thanks, I was looking for something like this on the forum or Discord server. Should’ve looked better. :slightly_smiling_face:

As I mentioned, I am still recovering so would only begin working on anything in a little while. If you still need help later, I can try. I’ll keep an eye on the GitHub issue!

1 Like

We’ve changed the featured exercise to nucleotide-count, due to us not wanting to do the whole “one or the other” thing :)

1 Like

I’m a little bit sad to hear that. On the C track linked-list is one of my favorite exercises to mentor because you can convince the students to go DRY and write two helper functions for adding and removing a node which makes the other functions so much simpler.

You can even discuss the benefits of using a dummy node so the insertion and deletion do have to handle empty/one-element lists as a special case.

nucleotide-count on the other hand is rather straightforward to implement (unless of course you adventure into optimization land.)

Erik was sad too. But as I don’t think all tracks want to implement both linked-list and simple-linked-list, and as featuring both doesn’t really work, I don’t see a good alternative to replacing it.

If you have a suggestion of something more interesting than nucleotide-count then I’m sure Erik would be open to discussing it though! :slight_smile:

I don’t have any better idea.

I liked that the C version was featured for this exercise because I think it could have shown C where it is typically used, low-level stuff, manipulating pointers. That’s not the case for nucleotide-count, a typical solution loops over the string, and then writes a string with the results to some dynamically allocated buffer and returns it. I’m not sure that this is where C shines. Perhaps a different language would be better suited for nucleotide-counts.

I have another idea: let’s use circular-buffer. That also includes pointers and memory allocation/free-ing. Agreed?

If so, I’ll do some shuffling in the list of exercises.

2 Likes

I’ve made the above change (using circular-buffer).

1 Like