Need Programming Assignment Help?

Get Help with Programming Assignment in Java, C/C++, Dot Net, PHP, Database and UML Diagrams

All posts tagged Data Structures

Java Program to Implement Min Heap

Java Program to Implement Min Heap Implement Min Heap – This Java Programming Examples covers the Implementation of Min Heap. public class JavaMinHeapExample { private int[] Heap; private int size; private int maxsize; private static final int FRONT = 1; public JavaMinHeapExample(int maxsize) { this.maxsize = maxsize; this.size = 0; . . . Read more

Java Program to Implement Pairing Heap

Java Program to Implement Pairing Heap A Pairing heap is a type of heap data structure with relatively simple implementation and excellent practical amortized performance. import java.util.Scanner; class PairNode { int element; PairNode leftChild; PairNode nextSibling; PairNode prev; /* Constructor */ public PairNode(int x) { element = x; leftChild = null; . . . Read more

Convex Hull Optimization

Convex Hull Trick Implementation Convex Hull Trick Implementation – This Data structure & Algorithm in Java is a Dynamic Programming example for Convex Hull Trick Implementation. public class ConvexHullOptimization { long[] A = new long[1000000]; long[] B = new long[1000000]; int len; int ptr; // a descends public void addLine(long . . . Read more

Knights Tour Algorithm

C Program to Implement Knights Tour  Algorithm C Program to Implement Knights Tour Problem Algorithm – This Data Structure Program is to Implement Knights Tour Problem Algorithm. #include<stdio.h> #define N 8 int solveKTUtil(int x, int y, int movei, int sol[N][N], int xMove[], int yMove[]); bool isSafe(int x, int y, int . . . Read more

Hamiltonian Cycle

C Program to implement Hamiltonian Cycle Problem Hamiltonian Cycle Problem – This is simple C program to implement hamiltonian cycle problem programs. #include<stdio.h> #include<conio.h> #define MAX 25 int x[MAX]; void Next_Vertex(int G[MAX][MAX],int n,int k) { int j; while(1) { x[k]=(x[k]+1)%(n+1); if(x[k]==0) return; if(G[x[k-1]][x[k]]!=0) { for(j=1;j<=k-1;j++) { if(x[j]==x[k]) break; } if(j==k) . . . Read more

Sierpinski Triangle

C Program to Implement Sierpinski Triangle Algorithm Implementation of Sierpinski Triangle Algorithm – This C program example is to Implement Sierpinski Triangle Algorithm. #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <math.h> #include <graphics.h> void DrawSierpinski(void); void main(void) { int gd=VGA; int gm=VGAHI; initgraph(&gd, &gm, “C:\\tc\\bgi”); DrawSierpinski(); getch(); } void DrawSierpinski(void) . . . Read more

Minimum Spanning Tree

C Program to Find a Minimum Spanning Tree using Prim’s Algorithm Minimum Spanning Tree using Prim’s Algorithm – This Section covers C program example to find Minimum Spanning Tree using Prim’s Algorithm. #include<stdio.h> #include<conio.h> int a,b,u,v,n,i,j,ne=1; int visited[10]={0},min,mincost=0,cost[10][10]; void main() { clrscr(); printf(“\nEnter the number of nodes:”); scanf(“%d”,&n); printf(“\nEnter the . . . Read more

C Program to Implement Warshall’s algorithm

C Program to Implement Warshall’s algorithm which will produce reachability matrix of a directed graph Reachability Matrix of a Directed Graph – This C Program to Implement Warshall’s algorithm which will produce reachability matrix of a directed graph. #include<stdio.h> #define size 10 main() { int a[size][size]; int i,j,k,n; void warshall(int[][j],int); . . . Read more

Shortest Path

C Program to Find Shortest Path using Dijkstra’s Algorithm Shortest Path using Dijkstra’s Algorithm – This Example C Program is to find Shortest Path using Dijkstra’s Algorithm. #include<stdio.h> #include<conio.h> #include<process.h> #include<string.h> #include<math.h> #define IN 99 #define N 6 int dijkstra(int cost[][N], int source, int target); int main() { int cost[N][N],i,j,w,ch,co; . . . Read more