0 Voti positivi0 Voti negativi

42 visualizzazioni5 pagineJun 26, 2012

© Attribution Non-Commercial (BY-NC)

DOC, PDF, TXT o leggi online da Scribd

Attribution Non-Commercial (BY-NC)

42 visualizzazioni

Attribution Non-Commercial (BY-NC)

- The Woman Who Smashed Codes: A True Story of Love, Spies, and the Unlikely Heroine who Outwitted America's Enemies
- Steve Jobs
- NIV, Holy Bible, eBook
- NIV, Holy Bible, eBook, Red Letter Edition
- Hidden Figures Young Readers' Edition
- Cryptonomicon
- Make Your Mind Up: My Guide to Finding Your Own Style, Life, and Motavation!
- The Golden Notebook: A Novel
- Alibaba: The House That Jack Ma Built
- The 10X Rule: The Only Difference Between Success and Failure
- Autonomous: A Novel
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- Life After Google: The Fall of Big Data and the Rise of the Blockchain Economy
- Algorithms to Live By: The Computer Science of Human Decisions
- Console Wars: Sega, Nintendo, and the Battle that Defined a Generation
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution

Sei sulla pagina 1di 5

Tree Structures

Tree ADT - Terminologies Tree traversals a. Preorder Traversal b. Inorder Traversal c. Post order Traversal Left child right sibling data structures for general trees Binary Tree ADT Types of Binary Tree 1. Left Skewed Binary Tree 2. Right Skewed Binary Tree 3. Complete Binary Tree 4. Full Binary Tree 5. Extended Binary Tree Representation or Implementation of Binary Tree 1. Linear Implementation or Sequential Implementation (using Array) 2. Linked Implementation (using Pointers i.e Linked List) Applications of trees Expression trees Binary search tree ADT a. Insert b. Delete c. Search AVL trees Four Rotations Single Rotation LL & RR Double Rotation LR & RL Binary heaps Priority Queue

Define tree. Trees are non linear data structure, which is used to store data items in a shorted sequence. It represents any hierarchical relationship between any data item. It is a collection of nodes, Which has a distinguish node called the root and zero or more nonempty subtrees T1,T2, Tk. each of which are connected by a directed edge from the root. Define Height of the tree?

The height of n is the length of the longest path from root to a leaf. Thus all leaves have height zero. The height of a tree is equal to a height of a root. Define Depth of tree? For any node n, the depth of n is the length of the unique path from the root to node n. Thus for a root the depth is always zero. Define Degree of a node It is the number of sub trees of a node in a given tree. Define Degree of a tree It is the maximum degree of a node in a given tree. Define Terminal node or leaf Nodes with no children are known as leaves. A leaf will always have degree zero and is also called as terminal node. Define Non-terminal node Any node except the root node whose degree is a non-zero value is called as a nonterminal node. Non-terminal nodes are the intermediate nodes in traversing the given tree from its root node to the terminal node. Define sibling Nodes with the same parent are called siblings. Define binary tree A Binary tree is a finite set of data items which is either empty or consists of a single item called root and two disjoin binary trees called left sub tree max degree of any node is two. Define expression tree Expression tree is also a binary tree in which the leafs terminal nodes or operands and non-terminal intermediate nodes are operators used for traversal. Construction of expression trees 1. Convert the given infix expression into postfix notation 2. Create a stack and read each character of the expression and push into the stack, if operands are encountered. 3. When an operator is encountered pop 2 values from the stack. From a tree using the operator. Define AVL tree AVL tree also called as height balanced tree .It is a height balanced tree in which every node will have a balancing factor of 1,0,1 Balancing factor Balancing factor of a node is given by the difference between the height of the left sub tree and the height of the right sub tree.

What are the various operation performed in the binary search tree ? 1.insertion 2.deletion 3.find 4.find min 5.find max What are the types of rotation? There are four types of rotations, in which two of them are the mirror images of the other two rotations. The four rotations are. Single right rotation or R-rotation Single left rotation or L-rotation Double left-right rotation or LR-rotation Double right-left rotation or RL-rotation What is priority queue? A priority queue is a data structure that allows at least the following two operations: insert which does the obvious thing; and Deletemin, which finds, returns, and removes the minimum element in the priority queue. The Insert operation is the equivalent of Enqueue Application of priority queues 1. for scheduling purpose in operating system 2. used for external sorting 3. important for the implementation of greedy algorithm, which operate by repeatedly finding a minimum. What are the main properties of a binary heap? 1.structure property 2.heaporder property Define tree traversal and mention the type of traversals? Visiting of each and every node in the tree exactly is called as tree traversal. Three types of tree traversal 1.inorder traversal 2.preoder traversal 3.postorder traversal. Define AVL trees and who was it invented by? An AVL tree is a binary search tree in which the balance factor of every node, which is defined as the difference between the heights of the nodes left and right subtrees, is either 0 or +1 or 1. the height of an empty subtree is defined as 1. AVL trees were invented in 1962 by two Russian scientists, G.M.Adelson-Velsky and E.M.Landis, after whom the data structure is named.

