DSA

C Program for Implementation of Circular Queue Using Array

#include<stdio.h> #define MAX 10 typedef struct Q { int R,F; int data[MAX]; }Q; void initialise(Q *P); int empty(Q *P); int full(Q *P); void enqueue(Q *P,int x); int dequeue(Q *P); void print(Q *P); void main() { Q q; int op,x; initialise(&q); do   { printf(“nn1)Insertn2)Deleten3)Printn4)Quit”); printf(“nEnter Your Choice:”); scanf(“%d”,&op); switch(op)   { case 1: printf(“nEnter a …

C Program for Implementation of Circular Queue Using Array Read More »

C Program for Addition and Multiplication of Polynomial Using Arrays or Linked List

Polynomial addition, multiplication (8th degree polynomials) using arrays #include<math.h> #include<stdio.h> #include<conio.h> #define MAX 17 void init(int p[]); void read(int p[]); void print(int p[]); void add(int p1[],int p2[],int p3[]); void multiply(int p1[],int p2[],int p3[]); /*Polynomial is stored in an array, p[i] gives coefficient of x^i .   a polynomial 3x^2 + 12x^4 will be represented as …

C Program for Addition and Multiplication of Polynomial Using Arrays or Linked List Read More »

What are B-Trees?

B-tree is another very popular search tree. The node in a binary tree like AVL tree contains only one record. AVL tree is commonly stored in primary memory. In database application, where huge volume of data is handled, the search tree cannot be accommodated in primary memory. B-trees are primarily meant for secondary storage. A …

What are B-Trees? Read More »

DFS in C [Program+Algorithm]

In this tutorial, you will learn about Depth First Search in C with the algorithm and program examples. Most graph problems involve the traversal of a graph. Traversal of a graph means visiting each node and visiting exactly once. There are two types of traversal in graphs i.e. Depth First Search (DFS) and Breadth First Search (BFS). Also …

DFS in C [Program+Algorithm] Read More »

Program for Merge Sort in C

In this tutorial, you will get program for merge sort in C.   Merge sort runs in O (n log n) running time. It is a very efficient sorting data structure algorithm with near optimal number of comparisons. Recursive algorithm used for merge sort comes under the category of divide and conquer technique. An array of …

Program for Merge Sort in C Read More »

Program for AVL Tree in C

Here you will get program for AVL tree in C. An AVL (Adelson-Velskii and Landis) tree is a height balance tree. These trees are binary search trees in which the height of two siblings are not permitted to differ by more than one. i.e. [Height of the left subtree – Height of right subtree] <= 1. A …

Program for AVL Tree in C Read More »