UVA 929 Number Maze Dijkstra based problem
UVA 929 Number Maze Dijkstra based problem. We have already discussed Dijkstra algorithm for shortest path from source to destination here http://wikistack.com/shortest-path-problem-dijkstras-algorithm/. The given problem at this link https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=870...
Find longest cycle in directed graph
Find longest cycle in directed graph. A cycle is a close path in graph. For example below given directed graph contains a cycle of maximum length of 5 starting...
UVA Backtracking problem 639 Don’t Get Rooked solution
UVA Backtracking problem 639 Don’t Get Rooked solution. The given problem is based on backtracking. https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=580. #include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; #define N 5 char mat; int...
Check whether partially filled sudoku is valid
Write c or c++ program to check whether partially filled sudoku is valid. The given grid size is 9×9, divided into 9 regions of 3×3. Each row must contain...
c program to check line segment intersection
write a c program to check line segment intersection. we have already discussed the line segment intersection theory on our previous post http://wikistack.com/line-segment-intersection/. Now we know how to make...
maximum submatrix sum problem
Given a 2D matrix find the maximum submatrix sum in it. The matrix is containing positive and negative integers. For example The maximum submatrix sum is 15 in the...
traveling salesman problem dynamic programming
Traveling salesman problem dynamic programming. The tsp problem is considered to be difficult problem in computer science. Let us understand the classical traveling salesman problem with the help of...
traveling salesman problem Brute force and dynamic programming
Traveling salesman problem Brute force and dynamic programming: Given a set of cities and the distances between them, find the shortest path visiting each of a given set of...
how to print all paths in a directed graph
“how to print all paths in a directed graph” is famous question asked in programming interview. Given a directed graph write a c program to find all paths between...
How to solve “Ones and zeros” Spoj Problem.
The problem published at http://www.spoj.com/problems/ONEZERO/ is very interesting because thinking its efficient solution using BFS is a complex task for seasonal programmer. I actually called seasonal because most or...