What are the limitations of arrays in the data structure?
1. Arrays are of fixed size.
2. Data elements are stored in contiguous 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 the data structure?
Limitations of arrays can be solved by using the linked list.

What is a linked list in the data structure?
The linked list is a data structure which stores same kind of data elements but not in contiguous 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 the data structure?
Ans: The size of an array is fixed whereas the size of the linked list is variable. In the array, the data elements are stored in contiguous memory locations but in the 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 a linked list?
The data element of a linked list is called a node.

What does node consist of a linked list?
A 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 a linked list?
Syntax:
struct node
{
data type ;
struct node *ptr; 
};



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


Thanks 
Mukesh Rajput
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments:

Thanks
Mukesh Rajput