plz send me all data structure related programs
Answers were Sorted based on User's Feedback
To start with data structures, Linked lists comes 1st.
Hands on experience with the following questions will give
good confidence to a programmer.
1. Creating a list (Single linked list or double linked
list)
a. add node to front of the list
b. add node to end of the list
c. add node to middle of the list
d. Delete first node
e. Delete last node
f. Delete middle node
2. Identifying Loop or circle in a single linked list
3. Reversing a linked list(single and double)
4. finding middle node of a list
5. All the above programs can be extended to develop a
generic linked list even.
In the above programs stacks and queues concepts are
covered. To develop Stack LIFO concept is followed.
To develop Queue FIFO concept is followed.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / papa_structure
stacks, queues, linklist, trees, graphs and
sorting.....leave these topics and rest all are data
structures..................................................
............................................................
............................................................
............................................................
...........
dumbo!!!!!!!!!!!!think b4ore u ask.........
Is This Answer Correct ? | 0 Yes | 0 No |
main() { int i=5,j=6,z; printf("%d",i+++j); }
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
main() { int i=5; printf(“%d”,i=++i ==6); }
Give a one-line C expression to test whether a number is a power of 2.
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }
There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }