I want to multiply two matrices but the triple loop has O(n3) complexity. Is there any algorithm in dynamic programming to multiply two matrices with O(n) complexity?
There is a theoretical lower bound for matrix multiplication at O(n^2) as you have to touch that many memory locations to do the multiplication. As others have said, there are algorithms that drop us below O(n^3), but are usually impractical in real use.
If you need to speed it up, you might want to look at Cache Oblivious Algorithms, such as this one (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.44.5650) that accelerate performance by performing operations in a cache cohesive way, ensuring that data is in the cache when needed.