Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 533 Bytes

explanation_5.md

File metadata and controls

11 lines (9 loc) · 533 Bytes

Problem 5: blockchain

For this problem, I used double linked list instead of linked list because with double linked list, it is easier to access the previous hash.

Time complexity

The complexity of the algorithm is basically constant since the operations are appending to the tail of the double linked list, and accessing previous hash of a node.

Space complexity

The space complexity of the algorithm is linear i.e. O(n), where n is size of the blockchain.