The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
I actually thought about doing that but I don't want to add them to standard list interfaces, just this one. I don't like putting inefficient methods on standard lists because it will encourage poor programming.
As far as adding them just to the CircularList that way, or creating ICircularList<t>, I don't really want the latter as I'd like to follow what microsoft has done (most of the time) with their list based data structures like Queue<T> and Stack<T> and just create the class itself. I can add extension methods, and I almost did, but the rest of my class is factored as partial classes - CircularList.cs, CircularList.ICollection.cs, CircularList.IList.cs, etc so I'll probably just add it like that.
I'm leaning toward PushFront/PopFront/PushBack/PopBack like STL, because it's also at least somewhat like Microsoft's pattern in .NET
I'm got an opinion. As far as I'm familiar with programming and algorithms, I think that for circular lists you still have to create your own non-generic class ICircularList<t> and implement a functionality for performing the most of circular lists operations. In this case, the using of the existing generic .NET collections is not efficient for that purpose, since it might come to be wasteful.
Here's a list of guidelines on how to implement circular lists:
First, it's not a linked list, circular or otherwise.
That would be a much different structure, with much different methods.
It's a circular buffer exposed as a IList<T>
Given your seeming confusion about that it might prompt me to rename though i'm not sure to what.
Because it's a circular buffer IList<T>, and ICollection<T> serve me fine. Sure you *can* call Insert(1, item) or RemoveAt(2) and that's not efficient, but it's no less efficient than doing it on a straight List<T> so I'm fine with it.
Also, since you've implemented the functionality required as a C#.NET class library used in your project, then you can name the class and interface such as MyProjCircularBuffer<t> and IMyProjCircularBuffer<t>.
You ask a lot of programming questions in the Lounge, and to be honest, in my opinion, they should be in the forums where others can benefit from them. The majority of members who use this site are not active participants in the Lounge.
Also, the Lounge is not for programming questions.
I know I came off as a jerk here, but it had to be said.
It's much easier to enjoy the favor of both friend and foe, and not give a damn who's who. -- Lon Milo DuQuette
I can go the .NET route that MS took and add methods like Enqueue() and Dequeue() (queue-like) but that only covers adding to the back, and removing from the front. I can add Pop() and Push() (stack-like) but that only covers adding and removing from the back.
I would have thought that Push and Pop would add and remove from the front, even if internally it's the back of your data structure.
I have one-way and two-way queues in which the elements themselves provide a queue link member (a pointer). The methods are Enq (at the back), Henq (at the front), and Deq (from the front). Also Insert (after something else) and Exq (from somewhere other than the front). There's no special method to remove from the back. If I were to add one, I would probably go with PopBack and rename Enq, Henq, and Deq to PushBack, Push, and Pop.
Oh well then:
- Feed() - growing/making the circle bigger
- Poop() - item is done with, dumping the by/used up product.
But seriously just use the names that fit the picture in your mind.
Need some inspiration? - there are many thesauri on the net. insert[^]
after many otherwise intelligent sounding suggestions that achieved nothing the nice folks at Technet said the only solution was to low level format my hard disk then reinstall my signature. Sadly, this still didn't fix the issue!