FOUNDATION OF COMPUTER SCIENCE : DS Lab File

21 views36 pages

Document Summary

S. no title: write a program for linear search in an. Aim: write a program for linear search in an array. %d. \n", num, x); check = 1; break; if (check == 0){ printf("\nthe number wasn"t found in the array"); printf("\n\n\n"); system("pause"); return 0; Aim: write a program for insertion and deletion of an element in an array. Aim: write a program for push and pop operation in a stack. #include void push(int element, int stack[], int *top, int stacksize) if (*top == -1) stack[0] = element; *top = 0; else if (*top == stacksize - 1) printf("!! stack overflow ! !\n"); else stack[(*top) + 1] = element; (*top)++; void pop(int stack[], int *top, int stacksize) if (*top == -1) printf("!! stack underflow ! Hello vishal you exit from your program break; default: printf("\n !! Aim: write a program for insertion and deletion of elements in a queue.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions