answersLogoWhite

0


Best Answer

LIFO

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you copy all the elements from a given stack implemented in a linked list to a new one and returns the pointer to the new stack?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How the pointer used in the linked list?

The pointer in linked list is used for traversing through the elements of the linked list. In a singly linked list, only a next pointer exits. So this pointer can be used for traversing only in one direction in the list. In case of a doubly linked list, a next and previous pointer exits. These pointers are used for traversing in both direction in the list.


What pointer type will you use to implement a heterogeneous linked list in c?

void pointer


What are the basic types of link list in java?

linear circular double linked linear double linked circular Knowing the names does not help much when your teacher will require you to actually know what the names mean. Start reading. Programming requires lots of reading.


What are generalised linked list?

A generalized linked list contains structures or elements with every one containing its own pointer. It's generalized if the list can have any deletions, insertions, and similar inserted effectively into it.


Find the highest and lowest element from a linked list?

To find the highest and lowest elements in a linked list, iterate the list and detect the highest and lowest elements. Details omitted ... list *head; /* pointer to first element */ list *temp; /* temp pointer list *high = null; /* pointer to high element */ list *low = null; /* pointer to low element */ for (temp=head; temp!=null; temp=temp->next) { /* iterate all elements */ if (temp == head ) { /* initial case */ high = low = temp; /* start accumulating results } else { /* otherwise */ if (higher(temp, high) high = temp; /* choose higher */ if (lower(temp, low) low = temp; /* choose lower */ } }

Related questions

How the pointer used in the linked list?

The pointer in linked list is used for traversing through the elements of the linked list. In a singly linked list, only a next pointer exits. So this pointer can be used for traversing only in one direction in the list. In case of a doubly linked list, a next and previous pointer exits. These pointers are used for traversing in both direction in the list.


What is link list and type of link list?

A linked list is a set of elements, usually structures, where each element contains a pointer or index to the "next" element, along with the data represented by the element.Often, the elements are allocated from the heap. Sometimes, a fixed number of elements is contained in an array. In the first case, pointers are used. In the second case, indices are used.Types of linked lists are ... In an array implementation, read pointer as index.Singly linked - there is a head pointer, and one next pointer per element. The last element's pointer is null. This type of list can be traversed in only one direction.Doubly linked - there is a head pointer, and each element contains two pointers, one to the previous element and one to the next element. This type of list can be traversed in two directions, making insertion and deletion a bit easier, at the cost of extra memory.Circularly linked - the same as Singly or Doubly linked, except that the last element's pointer points back to the first element's pointer. These types of lists are often used as queues.


What pointer type will you use to implement a heterogeneous linked list in c?

void pointer


What are the basic types of link list in java?

linear circular double linked linear double linked circular Knowing the names does not help much when your teacher will require you to actually know what the names mean. Start reading. Programming requires lots of reading.


What are generalised linked list?

A generalized linked list contains structures or elements with every one containing its own pointer. It's generalized if the list can have any deletions, insertions, and similar inserted effectively into it.


Can a linked list implemented using an array be accessed by giving the location?

A linked list implemented with an array defeats the purpose of using a linked list, which is to address the memory allocation problems associated with arrays.


32 can you create a linked list with out structure pointer?

Not in C, no.


What are the disadvantages of a linked list?

Linked lists use more memory than arrays, and finding an element in the list requires scanning the entire list instead of simply using a base pointer and index. As a result, linked lists are not well suited for data with a large number of elements. They are best used for a small number of elements that use a lot of space (relatively speaking).


Find the highest and lowest element from a linked list?

To find the highest and lowest elements in a linked list, iterate the list and detect the highest and lowest elements. Details omitted ... list *head; /* pointer to first element */ list *temp; /* temp pointer list *high = null; /* pointer to high element */ list *low = null; /* pointer to low element */ for (temp=head; temp!=null; temp=temp->next) { /* iterate all elements */ if (temp == head ) { /* initial case */ high = low = temp; /* start accumulating results } else { /* otherwise */ if (higher(temp, high) high = temp; /* choose higher */ if (lower(temp, low) low = temp; /* choose lower */ } }


Need for header node in linked list?

The utility of a header node in a linked list is to simplify the functions of adding and deleting elements in the list. If you have a pointer in memory that points to the first element, then you need to pass the address of that pointer, rather than the value of that pointer, to the routines for list manipulation, because that pointer would need to change if an element were added or deleted at the head of the list. If that pointer, however, points to a special element in the list which is actually the pointer to the head of the list, then you do not need to pass the address of the pointer - you can pass its value, and it will never change. This technique "wastes" the data portion of that first element.


What are the fields of a node in a linked list?

usually we have two fields they are data field and node i.e. pointer field.it also depends on type of linked list.the above said is for single linked list.And for double linked list it sontains three fields first pointer that pointes to previious node and data field and another pointer that point to next node


How do you check whether a linked list is circular?

A linked list is circular if the tail of the list points to the head. The easiest way to check this is to check whether the pointer of the tail is a null pointer. If it is, then the list is not circular.