

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


BST Tree format of given data
As root key is given that is 8 , then all less values (3,3,1,2,4)on leftSub tree and greater values (14,44,89) on RightSub tree. As each node has a key and associated value. During searching the desired key is compared to the keys in BST and if found the associated value is retrieved.
In data structure, Binary search tree is a tree in which all nodes follow the following properties. There is a one root node. Left-sub tree contain less values of its root node key. 8 10 3 14 3 44 2 89 1 5
Right-sub tree contain greater values of its root node key.
Divides all sub tree into two parts, the left sub-tree and right sub tree and write as leftSubtree(k) <= node(k) <= RightSubtree(k) First we make representation and mention root node key then all less values on left-sub tree and greater values on right-Sub tree. Operation: We can use Search , insert , preorder Traversal, In-order Traversal, Post-order Traversal Operations. In search operation start from the root node if data is less than the key value then search from leftSub tree , if greater values then search rightSub tree. In insert operation first locate proper location ,if data less then insert on leftSubtree if greater than insert on RightSubtree.
i+jk+p by using stack operations jk -> jk* i+jk* -> ijk+ ijk++d -> ijk*+p+ (postfix) First i scanned and added to postfix Then + scanned and added to stack Then j scanned and added to postfix Then * operator …but in stack + which has lower precedence than * … so * will be pushed to the stack Then k scanned and added to postfix Then + is scanned but topmost in stack is * which has higher precedence than + Then p scanned and added to postfix At the end all character scanned so we must pop remaining elements from stack and added to postfix string
structure and also use in using structure , arrays is a collection of an element values or variable