Explore Courses Blog Tutorials Interview Questions
0 votes
in Blockchain by (4.1k points)

Seen as datatype, is Blockchain a single linked list? As each block refers to the previous block using a hash.
Or is it some kind of tree?

2 Answers

0 votes
by (14.4k points)
edited by

Although a blockchain is architected in the same manner as a single linked list is, there are a few differences that divide them both on a technological level. 

While users can add or delete nodes or blocks in the middle of a single linked list, they cannot do the same in a blockchain. Once data is recorded in a block, it stays there forever. 

In most blockchain networks, transactions that pertain to a block are recorded in a Merkle tree. Therefore, it will be practically outrageous to imply that blockchain is a tree.

Have deeper knowledge in Blockchain. Enroll now in Blockchain Training.

0 votes
by (33.1k points)

Blockchain is quite similar to Single Linked List but there are many differences between these two. 

In a Single Linked list, there is a set of nodes connected to each other through a pointer. Every node has a pointer that points to the next node in the list, so it is not possible to traverse back to the previous node from the current node.

In Blockchain, each block is connected to each other. But in Blockchain the flow of trace is opposite to single linked list. In Blockchain, you can trace back to the previous block all the way to the genesis block from the current block. 

The major difference between a Blockchain and a single linked list is that the data in the single linked list can be altered or erased but the data in the blockchain can not be altered or erased.

Hope this answer helps you!

Related questions

Browse Categories