Question

Create AVL tree for the following keys inserted in the order:
 5, 15, 3, 25, 10, 2, 35, 7, 45, 30, 12, 20, 14
 Further, delete the keys 2, 5, 7, and 8. Show all the intermediate steps.

07 Aug 2023
Answer :
Word Count : 1056

Creating and manipulating an AVL tree involves a series of rotations and adjustments to ensure that the tree remains balanced. Here's a step-by-step walkthrough of how to create an AVL tree with the given keys and perform the specified deletions:

1. Insertion of Keys:
   Insert the keys in the order provided: 5, 15, 3, 25, 10, 2, 35, 7, 45, 30, 12, 20, 14.

   After inserting 5:
   ```
        5
   ```

   After inserting 15:
   ```
        5
         \
         15
   ```

   After inserting 3:
   ```
        5
       / \
      3   15
   ```

   After inserting 25:
   ```
        5
       / \
      3   15
           \
      ___ ___ ______ __________ _________ __________ ___ ______ ____ __________.
__________ _____ _________ _________ __________ __________ ________ _________ _________.
__________ _______ _____ _____ ___ _______ _____ ___ ______ _______.
___ ____ ________ _____ _______.
__________ ___ ____ ____ __________ ____ _____ ____.
__________ ____ ___ ______ _____ ___.
_______ _________ _________ ______ _______ ___ ______ _______ _____.
_______ ________ _______ _______ ___ _________ ________.
___ _____ _________ ______ ____ ______ ____ ________ _____ _____.
_________ ______ ____ _____ _____ _______ ______ _________.
________ ____ _____ ____ ___ _____ _________ __________ __________.
___ _____ ____ ____ ________ _____ ______ ___ _______.
__________ _____ _________ ______ ________ ____ ___.
_______ ___ _________ ____ ___ ___ ____ ________ __________.
____ ____ ___ ________ ________ ______ _________ _______ ___ _________ ________ _____.
________ _____ ___ _____ ______ _______ _________ _____ _______ ____ _______ ______.
__________ ______ _______ ____ ______ ______.
__________ __________ ____ ____ _____.
_________ _______ _______ _______ __________ ____ ________ ______.
__________ __________ ___ ___ __________ _________.
________ ______ ___ _____ ____ ____ _________.
_________ _______ ___ ___ ____ ______ ____ ______.
_______ ___ ______ _______ _________ _____ __________ ___ _________.
____ __________ ______ ________ ___ ___ _________ _______ __________ __________ __________.
__________ _____ _________ ___ ____ ___ __________.
________ _______ ______ ____ _______ _____ __________.
___ ______ ___ ___ _______ ___.
________ ___ ________ ___ ________ _____.
_______ _____ _______ ________ ______ _____ _______ _________ _______ __________ _______ ___.
_____ ________ _______ ________ ________ _________ ______.
______ ________ ________ _______ __________ _____ __________ _______ _________ ______ __________.
_______ ________ _________ __________ __________ _____ _________ ____ ______ ________ ________.
___ ________ ____ _____ ____.
_____ _____ ____ ______ ________ ____ _______ ________ _____ __________.
____ __________ ___ ___ __________ ___ _________ ____ ____ ______ _______.
____ _________ ______ _______ _________.
_________ __________ _____ ____ _____ ______ ______ __________ _______ ___ ____ _____.
______ _______ __________ ________ ________ _______ _______ _______ ________ ________ _______ _________.
______ ____ ___ __________ _____ _______ ___ ___ ____ _____ _________.
___ _______ ___ ________ ______.
________ ______ ________ ____ ____ ___ ________.
__________ _______ ___ ______ __________ ____.
___ ______ __________ _________ ______ ________ _____ ____ _____.
______ ____ ___ _____ ____ ___ ______.
_______ _____ _________ ______ ______ ____ ____ ______ ________ ______ _________.
_____ _____ ____ _________ _______ ___.
__________ ___ ________ ___ _______ ____ _____ ______ ________.
_______ ________ ______ ___ __________ __________ ______.
_____ ___ ___ ______ ____.
___ ______ _________ ___ __________ _________ _________ _________ ____ ____.
___ _____ ____ _________ __________.
_________ _________ _______ ______ _____ ___ ______ __________.
_____ __________ ______ __________ _____ _____ __________ __________.
___ ________ _________ ________ ________ ______ ________.
___ _______ _______ ____ ___ ____ ______ _________ ________ __________ _______.
_____ ________ ____ _______ ____ __________ _______ _______ _________ _____ _____.
_____ _________ ________ ___ _________ ______.
__________ _______ _______ _________ _____ _____ ____ _________ ___ _____ _____ ________.
_________ _________ _________ _________ _______ ________ _______ ______ _______ ____.
________ _______ __________ ___ ______ __________.
__________ ______ _______ ________ _____ __________ _________.
_________ ________ _____ ____ _______ ____ ___ ________ _______ ___ _________ ___.
______ ___ ___ _______ ____ ____ _____ __________ ____ _____ __________.
________ ________ _________ _______ ______ _________ ______ _______.
______ _________ _________ _______ _________ _____ _________ ______ _____ _________.
__________ __________ ______ ____ _________.
_____ _________ _________ ___ _____ ______ _______ _______ ________.
______ ____ _______ __________ _____ _______ _________ _____ ______ __________ ________.
___ _____ __________ _____ ___.
________ ____ _______ _________ _______ _____ ____ _____ ________.
________ ___ ________ _____ ________ __________ __________ ___ ___ __________ ____ _________.
______ ______ ____ ___ ____ _________ ___ ______ ______ _________ _______.
____ __________ ____ _________ ______ _______ _____ ____.
______ _____ _______ ______ __________ _________ ____ ______ ________ ____ _________ _________.
_____ ____ ________ _________ ______.
_________ __________ __________ ______ ________.
__________ ______ ______ ___ ____ ___ ____ ______ ___ ___.
____ ________ _________ __________ _________ ______.
______ _____ ___ ________ ____ ____ _______ ___ ________ _________ _____.
_______ _____ _____ _________ _______ ____ _____ ________ ____ __________ __________.
_____ _____ _________ ________ _____.
___ ____ ___ ___ _____ _______ ________ ___ ____ ___.
______ ________ ____ _________ ________ ________ ___ ___.
_______ _________ _____ ____ _____.
_________ __________ __________ ____ _____ ___ __________ _____ _________ _________.
______ ___ ___ _______ _____ ________ ________ ______ _______ __________.
___ ________ __________ _________ _______ ______ ___ __________ _____ _________ _____.
____ _________ ______ _____ _________.
____ _______ __________ ________ _________.
_________ _____ ______ __________ ________ ____ _______ _____ ____ __________ ________ _________.
___ ________ __________ ______ ____ _______ ____ _______ __________.
________ __________ _________ __________ _______ ___ ____ ___ _______ _______.
_______ _____ ____ _______ _______ ____ _______.
________ ___ __________ _________ ________ ________ __________ _____ __________ ____ ______.
____ _________ __________ ____ ____ _____ ______ _________ ________ _______ _________ _______.
______ _________ __________ __________ ______ _______ ___ _____ ________ _____ __________.
____ ____ ________ __________ ___ ______ ____ __________ __________ ________ _______ _________.
__________ _____ ___ _____ ____ ____ ______ ____ ____ ________.
_____ _____ _______ _________ ________.
_______ _______ ___ __________ _____ ____.
_____ ______ _____ ____ __________ ________ __________ __________.
______ _______ _______ ___ ____ _____ _______ ______ _________.
_________ __________ ___ ______ ____ ____ ______ ________ _______ ______.
_______ _________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Create AVL tree for the following keys inserted in the order: 5
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→