The snippets below illustrate GZip compression and decompression using the GZipStream classes.
Tag Archives: algorithm
It’s no fun implementing QuickSort unless you can force it out of its blister-fast, O(n log n) speed and humiliate it with its worst-case, O(n^2) runtime. So that’s what I set out to do. My naive partition simply pivots around the low item, but my randomized partition defeats the sucky inputs by choosing a random [...]
Numerical Methods application for solving system of equation using Gaussian Elimination based on this Wikipedia article: http://en.wikipedia.org/wiki/Gaussian_elimination
Prime numbers have many applications. For example, in cryptography. The RSA algorithm for public-key cryptography uses large prime numbers for generating keys. Quote: The RSA algorithm works as follows: take two large primes, p and q, and compute their product n = pq; n is called the modulus. Choose a number, e, less than n [...]
Its Dijkstra’s Shortest Path algorithm written in C. Reads from a file the nodes and the connected edges and implements Dijkstra’s algorithm. I am uploading for your comments in my code. Thank you. Files content should be in the format: n N startNode endNode distance startNode endNode distance . . . startNode endNode distance where [...]
Huffman coding is an encoding algorithm used for data compression. So called Huffman trees are used for encoding and decoding of data. The leaves of these trees contain the symbols and their frequencies. Each parent node contains the sum of the frequencies of its children.
The Heapsort algorithm implemented in C++
Binary Search Tree (BST) implementation in C++