最初のノードからのカウントとしてリスト内の場所にあるノードを削除するdelete_node関数を作成したいとします。 class node:
def __init__(self):
self.data = None # contains the data
self.next = None # contains the reference to the next n
あなたがサイズNの単一のリンクされたリストを持っていて、最後からすべての要素に対して操作を実行したいとします。 私は、次の擬似コードを作ってみた: while N > 0
Current = LinkedList
for 0 to N
Current = Current.tail
end
Operation(Current.head)