BI296: Linux Programming For Bioinformatics2017 Spring |
Extra Lectures[Exercise 0]
[Exercise 1](Due: March 24, 2017)
[Exercise 2: Regular Expression](Due: April 21, 2017)[Exercise 3: BASH](Due: April 28, 2017.)
[Exercise 4: C Programming](Due: May 5, 2017)
[Exercise 5: Python Fundamentals](Due: May 12, 2017)[Exercise 6: Python Strings and Lists](Due: May 19, 2017)[Exercise 7: Python Tuples,Dicts and File I/O](Due: May 26, 2017)[Exercise 8: Object-oriented Programming in Python](Due: June 02, 2017)[Exercise 9: Python Data Science](Due: June 16, 2017)[Exercise 10: Algorithms](Due: June 16)Write a program to compute the suffix arrays of each of the following strings. Assume that string indices start at 1.
You are required to pack the sorting algorithms into a Python module, so that you can call all the algorithms by importing the module. Besides sorting the numerical array, the module should be able to sort a string array as well. Image Compression algorithms can be compared under categories of lossy and lossless techniques. The best image compression algorithm known for lossy compression is 'WebP'. This algorithm became popular in May, 2014 when Facebook started using it. Google's this new image compression algorithm provides 25-35% more compression as compared to JPEG. Though the algorithm is lossy in nature but the loss of information is far beyond the scope of human visual perception. However, when we talk about lossless compression algorithm that produces the smallest output regardless of speed, the 'best' algorithm is probably one of the PAQ-based context mining algorithms, which use a large number of independent context models to predict the next pixel in an image from neighboring pixels, followed by weighted averaging o the predictions and arithmetic coding. Some also use color transformations like (R, G, B)->(G, G-R, G-B) to decrease the correlation between colors. Here are three of the benchmarks: A sparse matrix is a matrix which contains only a very small proportion of non-zero elements, such as a 100-by-100 matrix with only 500 non-zero elements. Can you figure out a way to store the matrix in order to reduce the storage demand? And furthermore, define some functions for sparse matrix computation, e.g., computing the sum, difference, product of two sparse matrices, or transpose the matrix, computing the determinant, eigenvalues and eigenvectors. |