私は円形のリストを使いたいです。 自分のオプション(like this person did)を実装するのに手間がかかりますか? 具体的には、オブジェクトのリストを反復処理します。イテレータがリストの最後に到達すると、自動的に最初に戻ります。 See Vladimir's definition of a circular_iterator: "circular_iteratorは決してCircul
オブジェクトの循環リストが必要です。そして、それぞれが前も後も知っているはずです。私はこれをした: class Bus {
private Bus previous;
private Bus next;
public Bus() {
//anything
}
public void setPrevious(Bus bus) {
public void enqueue(Object element)
// Adds element to the rear of this queue.
{
LLObjectNode newNode = new LLObjectNode(element);
if (rear == null)
front = newNode;
else
rear.setLi