Knowledge in C programming

Programming in C

Basic Programming concepts of C

Double Ended Queue

# include<stdio.h> #include<process.h> #define MAX 30 typedef struct dequeue { int data[MAX]; int rear,front; }dequeue; void initialize(dequeue *p); int empty(dequeue *p); int full(dequeue *p); void enqueueR(dequeue *p,int x); void enqueueF(dequeue *p,int x); int dequeueF(dequeue *p); int dequeueR(dequeue *p); void print(dequeue *p); void main() { int i,x,op,n; dequeue q; initialize(&q); do { printf("\n1.Create\n2.Insert(rear)\n3.Insert(front)\n4.Delete(rear)\n5.Delete(front)"); printf("\n6.Print\n7.Exit\n\nEnter your choice:"); scanf("%d",&op); switch(op) { case 1: printf("\nEnter number of elements:"); scanf("%d",&n); initialize(&q); printf("\nEnter the data:"); for(i=0;i<n;i++) { scanf("%d",&x); if(full(&q)) { printf("\nQueue is full!!"); exit(0); } enqueueR(&q,x); } break; case 2: printf("\nEnter element to be inserted:"); scanf("%d",&x); if(full(&q)) { printf("\nQueue is full!!"); exit(0); } enqueueR(&q,x); break; case 3: printf("\nEnter the element to be inserted:"); scanf("%d",&x); if(full(&q)) { printf("\nQueue is full!!"); exit(0); } enqueueF(&q,x); break; case 4: if(empty(&q)) { printf("\nQueue is empty!!"); exit(0); } x=dequeueR(&q); printf("\nElement deleted is %d\n",x); break; case 5: if(empty(&q)) { printf("\nQueue is empty!!"); exit(0); } x=dequeueF(&q); printf("\nElement deleted is %d\n",x); break; case 6: print(&q); break; default: break; } }while(op!=7); } void initialize(dequeue *P) { P->rear=-1; P->front=-1; } int empty(dequeue *P) { if(P->rear==-1) return(1); return(0); } int full(dequeue *P) { if((P->rear+1)%MAX==P->front) return(1); return(0); } void enqueueR(dequeue *P,int x) { if(empty(P)) { P->rear=0; P->front=0; P->data[0]=x; } else { P->rear=(P->rear+1)%MAX; P->data[P->rear]=x; } } void enqueueF(dequeue *P,int x) { if(empty(P)) { P->rear=0; P->front=0; P->data[0]=x; } else { P->front=(P->front-1+MAX)%MAX; P->data[P->front]=x; } } int dequeueF(dequeue *P) { int x; x=P->data[P->front]; if(P->rear==P->front) //delete the last element initialize(P); else P->front=(P->front+1)%MAX; return(x); } int dequeueR(dequeue *P) { int x; x=P->data[P->rear]; if(P->rear==P->front) initialize(P); else P->rear=(P->rear-1+MAX)%MAX; return(x); } void print(dequeue *P) { if(empty(P)) { printf("\nQueue is empty!!"); exit(0); } int i; i=P->front; while(i!=P->rear) { printf("\n%d",P->data[i]); i=(i+1)%MAX; } printf("\n%d\n",P->data[P->rear]); }

C++ and C Notes | 1st year | KIIT UNIVERSITY

Contains everything about c and c++ for 1st years. i.e. for 1st semester and 2nd semester.##NOTE FOR DOWNLOAD:: After downloading there maybe an error in opening pdf's. Go to the file location and rename the pdf and give the extension part i.e. ' .pdf ' .

PROBLEM SOLVING USING C PROGRAMMING

These files are of c programming. It contains a syllabus copy also. contents in them are 1.Introduction to c 2.History of c 3.Functions 4.Pointers 5.Arrays 6. Structures and files the articles contain all the detailed information about c language necessary for every engineering student. These ppt's are prepared by expert faculty . It contains a detailed explanation of all the c language.

Programming in C

Basic programming in c

INTRODUCTION TO C++

This ppt contain introduction to c++ Introduction to C++ programming: Object Oriented Programming Concepts, Structured Vs OOP. Classes and Objects: Class Definition, Objects, Class Scope and Accessing Members. Constructors : Default Constructor, Parameterized Constructor, Constructor initialization list, Copy Constructor and Destructors.

Searching and sorting algorithms

This ppt contain all the important searching and sorting techniques of the c and c++ Searching Methods: Linear Search Binary Search Sorting Techniques: Bubble Sort Selection Sort Insertion Sort Quick Sort Merge Sort

Data structures (trees)

This ppt contains trees in data structures prepared by experienced faculty for the better understanding of students. Trees Binary Trees Terminology Representation Tree Traversals Graphs Terminology Representation Graph Traversals DFS and BFS

Data structures (linked lists)

This ppt includes information about the linked lists in data structures. Contents in ppt are Singly Linked List Doubly Linked List Circular Linked List Representing Stack with Linked List. Representing Queue with Linked List.

Data structures introduction

This ppt is beggining of the data structures course prepared by experienced faculty for the better understanding of students. Contents in it are Introduction to Data Structures Abstract data type (ADT) Stacks, Queues and Circular Queues and their implementation with arrays Stack Applications: Infix to Post fix conversion Postfix expression evaluation. Applications of Queues

PROBLEM SOLVING USING C PROGRAMMING - PROGRAMS

This pdf contain the brief solutions to the important probelems that are related to the c programming and the programs are written in user friendly language and these programs are available with solutions that are error free.

PROBLEM SOLVING USING C PROGRAMMING - Question papers

These documents are purely related to the questions of the c programming. These contain the important questions related to the computer programming and it covers the wide range of typical and important questions.