1 /*
2 Problem link
3 Type: Graph - Find articulation points
4 Algorithm:
Introduction
This is my blog of programming, I take notes and leave codes of computer science problems I solved here. Be my guest to comment :)
Wednesday, October 16, 2013
Uva 10765 - Doves and bombs
Tuesday, September 17, 2013
UVA 10092 - The Problem with the Problem Setter
1 /*
2 Problem link
3 Type: Graph - Maximum Flow
4 Algorithm:
Thursday, September 12, 2013
UVa 11747 - Heavy Cycle Edges
1 /*
2 Problem type: Graph - MST
3 Algorithm: Find the Minimum Spanning Tree (MST) (using Kruskal,
4 Prim) and print out all the edges which are not included in the MST.
5 */
Wednesday, July 10, 2013
UVa 10020 - Minimal coverage
1 /*
2 Problem link
3 Type: Greedy - INTERVAL COVERING
4 Algorithm:
Saturday, June 22, 2013
Friday, June 21, 2013
Wednesday, June 19, 2013
uva 681 - Convex Hull Finding
1 /*
2 Problem link
3 Type: Geometry
4 Algorithm: Graham's Scan
Monday, June 17, 2013
uva 12532 - Interval Product
1 /*
2 Problem link
3 Type: Data structure - Binary index (Fenwick) tree
4 Algorithm:
Thursday, June 13, 2013
uva 11988 - Broken Keyboard (a.k.a. Beiju Text)
1 /*
2 Problem link
3 Type: Data structure - link list
4 Algorithm:
Tuesday, May 28, 2013
uva 450 - Little Black Book
1 /*
2 Problem link
3 Type: Adhoc - Sorting
4 Algorithm:
Thursday, May 23, 2013
uva 410 - Station Balance
1 /*
2 Problem link
3 Type: Recursion - Greedy
4 Algorithm:
Monday, May 20, 2013
uva 10171 - Meeting Prof. Miguel...
1 /*
2 Problem link
3 Type: Graph - Floyd
4 Algorithm:
Sunday, April 14, 2013
uva 572 - Oil Deposits
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: DFS
5 */
Tuesday, April 9, 2013
uva 11733 - Airports
1 /*
2 Problem link
3 Type: Graph
4 Algorithm:
5 Kruskal, stop when the number of edge selected is equal to n-1 or the price of the edge
6 equal to the cost to build an airport.
7 */
Wednesday, March 27, 2013
uva 311 - Packets
1 /*
2 Problem link
3 Type: Ad hoc, Greedy
4 Algorithm:
Monday, March 18, 2013
uva 216 - Getting in Line
1 /*
2 Problem link
3 Type: DP - TSP
4 Algorithm: Brute force, back-tracking
5 */
Thursday, March 14, 2013
uva 469 - Wetlands of Florida
/*
Problem link
Type: Graph
Algorithm: BFS/DFS
*/
Problem link
Type: Graph
Algorithm: BFS/DFS
*/
Friday, March 8, 2013
uva 10098 - Generating Fast
1 /*
2 Problem link
3 Type: Adhoc
4 Algorithm:
5 */
Monday, March 4, 2013
Thursday, February 28, 2013
uva 186 - Trip Routing
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: Floyd
5 */
Wednesday, February 27, 2013
Tuesday, February 26, 2013
Monday, February 25, 2013
Red - black tree full implementation
Red-black tree is known for an efficient data structure use in computer science. It is a type of self-balance binary search tree, it performs insertion, deletion, searching,.. in the worst running time of O(lg n). This is my red-black tree implementation in C++:
Friday, February 22, 2013
uva 10009 - All Roads Lead Where?
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: BFS
5 */
Tuesday, February 19, 2013
Thursday, February 7, 2013
uva 10306 - e-Coins
1 /*
2 Problem link
3 Type: DP - Coins change
4 Algorithm:
5 First I use the function getP to search for a list of possible points with
6 length = s from the origin and have possitive coordinates.
7 Use the coins change algorithm (uva 166) with a few changes to find the
8 minimum step to each point i got. Get the minimum for each point result.
9 */
Wednesday, January 30, 2013
uva 10278 - Fire Station
1 /*
2 Problem link
3 Type: Graph - Single source shortest path
4 Algorithm:
5 First run Floyd (or Dijkstra to every vertex n), for each vertex
6 find the distance to the nearest station, get the max of those nearest station.
7
8 For the vertex which is not a station, place a station there and run Dijkstra
9 for that vertex. Recalculate the distance to the nearest station for each vertex
10 by the distance array from the Dijkstra and update the for the "better max".
11 */
Wednesday, January 23, 2013
Tuesday, January 22, 2013
uva 1208 - Oreon
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: MST
5 */
Saturday, January 19, 2013
uva 908 - Re-connecting Computer Sites
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: MST
5 */
Thursday, January 17, 2013
uva 299 - Train Swapping
1 /*
2 Problem link
3 Type: Ad hoc, Sorting.
4 Algorithm: Insertion Sort.
5 */
Monday, January 7, 2013
Wednesday, January 2, 2013
uva 821 - Page Hopping
1 /*
2 Problem link
3 Type: Graph
4 Algorithm:
5 Use floyd to find all pair shortest path, sum them up, divide to the number of pair
6 I use the map to mark for the vertex in the input.
7 */
Tuesday, January 1, 2013
uva 423 - MPI Maelstrom
1 /*
2 Problem link
3 Type: Graph
4 Algorithm:
5 Use Floyd or Dijkstra to find the shortest path from 1 to n-1 others nodes.
6 Find the max of the shortest path from 1 to n-1 others nodes.
7 */
Subscribe to:
Posts (Atom)