what is difference between array and structure?
Answer Posted / vinay
Array -
* Memory (array size) is fixed
* Accessing an element in array takes constant time. E.g. -
5th element in an array can be accessed as array[4] i.e.
searching/accessing an element in array takes comparatively
less time than in structures.
* Adding/deleting an element in the array is comparatively
difficult since the data already present in the array needs
to be moved
Structure -
* Memory (structure size) can be changed dynamically
* Accessing an element in a list takes more time
comparatively since we need to traverse thro the list
* Adding/deleting takes less time than in arrays
| Is This Answer Correct ? | 208 Yes | 28 No |
Post New Answer View All Answers
What is the difference between %d and %i?
Can you add pointers together? Why would you?
largest Of three Number using without if condition?
Explain what are linked list?
which type of aspect you want from the student.
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Why is %d used in c?
What is modeling?
Why is sprintf unsafe?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
What is meant by operator precedence?
Explain indirection?
How do we make a global variable accessible across files? Explain the extern keyword?
What is || operator and how does it function in a program?
By using C language input a date into it and if it is right?