Академический Документы
Профессиональный Документы
Культура Документы
Answer:-
Advantages:-
1. the function return only one value. At the time of the same function the pointer
help to recognize the variable.
2.) the pointer is necessary at The time of the run time memory
3). The pointer has the address of the variable so it make the fast.
Disadvantage:
• It is complex
• If the link is broken at any node then the error is occurred.
The pointer is the related to the data structure. The data structure is the organization
of the data that can be fetch easily at the time when it is needed.
The pointer help to store the address. So at the time of the fetching the data the
pointer work. It tell the address of the data and we can receive data easily.
In this way the pointer is useful in the data structure..
Answer. We have to manage the record so that we can get back when ever we
want. There are many ways to manage the records:
• Array: In the c the array store the same kind of elements. With the help of
the array we can store the data of the same type.
• Pointer: the pointer is the variable that can store the address of the another
variable. It is also helpful for the storing the data. It manage the records.
• File: The file system is also helpful to manage record. We store the
information in the file. The all info can be kept by the file.
Part-B
5. Illustrate the use of array of pointers and pointers to an array.
Answer:
Pointer to an array: Now that we know that the name of an array holds the
address of the first member of the array, we realize that we can declare a pointer of
the same data type as the array and initialize it with the array.
int number[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int *pNumbers = Number;
array of pointer:-
#include <stdio.h>
int main() {
int int_array[3] = {1,2,3};
Answer.
• The pointer in which a segment selector is available is called far pointer. It
make possible to point. It point to addresses of the segment. It is used to
access the far segment.
• Dangling pointer means the pointer of invalid address. It means when any
object is deleted then this kind of problem come. There is no element on the
location. The element is deleted that is point by the dangling pointer.
Answer. Linked list is the concept which is related with the pointer concept. The
pointer is used in the linked list.
But in the array the pointer is not used. Because there is no need of the link in the
array.
Array is the collection of same type of elements in continuous type.
(array)
The above fig. are the representation of the array and link list.
Traverse means-go to the every node
Search means- to find any element and give the location
7. Can we perform binary search in linked list ,if no then illustrate the
reason.
Answer. No, we can’t binary search in link list, it is not possible to binary search
in the link list, because in the linked list there is no confirmation of the beginning
and ending point .