Showing posts with label DSA. Show all posts
Showing posts with label DSA. Show all posts

Sunday, May 8, 2011

Data Structures Aptitude Question

1. What is data structure?
A data structure is a way of organizing data that considers not only the items
stored, but also their relationship to each other. Advance knowledge about the
relationship between data items allows designing of efficient algorithms for the
manipulation of data.

Monday, May 2, 2011

Bubble sort

#include <stdio.h>
#include <conio.h>
void main( )

Selection Sort

#include <stdio.h>
#include <conio.h>
void main( )

Insertion sort

#include <stdio.h>
#include <conio.h>
void main( )

Binary Tree Sorting

#include <stdio.h>
#include <conio.h>
#include <alloc.h>

Heap Sort

#include <stdio.h>
#include <conio.h>
void makeheap ( int [ ], int ) ;

Merge Sort

#include <stdio.h>
#include <conio.h>

Program to implements depth first search algorithm

#include <stdio.h>
#include <conio.h>
#include <alloc.h>

breadth first search algorithm

#include <stdio.h>
#include <conio.h>
#include <alloc.h>

program to find shortest path

#include <stdio.h>
#include <conio.h>

dijkstra's shortest path algorithm

/* pgm to implement dijkstra's shortest path algorithm*/
#include<stdio.h>
#define INF 1000

Quick sort

#include<stdio.h>
void split(int a[],int lb,int ub,int *pivot)

program to minimum spanning tree using prim's algorithm

*PGM to build minimum spanning tree using prim's algorithm*/
#include<stdio.h>
#define INF 1000

program to pgm to count no. of palindrome in the words

/* pgm to count no. of palindrome in the words*/
#include<stdio.h>
#include<conio.h>

bindary search tree

/* pgm to build optimal bindary search tree*/
#include<stdio.h>
#define INF 10000

NQUEEN PROBLEM



#include<stdio.h>
void main()
{
int i,k=0,n,row[15],ddiag[20],udiag[20];
int board[15],r,j;
clrscr();

program to find the minimum and maximum no. in the list

/* program to find the minimum and maximum no. in the list*/
#include<stdio.h>
int minimum(int a[],int n)
{
int k;

Data Structure minimum spanning tree

/*pgm to find minimum spanning tree using kruskal's algorithm*/
#include<stdio.h>
#define INF 1000
char vertex[10];
int wght[10][10];

Data Structure Knapsack Problem

/* Knapsack Problem Using Backtracking*/
#include<stdio.h>
int x[12],w[12],pr[12],m,n,z,val;
void main()
{

Data Structure factorial & generate fibonacci series

/* pgm to compute factorial & generate fibonacci of a number*/
#include<stdio.h>
long int fact(int);
int fibo(int);
void main()