What are binary search trees and what is it mainly used for? Binary search tree is one of the principal data structures for implementing dictionaries. It is a binary tree whose nodes contain elements of a set of orderable items, one element per node, so that all elements in the left subtree are smaller than the element in the subtrees root and all elements in the right subtree are greater than it. What is a rotation in AVL tree used for? If an insertion of a new node makes an AVL tree unbalanced, the tree is transformed by a rotation. A rotation in an AVL tree is a local transformation of its subtree rooted at a node whose balance has become either +2 or 2; if there are several such nodes, then the tree rooted at the unbalanced node that is closest to the newly inserted leaf is rotated. What are the drawbacks of AVL trees? The drawbacks of AVL trees are . Frequent rotations .The need to maintain balances for the trees nodes. Overall complexity, especially of the deletion operation. What is a heap? A heap is a partially ordered data structure, and can be defined as a binary tree assigned to its nodes, one key per node, provided the following two conditions are met .The trees shape requirement-The binary tree is essentially complete, that is all the leaves are full except possibly the last level, where only some rightmost leaves will be missing. The parental dominance requirement-The key at each node is greater that or equal to the keys of its children What is the main use of heap? Heaps are especially suitable for implementing priority queues. Priority queue is a set of items with orderable characteristic called an items priority, with the following operations. Finding an item with the highest priority Deleting an item with highest priority Adding a new item to the set Give three properties of heaps? The properties of heap are There exists exactly one essentially complete binary tree with n nodes. Its height is equal to log2n . The root of the heap is always the largest element What is a min-heap? A min-heap is a mirror image of the heap structure. It is a complete binary tree in which every element is less than or equal to its children. So the root of the min-heap contains the smallest element.

What is a binary tree extension and what is its use? The binary tree extension can be drawn by replacing the empty subtrees by special nodes in a binary tree. The extra nodes shown as little squares are called external & the original nodes shown as little circles called internal. The extension of a empty binary tree is a single external node. The binary tree extension helps in analysis of tree algorithms. A full binary tree (sometimes proper binary tree or 2-tree) is a tree in which every node other than the leaves has two children A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. Differentiate Complete binary tree vs full binary tree? A full tree is a tree where all nodes except the leaves have the maximum number of children. For a BST, that would be two children per node. A complete tree is the same thing, except that the bottom level does not need to be full. It can be missing leaf nodes, however the ones present must be shifted to the left. Skewed tree search The worst possible binary tree structure is one that is completely skewed either to the left (no node has a right child) or to the right (no node has a left child). This happens when the values to be inserted arrive in descending or ascending order, respectively. Searching in such a tree degenerates to a sequential linear search of O(N).

- data_structures_in_java.pdfCaricato daSrivenu Chinna
- Data Structures VIVA Questions and AnswersCaricato daAchyuth Koteswarao
- Tree TopologyCaricato daRampotz Ü Echizen
- Data StructureCaricato daditivengu
- Manual JkCaricato dacapitan_barboza
- Algorithms for Bandwidth Efficient Multicast Routing InCaricato daMazhaic Maham
- Add Own Content to the EWM Warehouse Management MonitorCaricato dashravan1980
- Data Structure Lec29 HandoutCaricato daJʋŋaiɗ Aĸɓar
- IJCER (www.ijceronline.com) International Journal of computational Engineering researchCaricato daInternational Journal of computational Engineering research (IJCER)
- Tree_JLDCaricato daAbhishek Dutta
- Tree_material(3_classes).pdfCaricato daNaveen Gowdru
- Data Structure Lec28 HandoutCaricato daJʋŋaiɗ Aĸɓar
- L14Caricato daAmneet Arora
- algotest.docxCaricato daAditya Mishra
- RpmsCaricato dah_romeu_rs
- ALL_88NVCaricato daRulas PD
- ShoaibJ-9Caricato daShoaib Adil
- Adaptive Stream Mining Pattern Learning and Mining From Evolving Data StreamsCaricato dae-cevik
- UntitledCaricato daapi-127299018
- csequiz2019.txtCaricato daAbhisek Gour
- 04220788Caricato daanandr50
- H13-solution[www.alirezaweb.com].pdfCaricato daVahid Esmaeilzadeh
- ClassificationCaricato daanurag3069
- Pairing Heaps AnalysisCaricato daIonut Marin
- decision treesCaricato daSaiindra Reddy
- csc121Caricato daIvan Chiu
- B+Tree (1)Caricato damd azhar
- Ttd 2011010163Caricato dabushra_zm
- UNIT - IVCaricato daJit Agg
- lPertemuan IV.pptCaricato daPutri Cimo

