How will you reverse Linked List.
Answer / Sapna Rai
Here is an example of reversing a singly linked list in Python:nnclass Node:n def __init__(self, data):n self.data = datan self.next = Nonennclass LinkedList:n def __init__(self):n self.head = Nonenn def append(self, data):n if not self.head:n self.head = Node(data)n returnnn current = self.headn while current.next:n current = current.nextn new_node = Node(data)n new_node.next = self.headn self.head = new_node
| Is This Answer Correct ? | 0 Yes | 0 No |
Define non linear data structure.
in tree construction which is the suitable efficient data structure? (Array, linked list, stack, queue)
What is the difference between data types and data structures?
List out few of the Application of tree data-structure?
What are the Difference between tcp and udp?
When will you sort an array of pointers to list elements, rather than sorting the elements themselves?
How do you determine if a binary tree is height balanced?
What is the complexity of arraylist?
What are the issues that hamper the efficiency in sorting a file?
Is json a data structure?
Run time memory allocation is known as ?
Explain extended binary tree.