Friday, 17 November 2017

What are the limitations of arrays in data structure?
1. Arrays are of fixed size.
2. Data elements are stored in continuous memory locations which may not be available always.
3. Adding and removing of elements is problematic because of shifting the locations.

How can you overcome the limitations of arrays in data structure?
Limitations of arrays can be solved by using the linked list.

What is a linked list in data structure?
Linked list is a data structure which store same kind of data elements but not in continuous memory locations and size is not fixed. The linked lists are related logically.

What is the difference between an array and a linked list in data structure?
Ans :The size of an array is fixed whereas size of linked list is variable. In array the data elements are stored in continuous memory locations but in linked list it is non continuous memory locations. Addition, removal of data is easy in linked list whereas in arrays it is complicated.

What is a node in linked list?
The data element of a linked list is called a node.

What does node consist in linked list?
Node consists of two fields: data field to store the element and link field to store the address of the next node.

Write the syntax of node creation in linked list?
Syntax:
struct node
{
data type ;
struct node *ptr; 
};

Write the syntax for pointing to next node in linked list?
Syntax:
node->link = node1;


Thanks 
Mukesh Rajput

No comments:

Post a Comment

Thanks
Mukesh Rajput