Posts

Showing posts from April, 2017

What is the difference between a binary tree and a binary search tree?

Image
Binary Tree  - the Binary tree is a data structure in which every node have at most 2 children (i.e either 0 children, 1 child or 2 children). More details [1] Binary Search Tree  - It is an application of Binary Tree, in which we search element in the Binary tree. Binary search tree is different from a binary tree. In Binary Search Tree value of a left child is less than root node and value of a right child is greater than or equal to the value of root node. Footnotes [1]  Binary Trees

What is the difference between spooling, buffering and caching in OS?

Spooling:  Simultaneous peripheral operation online, an acronym for this is Spooling. A spool is a kind of buffer that holds the jobs for a device till the device is ready to accept the job. Spooling considers disk as a huge buffer that can store as many jobs for the device till the output devices are ready to accept them. Buffering: The  buffer  is an area in the  main memory  that is used to store or hold the data  temporarily  that is being transmitted either between two devices or between a device or an application. In simple words, buffer temporarily stores data that is being transmitted from one place to another. The act of storing data temporarily in the buffer is called buffering.Buffering helps in  matching the speed between the sender and receiver  of the data stream. If the sender’s transmission speed is slower than receiver, then a buffer is created in main memory of the receiver, and it accumulates the bytes received from the...

What is the importance of the AVL tree?

Image
AVL Tree (Hight - Balance Tree) It is nothing but a  Binary Search Tree  (BST) with balance factor. Balance Factor can be -1, 0, 1. Balance Factor Hight of left subtree - Hight of Right subtree. Application of AVL tree It is use to perform searching in O(log n) Time complexity. Importance of AVL tree Searching can be done by  Binary Search Tree  (BST) but if element are already sorted BST take form of chain and time complexity is O(n). To overcome this problem AVL tree is introduced. Due to balance factor it never take a form of chain, in fact AVL tree is nearly complete Binary tree. Operations like Insertion, Deletion, Searching in a tree take O(log n) Time in worst case and Average case.