circular-list

    1熱度

    2回答

    我有以下代碼: int InsForward (TL2 p, void* x){ /* Inserta a node a step forward from the supplied p*/ TL2 h = (TL2)calloc(1,sizeof(TCel2)); if (!h) return 0; h->pre = p->pre; h->nxt= p; p->pre =

    0熱度

    1回答

    我有以下代碼:(禮貌阿明) int InsForward (TL2 p, void* x){ /* Inserta a node a step forward from the supplied p*/ TL2 h = (TL2)calloc(1,sizeof(TCel2)); if (!h) return 0; h->pre = p; //sets h previous to

    5熱度

    3回答

    我正在使用基於CL的音樂作品的可視化編程環境。我試圖創建一個函數,當給定說3個元素(1 2 3)將返回1,2,3,1,2,3等,每次評估時的一個數字。這本書Common Lisp一個溫柔的介紹,簡單地提到可以使用尖銳的平等符號創建循環列表,但沒有詳細說明如何使用它們。請記住,我可以使用專門爲此設計的對象在程序中插入實際的Lisp代碼。

    1熱度

    1回答

    def delete_node(head, value): p=head if p is None: return None while p.value!=value: p=p.next if p.next is head and p.value!=value: return head p.value=p.n

    0熱度

    3回答

    我必須移動鏈接列表中一個位置左側的所有標記。 這裏是我的方法的代碼:當我調用該方法在運行時出現 private LLNode<E> head; // the first node in the list private LLNode<E> tail; // the last node in the list public void shiftLeft() { LLNode<E

    1熱度

    3回答

    我一直試圖通過調整我的add()和remove()方法,使我的單鏈表成爲雙圓形。 這裏是我的代碼: private LLNode<E> head; // the first node in the list private LLNode<E> tail; // the last node in the list // Adds the specified new item to the

    0熱度

    1回答

    我很好奇,以瞭解如何將多個int添加到java中的LinkedList中的節點(單個循環)。我在SO上發現了一個線程,並正在閱讀它,但並不確定它是如何工作的。以爲我會重新提出這個問題,看看我能否得到答案。 這是我的節點類 public class LinkedList{ private class Node{ private int pid; private int time

    1熱度

    2回答

    我有一個基本的鏈表問題,我試圖在下面解決。我會很感激我的方法的任何投入,算法的正確性(甚至編碼風格)。該問題需要一個函數,該函數刪除循環鏈表中所有出現的int,並返回列表中的任何節點或NULL(當列表爲空時)。 這裏的一些C++代碼,我到目前爲止有: struct Node{ Node* next; int data; }; Node* deleteNode(Node*

    4熱度

    2回答

    要檢查光線三角形的碰撞,我們可以先看看光線是否與三角形的平面發生碰撞。如果是這樣,我們然後檢查交點是否位於所有三角形的同一側。如果屬實,這意味着該點位於三角形內部。此過程類似於矩形和其他凸形圖形。 這是屬於矩形(逆時針排序)頂點的列表: vertexes = [ll, lr, ur, ul] ,我想生成與它的一切方面的列表;也就是說,所有相鄰的一對頂點: vertexPairs = [(ll,

    2熱度

    3回答

    我試圖實現一個處理頁面錯誤的替換算法。所以我想用malloc來創造一個循環鏈表,並即時得到以下錯誤:「sizeof' to incomplete type pageInMemory'.following的無效申請代碼: typedef struct { int use; int reference; int free; struct pag