answersLogoWhite

0


Best Answer

The only difference between a link list and the cursor implementation of a linked list is that the curse implementation makes it a link list with different linked node methods. A cursor implementation of linked list involves using several nodes with the "next" pointer going to the index to trigger another node in the list.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

6y ago

A linked list is a data container that defines a data sequence. The data elements of a linked list are typically stored in non-contiguous memory, thus we cannot traverse from one element to the next as we can with a dense container like an array. To keep track of an element we use a node. A node is a simple data structure with a pointer that refers to the data it is keeping track of. In some cases it may be more convenient or efficient to store the data within the node itself but in most cases we use a pointer. In addition, a node also has another pointer which refers to the next node in the sequence (or the null address if it is the last node in the sequence, the tail node). In this way we need only keep track of the head node. A node to keep track of a type T data element may be defined as follows:

struct node {

T* data; // pointer to the data element (of type T)

node* next; // pointer to next node in the sequence (if any)

};

To locate a data element we simply traverse the sequence of nodes from the head node. For example we can search for a given value as follows:

node* find (node* head, T value) {

while (head != nullptr) {

if (head->data == value) return head; // found it!

head = head->next;

}

return nullptr; // the value does not exist

}

A singly-linked list only allows forward traversal and is therefore known as a forward list. A forward list is usually optimised for short lists or lists that are frequently empty. In particular, a forward list does not maintain a count of its nodes. This allows more efficient insertion and extraction of the data elements.

A doubly-linked list is a list where every node has two links, one to the next element and one to the previous element. This time we keep track of both the head and tail and can traverse the list in both directions. A doubly-linked list is ideally suited to longer lists and will typically maintain a count of its nodes.

A circular linked list is a list where the tail node links "forwards" to the head node. Instead of keeping track of the head we keep track of the tail, because the tail gives us constant time access to the head. This then allows us to insert more efficiently at both the head and tail of the list (with a non-circular list, insertions are efficient at the head, not the tail).

If the circular linked list is doubly linked, the head also links "backwards" to the tail node thus we can either keep track of the head or the tail to keep track of both.

Inserting before the head or after the tail is a constant time operation provided we have constant time access to the head or the tail. Inserting anywhere else takes linear time because we must traverse to the insertion point. Once the insertion point is established, we simply copy the previous node's next link into the new node's next link, before replacing it with the new node's address. With doubly-linked lists, we also copy the next node's previous link into the new node's previous link, and replace it with the new node's address.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Some languages do not support pointers. Use arrays of objects instead start with a Freelist.Allocate space from Freelist when needed to delete: change pointers, add to Freelist

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Explain the Cursor implementation of linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Explain any two advantages using Single linked list over Doubly linked list and vice-versa?

Advantages of single linked list: # Decrease in storage space per linked list node # Simpler implementation Advantages of double linked list # Decrease in work when accessing a random node # Decrease in work when inserting or deleting a node


What is the difference between linked list and Ordinary list?

A list is an abstract data structure, usually defined as an ordered collection of data. A linked list refers to a specific implementation of a list in which each element in the list is connected (linked) to the next element.


Explain Pseudo code for circular linked list?

write pseudocode for link list


C program to implement deque using circular linked list?

You'll need to use a doubly-linked circular list, since otherwise when you pop off the tail element you'll need to whizz all the way round the list to find its predecessor. See the links section for an implementation of a doubly-linked circular list.


Explain the linked list and multi linked list structures?

I tried my best to explain all Linked List. For Single Linked List http://www.fansonnote.com/2012/02/single-linked-list/ For Double Linked List http://www.fansonnote.com/2012/02/double-linked-list/ For Multi Linked List http://www.fansonnote.com/2012/02/multi-linked-list/ Hope it will help. Thanks.


What is the difference between dynamic implementation and linked list implemention?

The size or length of the list. For static, the size is a constant, while the size of a dynamic list may change over time. The 7 weekdays is static (in size/length, though the content is static as well), while the questions and answers at answers.com are 2 dynamic lists (the sizes are not constants, although just growing)


What is mean linked list in java?

A LinkedList is an implementation of the List interface. It is a collection that is ordered by index position, and the elements are doubly-linked to one another. The linking allows for addition and removal of elements from beginning or end. This class, as of Java 5, also implements the java.util.Queue interface.


Convert single linked list to double linked list?

You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.


How do you implement a doubly linked list by using singly linked list?

To implement a doubly linked list using a singly linked list, you can create two nodes in each element of the singly linked list - one for the next element and another for the previous element. This way, each node will have access to both its previous and next nodes, effectively creating a doubly linked list structure using a singly linked list implementation.


Write an algorithm for the implementation of a circular doubly linked list?

Create a new node, making sure it is not allocated locally in the function and thus will not be destroyed when the function execution finishesFill in dataUse the "last node" pointer in the list and copy the "next" pointer location (pointing to the first node) into the new nodes "next" pointerSet the "last node" "next" pointer to point to the new nodeChange the list's "last node" pointer to point to the new nodeFor an example of implementation see: How_you_insert_a_newnode_in_singly_circular_link_list


What is the difference between data structure and abstract data type?

An Abstract Data Type is an interface that interacts with a data structure. A Data Structure is an implementation of the ADT. for example. If you were going to create a linked list you would create an Interface listing all the methods required by the list. Then in the linked list class you would code how the list uses these methods. Hope this helps :)


Which is the easy insertion operator single linked-list or double-linked list?

It is easier to insert into a singly linked list.