Spread Knowledge With Simplicity..................

Blogroll

Wednesday, December 17, 2014

Tree in data structure What is tree ?

What is tree 

Definition:-  Tree is  is hierarchical (or non-linear) data structure.

                           or
Tree is a finite set of elements that is either empty or partitioned into three  disjoint subsets ,the first subset contains a single element called the  root of the tree.The other two subset are themselves tree called left and right subtree  of original tree .Each element of tree is called a node of the tree .



Important Term related with trees-


Root Node-  The First Subset or single element called root or parent node  of the tree (Such as A is the root node in above figure)

Leaf Node -  The node that has no son is called  leaf node of tree (Such as D,E,F,G are the leaf node in above fig)

Sibling- Two nodes are sibling if they have same parent (such as D,E and F,G are siblings)

Level of tree-  The level of  a node in binary tree is the number of edges  traversed from the root node to the node i.e. root has 0 level and level of any other node is one more than the level of its parents (such as level of below tree is 3 )
 

Depth of Tree-    The depth of tree is the maximum level of any leaf  in the tree ( such as depth of below tree is 4)



Climbing-  Going from the leaves to the root is called "climbing"

Descending - Going from the root  to the leaves is called descending 


Types of Tree in data structure -Binary Tree Lecture 2


Share:

Types of Binary Trees?What are the different type of Binary Tree?

Types of Binary  Trees

1. Strictly Binary Tree-

  • If Every non leaf node in binary tree has non empty left and right subtrees ,the tree term as strictly binary tree .


Important Point for Strictly Binary Tree-

  •  Every non-leaf node has degree 2
  • A strictly binary tree with n leaves has (2n -1 ) nodes 
  • Thus strictly binary tree has odd number of nodes 

2. Complete Binary Tree -


  • A complete Binary tree of  depth  d is the strictly binary tree whose all leave are at level d 
  • A Complete Binary Tree of depth d is the binary tree that contains exactly  2^l (two ki power l nodes )
  • Issi prakar kisi bhi complete Binary tree (CBT)  mein  total no of nodes (2^d+1 -1) where d is depth of tree 
  • Isse ek conclusion ye nikalta hai ki complete Binary Tree hamesha Strict Binary tree hogi but strict binary tree hamesha  complete binary tree (CBT)  nhi hogi
  • Jaisa ki hum jante hai CBT Hamesha Strict Binary tree hogi tab agar iske n leaves honge to isme total no of nodes 2n-1 honge 
Share:

Tuesday, December 16, 2014

What is Binary tree,Different type of tree in Data structure

Different type of tree in Data structure 

Binary Tree:-

  • A Binary tree is a finite set of elements that is either empty or is partitioned into three disjoint subset 
  • The First subset contains a single element called the root of the tree
  • The other two subsets are themselves binary tree ,called left and right subtrees of the original tree.
  • Each element of a binary tree called a node of the tree






          

Share:

Friday, December 5, 2014

MCQ of DBMS fundamental question

MCQ Data Base Management System on Basic  Fundamental

Q1.A Specific example where physical data independence would not hold is

  1. When data file is changed from unordered file to sorted file 
  2. When additional access  structure (Example an index ) is created for relation
  3. When DBA decides to store the data in B+ tree
  4. When the user writes an application program to join tables 

Q2.Integrity means________

  1. Protecting the data against unauthorized users
  2. Protecting data against authorized users
  3. Making sure users are allowed to do the thing they are trying to do
  4. None of These

Q3.Controlling redundancy in database management system help to 

  1. Avoid duplication of effort
  2. Avoid unnecessary wastage of storage space 
  3. Avoid Inconsistence among data 
  4. All of the above

Q4. Which of the following function not performed by DBA?

  1. Planning ,designing ,and implementation of database system
  2. Allocation of storage locations and data structures
  3. Establishing standards and procedures system
  4. Communicating with data base users

Q5.Which of the following is not an advantages of database approach ?

  1. Elimination of the data redundancy 
  2. Ability to associate related data 
  3. increased security 
  4. All of the above

Q.6 A data Dictionary doesn't provides information about 

  1. Where data is located 
  2. The size of the disk storage
  3. Who owns or responsible for the data 
  4. How data is stored 

Q7.The data base administrator is ,in effects ,the coordinator between the _____and the ____

  1. DBMS ; database
  2. Application program ; Database
  3. Database ;Users
  4. Application programs ;Users

Q.8 Which of the following is not usually part of the responsibilities of a DBA?

  1. Approving Structure changes to the database
  2. Designing data  entry screens 
  3. Ensuring that an adequate backup regime is in place
  4. Issuing Accounts to users and monitoring the performance of the system
Q9. Network Models are Complicated by
  1. Physical keys ,but the relation model is faster because it uses logical keys.
  2. Logical keys ,

Share:

BTemplates.com

BTemplates.com

Contact Us

Name

Email *

Message *

Labels