Posts

Showing posts from March, 2020

Binary Search Tree(BNS)

Image
BNS is also known as versions of sorted version of binary tree for the node of the left subtree is contain smaller number than those store in x for the node of the right subtree is contain greater number than those store in x there are three operation in BNS: insert() search() remove() The insert of BNS is to store is done recursively. let the new node's key be X, then we have a number of 30 of the beginning of the first node. if the node key input is smaller it will move the node to the left subtree side, if the node key is greater than it will move to the right subtree side. here is the example:- Now we will discuss search of BNS or can be call find of BNS. The search is pretty easy it just finds the node key of the X in the tree. if the search found the node it search then it will print the "the node key is found in the tree". The search algorithm is pretty much similar to insert but it job not to insert but to find only. La...

Summary of Hashing in Data Structure

Image
What is Hashing? Hashing is the process of mapping large amount of data item to smaller table with the help of hashing function. Hashing is also known as  Hashing Algorithm  or  Message Digest Function . It is a technique to convert a range of key values into a range of indexes of an array. It is used to facilitate the next level searching method when compared with the linear or binary search. Hashing allows to update and retrieve any data entry in a constant time O(1). Constant time O(1) means the operation does not depend on the size of the data. Hashing is used with a database to enable items to be retrieved more quickly. It is used in the encryption and decryption of digital signatures. What is Hash Function? A fixed process converts a key to a hash key is known as a  Hash Function. This function takes a key and maps it to a value of a certain length which is called a  Hash value  or  Hash. Hash value represents the original string...

Pengertian kelas besar tentang head, curr, tail

Image
  The topic I learn today in Big class is about the concept position of where will our pointer be directed at when we have head, curr, and tail.   Let say we have a singly link list that we want to make a push insertion.To make it happen we need to know where our address is first before we start making push insertion. The push insertion will be pushing from the front(beginning) and make a pop will be delete address. struct node{   int data; // value   struct node *next, *prev; // address }*head,*curr,*tail; void push(int a) {     curr = (struct Data*)malloc(sizeof(struct Data));//create address     curr->value = a;//insert value input a         if(head==NULL){// if head don have any address then we create one         head = tail = curr;     }     else{         tail->next = curr;// move tail to curr         curr->...