- Polynomial Addition & Doubly Linked ListCaricato daSHIVALKAR J
- Pareto ChartsCaricato daSHIVALKAR J
- R cheatsheet Data WranglingCaricato daarekbee
- How to Remove White Bacground in an ImageCaricato daSHIVALKAR J
- Running Java Servlet Program Using Apache Tomcat Server- A Layman ApproachCaricato daSHIVALKAR J
- Becton Dickinson: Designing the New Strategic, Operational, and Financial Planning ProcessCaricato daSHIVALKAR J
- Calculation of p Values for One and Two Tailed Test From z ScoreCaricato daSHIVALKAR J
- Business Modelling and Simulation Project-Two Server Two Queue using @RiskCaricato daSHIVALKAR J
- LG DVD WRITER INSTALLATIONCaricato daSHIVALKAR J
- Database Management SystemsCaricato daSHIVALKAR J
- Object Oriented Analysis and Design Lab ManualCaricato daSHIVALKAR J
- Cs 2307 Network Lab Final ManualCaricato daShankar
- System Software Lab ManualCaricato daSHIVALKAR J
- CA Unit4 Notes WithDiagramsCaricato daSHIVALKAR J
- Java Lab ManualCaricato daSHIVALKAR J
- Microprocessor Lab ManualCaricato daSHIVALKAR J
- Nokia 3100 User guideCaricato daSHIVALKAR J
- Hard Disk FailureCaricato daSHIVALKAR J
- CA Unit4 Notes Without DiagramsCaricato daSHIVALKAR J
- Unit 2 Uid NotesCaricato daSHIVALKAR J
- Blu RayCaricato daSHIVALKAR J
- Binary Serach TreeCaricato daSHIVALKAR J
- Distributed Systems SyllabusCaricato daSHIVALKAR J
- Physical Storage MediaCaricato daSHIVALKAR J
- Stack using linked listCaricato daSHIVALKAR J
- Stack using arrayCaricato daSHIVALKAR J
- Principles Of Communication ComparisonCaricato daSHIVALKAR J
- Perintah Pada Command PromptCaricato damadangkara2011

- configuring_raid_for_optimal_perfromance_11.pdfCaricato dam074h3u5
- Beginner User GuideCaricato dasekadara
- Commentary on Preservation, Management and Identification of Sources of Information That Are Not Reasonably AccessibleCaricato daPayal S
- Sap Basis MaterialCaricato daCK Lim
- ER Banking systemCaricato daRongeet Sodhi
- gratisexam.com-VMware.PracticeTest.2V0-01.19.v2019-04-16.by.Joanna.31qCaricato dahzzbg1
- MVMC_cmdletsCaricato daRobercy Alves
- FDP on WSN Data Fusion for Support of IoT Data Analysis With Hands on PracticeCaricato daraz_939
- Visilogic Function BlocksCaricato dacreatrios
- Embedded SQL and Dynamic Sorting SubfilesCaricato darachmat99
- CsNtutorial.pdfCaricato darute silva
- Factors to Consider When Buying a Personal ComputerCaricato daAgrippa Mungazi
- ERPGenie.com ABAP Tips and Tricks DatabaseCaricato daVizhi Arasi
- Step by Step Procedure to Create Logical File Name and Logical File PathCaricato dapopurisapsd
- Co Gate ExamCaricato dajyothibellaryv
- Red Hat OpenStack Platform 10 Architecture GuideCaricato daKarthik Sunkesulapati
- ARM7vCCaricato daMaansi Bhasin
- Weblogic Stdout Rotaion ProblemsCaricato davali07
- [Doi 10.1109%2FCSNT.2014.149] Rajpoot, Manali Singh; Patel, Pratik -- [IEEE 2014 International Conference on Communication Systems and Network Technologies (CSNT) - Bhopal, India (2014.04.7-2014.04Caricato daanant_nimkar9243
- Introduction to Barcodes by ByteScoutCaricato dacomputerjin
- ConfigCaricato daLeonardo De Luca
- New Microsoft Word Document (2).docxCaricato daBratu Alexandru
- 20765C_05.pptxCaricato dadouglas
- Beyond Trust Capacity Planning GuideCaricato daPilod
- acctonCaricato daasfgh
- 0000 Data Management and Data Life Cycle UNHCRCaricato daandromter
- Treeview TutorialCaricato daFábio José Araújo
- 1. Core JavaCaricato daRatika Miglani Malhotra
- turbo3Caricato daKarthik Mohan K
- CIS CentOS Linux 7 Benchmark v2.2.0Caricato daSandro Melo

## Molto più che documenti.

Scopri tutto ciò che Scribd ha da offrire, inclusi libri e audiolibri dei maggiori editori.

Annulla in qualsiasi momento.