Summary
A linked list is some sort of linear data structure, and the elements
are not stored at contiguous memory location. The elements in the
linked list are linked using pointers. In other words, a linked list
consists of nodes where each node contains a data field and a reference
to the next node in the list.
Linked list had some advantages over arrays such as dynamic size and ease of insertion/deletion.
But there are some drawbacks on using linked list as listed below:
1.) Random access is not allowed. We have to sequentially access the elements starting from the first node. So we cant do binary search efficiently with its default implementation.
2.) Each element on the list requires an extra memory space for a pointer
3.) Not cache friendly. Since array elements are contiguous locations, there is locality of reference which is not there in case of linked list.
A linked list is represented by a pointer from the first node of the linked list. The first node is called the "head". If the linked list is empty, then the value of the head is NULL. Each node in a list consists of at least data and pointer. In C, we can represent a node using structures, but in Java or C#, linked list class contains a reference of node class type.
A stack is a linear data structure where elements can be inserted and deleted only from one side of the list, called the "top". A stack follows the principle of "Last In First Out" in which the element inserted at the last is the first element to come out. The insertion of an element into stack is called push operation, while deletion of an element from the stack is called pop operation. In stack, we always keep track of the last element present in the list with a pointer called "top".
A queue is another linear data structure where elements can only be inserted from one side of the list that is "rear", and deletion of the elements can be done from the other side called the "front". The data structure of queue follows the principle of "First In First Out", in which the first element inserted in the list is the first element to be removed from the list. In a queue, the insertion of an element is called "enqueue operation", while deletion of an element is called "dequeue operation". In queue we usually prioritize two pointers, the front pointer pointing to the element which was inserted at the first and still present in the list, and the rear pointer pointing to the element inserted at the last.
Hashing is a technique to convert a range of key values into a range of array indexes. Hash table is a data structure that stores data associatively. In a hash table, data is stored in an array format, where each data value has its own unique index value. If we recognize the index of the desired data, access of data becomes efficient. Thus, the insertion and search operations in the data structure would be fast irrespective of the data size. Hash table uses an array as a storage medium and uses hash technique to generate an index where an element is to be inserted or located from.
A binary tree is a tree data structure in which each node has at most two children, which are usually referred as the left child and the right child. Its mainly implemented using links. Unlike arrays, linked lists, stack and queues, which are also linear data structures, a binary tree is a hierarchical data structure. A tree is represented by a pointer to the top node in the tree. if the tree is empty, then value of root is NULL. A binary tree node contains data, and a pointer to both left child and right child.
One of the reasons to use binary tree or tree in general is to process a form of hierarchy. Quite useful in file structures where each files is located in a particular directory and theres a specific hierarchy associated with files and directories.
Hashing is fundamental in the creation of blockchain. If someone wants to comprehend blockchain, they must first understand hashing. The important role of cryptography in blockchain networks continues to grow. One of them is hashing, which is the process of calculating a concrete and unique data. Maybe you are familiar with the unique code found on blockchain and that is one example of hash. So in conclusion hashing table has been used in current block chain technology.
Linked list had some advantages over arrays such as dynamic size and ease of insertion/deletion.
But there are some drawbacks on using linked list as listed below:
1.) Random access is not allowed. We have to sequentially access the elements starting from the first node. So we cant do binary search efficiently with its default implementation.
2.) Each element on the list requires an extra memory space for a pointer
3.) Not cache friendly. Since array elements are contiguous locations, there is locality of reference which is not there in case of linked list.
A linked list is represented by a pointer from the first node of the linked list. The first node is called the "head". If the linked list is empty, then the value of the head is NULL. Each node in a list consists of at least data and pointer. In C, we can represent a node using structures, but in Java or C#, linked list class contains a reference of node class type.
A stack is a linear data structure where elements can be inserted and deleted only from one side of the list, called the "top". A stack follows the principle of "Last In First Out" in which the element inserted at the last is the first element to come out. The insertion of an element into stack is called push operation, while deletion of an element from the stack is called pop operation. In stack, we always keep track of the last element present in the list with a pointer called "top".
A queue is another linear data structure where elements can only be inserted from one side of the list that is "rear", and deletion of the elements can be done from the other side called the "front". The data structure of queue follows the principle of "First In First Out", in which the first element inserted in the list is the first element to be removed from the list. In a queue, the insertion of an element is called "enqueue operation", while deletion of an element is called "dequeue operation". In queue we usually prioritize two pointers, the front pointer pointing to the element which was inserted at the first and still present in the list, and the rear pointer pointing to the element inserted at the last.
Hashing is a technique to convert a range of key values into a range of array indexes. Hash table is a data structure that stores data associatively. In a hash table, data is stored in an array format, where each data value has its own unique index value. If we recognize the index of the desired data, access of data becomes efficient. Thus, the insertion and search operations in the data structure would be fast irrespective of the data size. Hash table uses an array as a storage medium and uses hash technique to generate an index where an element is to be inserted or located from.
A binary tree is a tree data structure in which each node has at most two children, which are usually referred as the left child and the right child. Its mainly implemented using links. Unlike arrays, linked lists, stack and queues, which are also linear data structures, a binary tree is a hierarchical data structure. A tree is represented by a pointer to the top node in the tree. if the tree is empty, then value of root is NULL. A binary tree node contains data, and a pointer to both left child and right child.
One of the reasons to use binary tree or tree in general is to process a form of hierarchy. Quite useful in file structures where each files is located in a particular directory and theres a specific hierarchy associated with files and directories.
Hashing is fundamental in the creation of blockchain. If someone wants to comprehend blockchain, they must first understand hashing. The important role of cryptography in blockchain networks continues to grow. One of them is hashing, which is the process of calculating a concrete and unique data. Maybe you are familiar with the unique code found on blockchain and that is one example of hash. So in conclusion hashing table has been used in current block chain technology.
Comments
Post a Comment