Posts

C program to implement Double Linked List in C

Image
Doubly Linked List Before going towards the doubly linked list, I hope that you have the knowledge about the Singly Linked List. If not, then click here . Doubly Linked List is a variation of Linked list in which navigation is possible in both ways, either forward and backward easily as compared to Single Linked List. Following are the important terms to understand the concept of doubly linked list.

Implementation of Queue using Linked List in C

Image
Queue With Linked List We had seen how to implement simple queue using array. If you had not seen, just go through it once  Queue with Array Now, let us see the implementation of queue using linked list.

Implementation of Stack using Linked List in C

Image
Stack With Linked List We had seen how to implement simple stack using array. If you had not seen, just go through it once Stack with Array Now, let us see the implementation of stack using linked list.

C program to implement the Circular Queue

Image
Circular Queue with its Operation Circular Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. Graphical representation of a circular queue is as follows... Implementation of Circular Queue To implement a circular queue data structure using array, we first perform the following steps before we implement actual operations. Step 1 :  Include all the  header files  which are used in the program and define a constant  'SIZE'  with specific value. Step 2:  Declare all  user defined functions  used in circular queue implementation. Step 3:  Create a one dimensional array with above defined SIZE ( int cQueue[SIZE] ) Step 4:  Define two integer variables  'front'  and ' rear ' and initialize both with  '-1' . ( int front = -1, rear = -1 ) Step 5:  Implement...

C program to implement Stack

Image
C program to do operations on Stack using Array Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). Mainly the following three basic operations are performed in the stack: Push:  Adds an item in the stack. If the stack is full, then it is said to be an Overflow condition. Pop:  Removes an item from the stack. The items are popped in the reversed order in which they are pushed. If the stack is empty, then it is said to be an Underflow condition.

C program with the use of strlen() function.

Image
Use of strlen() Function. In this post, I had shared a program with the use of strlen() function. strlen() is a string function which gives the length of the string in form of output. Let us check the code :)

C program to count the words in a line.

Image
Count the total number of words in a line. In this post, I had shared a C program that will count the number of words in the line you had inserted. Let us observe the code :) #include <stdio.h> #include <conio.h> void main() { char s[50],ch; int i,c=0; clrscr(); printf("Enter the string: "); for(i=0;ch!='\n';i++) { ch=getchar(); s[i]=ch; } s[i]='\0'; for(i=0;s[i]!='\0';i++) { if(s[i]==' ') { c++; while(s[i]==' ') i++; } } c++; printf("\nTotal words: %d",c); getch(); } Happy Coding :)