Which of the Following will define a type NODE that is a
node in a Linked list?
A)struct node {NODE*next;int x;};type def struct node NODE;
B)typedef struct NODE {struct NODE *next;int x;};
C)typedef struct NODE {NODE *next;int x;};
D)typedef struct {NODE *next;int x;}NODE;
Answer Posted / ashwin kumar
Shahzad is correct
next node must be like a 1st node means it must have two
fields one for two store data and another field for
storing address of the next node.
in 2nd field where we have point to the next node we must
store address of the next node , so we are using pointer ,
as we are pointing to a next node of type structure so we
must use
struct NODE *next
plz info me if any mistake in my answer
molugu.ashwin@gmail.com
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Explain union. What are its advantages?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
What is a shell structure examples?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is meant by recursion?
Suggesting that there can be 62 seconds in a minute?
Does sprintf put null character?
What is the use of #include in c?
What is function and its example?
What does. int *x[](); means ?
Why c is called top down?
What is dangling pointer in c?
explain what are pointers?