Table of Contents generated with DocToc
- Graham Scan algorithm for Convex Hull O(n * log(n))
- Online construction of 3-D convex hull in O(n^2)
- Bentley Ottmann algorithm to list all intersection points of n line segments in O((n + I) * logn)
- Suggested Reading - http://softsurfer.com/Archive/algorithm_0108/algorithm_0108.htm
- Rotating Calipers Technique
- Suggested Reading - http://cgm.cs.mcgill.ca/~orm/rotcal.html
- Problems - Refer the article for a list of problems which can be solved using Rotating Calipers technique.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ program to demonstrate auto-complete feature | |
// using Trie data structure. | |
#include<bits/stdc++.h> | |
using namespace std; | |
// Alphabet size (# of symbols) | |
#define ALPHABET_SIZE (26) | |
// Converts key current character into index | |
// use only 'a' through 'z' and lower case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std ; | |
int cost[100][100] , n ; | |
int getMin(int dist[] , bool visited[]){ | |
int key = 0 ; | |
int min = INT_MAX ; | |
for(int i=0;i < n ; i++){ | |
if(!visited[i] && dist[i]<min){ |