NP-COMPLETE TASKS:
-
knapsack.cpp
The knapsack problem: Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible
input: the amount of things, their weight, their value, a given limit.
output: the max total value, number of things, that were used to reach max total value. -
Vertex-cover
Find a K-vertex cover. input: the amount of vertexes, amount of edges and K, list of edges. output: if the K-vertex exists: YES and vertexes in vertex-cover, else: NO
FINITE AUTOMATION:
-
DFA.cpp
input: N - amount of conditions, then N strings with condition description: (1-condition is terminal or 0-condition is not terminal), T - amount of transitions, then T descriptions off transitions (symbol, condition), then M - amount of strings to check this automat. output: M+1 string: 1-the automat accepts the word, 0-the automat doesn't accepts the word. -
NFA.cpp
input: N - amount of conditions, then N strings with condition description: (1-condition is terminal or 0-condition is not terminal), E- emount of epsilon-transitions, E number of epsilon-transitions, T - amount of transitions, then T descriptions off transitions (symbol, condition), then M - amount of strings to check this automat. output: M+1 string: 1-the automat accepts the word, 0-the automat doesn't accepts the word.
ALGORITHMS:
-
Ford_Belman_longest_path.cpp
Finding longest path with Ford-Belman algorithm
input: amount of vertexes, adjacency matrix
output: the length of path -
LargeFactorial.cpp
Calculationg N! for N < 100000.
input: N in decimal notation
output : N! -
LargeSort.cpp
Sorting text file lexicographical by strings.
input: text
and limit on memory in file memory.txt.
output: sorted text -
bridges.cpp
Finding bridges in graph.
input: amount of vertexes, list of edges,
output: numbers of edges-bridges as in input -
closest_points.cpp
Finding two closest points
input: amount of points, coordinates
output: distance between two closest points -
merge_sort.cpp
Realization of merge sort
input: size of array, array
output: sorted array -
piramidal_sort.cpp
Realization of piramidal sort
input: size of array, array
output: sorted array -
quick_sort.cpp
Realization of quick sort
input: size of array, array
output: sorted array -
radix_sort.cpp
Realization of radix sort
input: size of array, array
output: sorted array -
red-black tree.cpp
Realization of red-black tree structure without using set, multiset, map, multimap, unordered_set, unordered_multiset, unordered_map, unordered_multimap, etc.
input: n - amount of requests, n request : (0, v_i) = put v_i in tree or (1, v_i) = find out if v_i is in the tree
output: YES/NO for requests. Then the tree in format: KEY LEFTKEY RIGHTKEY COLOR -
shortest_path.cpp
Finding the shortest path from vertex A to B
input: amount of vertexes, list of edges, A, B
output: the shortest path. -
stl.cpp
Realization of some of stl library templates -
utf-coding.cpp
Coding a word with utf-8.
input: word
output: coded word -
utf-decoding.cpp
Deoding a word from utf-8.
input: coded word
output: decoded word