Skip to main content

Transfer google play balance to Paytm, PhonePe, Google Pay or any UPI linked bank account.

To transfer google play balance, opinion rewards or gift cards to PayPal, Paytm, PhonePe, Google Pay or any UPI ID linked bank account , you can use QxCredit :Rewards Convertor app which is available on google play store: You will get back 80% of the google play balance. App link:  https://play.google.com/store/apps/details?id=qxcoding.qx_credit_reboot Follow these steps to transfer your play balance to paypal or UPI: 1) download app from play store. 2) login with your google account and phone number. 3) choose a token amount which you want to convert/transfer. 4) Enter your payout details.(UPI ID or PayPal Email) 5) wait for an acknowledgement mail form qxcredit containing information about your purchased token. 6) you will receive the amount within 3 days. 7) if you face any issues you can raise a query on website: https://qx-credit.web.app/#/contact_support About app: Introducing QxCredit : Rewards Converter Convert /Transfer or Exchange your Google Play Balance and opini...

How to find the height of binary tree ? program (Python)

The height of binary tree is defined as MAX(depth of leaf nodes)  and depth of a node in turn is defined as (n-1) ,where n = the least number of nodes traversed through, to reach that node.
For detailed information on Implementing binary tree in python : refer here.



Definition of height function:

def height(self):
    if self.root == None:
        return 0
    else:
        return self._height(self.root, 0)

def _height(self, cur_node, cur_height):
    if cur_node == None: return cur_height
    left_height = self._height(cur_node.left_child, cur_height + 1)
    right_height = self._height(cur_node.right_child, cur_height + 1)
    return max(left_height, right_height)
Here, two functions are used one is used to check that if the binary tree exists or not , if exists then it will call the recursive function to traverse the left branch and right branch depth with respect to the root node , and then returns the bigger of the two by comparing. The value of depth(height ) of tree will be (returned value -1) to deduct the count of root node.

SOURCE CODE :
 # https://www.qxcoding.com/ 

class node:
    def __init__(self, value=None):
        self.value = value
        self.left_child = None
        self.right_child = None


class BinaryTree:
    def __init__(self):
        self.root = None

    def insert(self, value):
        if self.root == None:
            self.root = node(value)
        else:
            self._insert(value, self.root)

    def _insert(self, value, cur_node):
        if value < cur_node.value:
            if cur_node.left_child == None:
                cur_node.left_child = node(value)
            else:
                self._insert(value, cur_node.left_child)
        elif value > cur_node.value:
            if cur_node.right_child == None:
                cur_node.right_child = node(value)
            else:
                self._insert(value, cur_node.right_child)

        else:
            print("already exists")

    def print_tree(self):
        if self.root != None:
            self._print_tree(self.root)

    def _print_tree(self, cur_node):
        if cur_node != None:
            self._print_tree(cur_node.left_child)
            print(cur_node.value)
            self._print_tree(cur_node.right_child)

    def height(self):
        if self.root == None:
            return 0
        else:
            return self._height(self.root, 0)

    def _height(self, cur_node, cur_height):
        if cur_node == None: return cur_height
        left_height = self._height(cur_node.left_child, cur_height + 1)
        right_height = self._height(cur_node.right_child, cur_height + 1)
        return max(left_height, right_height)

    def delete_tree(self):
        self.root = None
        # freeing the memory will be taken care by garbage collector


if __name__ == '__main__':
    b1 = BinaryTree()
    b1.insert(5)
    b1.insert(10)
    b1.insert(6)
    b1.insert(8)
    b1.insert(3)
    b1.insert(4)
    b1.insert(2)
    b1.print_tree()
    b1.delete_tree()

if any doubts or queries please comment 🙂

Comments

Popular posts from this blog

Transfer google play balance to Paytm, PhonePe, Google Pay or any UPI linked bank account.

To transfer google play balance, opinion rewards or gift cards to PayPal, Paytm, PhonePe, Google Pay or any UPI ID linked bank account , you can use QxCredit :Rewards Convertor app which is available on google play store: You will get back 80% of the google play balance. App link:  https://play.google.com/store/apps/details?id=qxcoding.qx_credit_reboot Follow these steps to transfer your play balance to paypal or UPI: 1) download app from play store. 2) login with your google account and phone number. 3) choose a token amount which you want to convert/transfer. 4) Enter your payout details.(UPI ID or PayPal Email) 5) wait for an acknowledgement mail form qxcredit containing information about your purchased token. 6) you will receive the amount within 3 days. 7) if you face any issues you can raise a query on website: https://qx-credit.web.app/#/contact_support About app: Introducing QxCredit : Rewards Converter Convert /Transfer or Exchange your Google Play Balance and opini...

What is AI (Artificial Intelligence )? and its characteristics

Definition : Artificial intelligence  (AI) is the ability of a  computer program  or a  machine  to think and learn. It is also a field of study which tries to make computers "smart". They work on their own without being encoded with commands. Types of AI : REACTIVE MACHINES:  The most basic type of AI is purely reactive ,it does not store any memory of past or predict ( calculate ) future happenings. This type of AI is only applicable to specific applications and the principle is choosing the best decision among several options. examples: Deep Blue, IBM’s chess-playing supercomputer LIMITED MEMORY :  this type 2 kind of AI machines are distinct from reactive machine in such a way that it can make optimum decisions based on the past information ( data ). examples: self driving cars. THEORY OF MIND:  The understanding that people,creatures and objects can have thoughts or emotions which effect their own behavior. ...

How to convert google play balance to paypal or UPI [2024]

If your google account contains play balance which you might have earned from google competitions, opinion rewards or gift vouchers, you can transfer the amount to paypal account or any UPI linked bank account.  For transferring the play balance you need to follow 3 simple steps :  1) Download QxCredit app from google play store:                                 2) Purchase a token of your choice by entering the payout details :            3) View your purchase in my tokens section and wait for 72 hours for the transaction to be verified and processed. The below video demonstrates the process of purchasing a token of your choice to convert play balance: After purchasing token you will also receive a confirmation mail from QxCredit regarding the purchased token information. You can also view your purchased token on QxCredit website:...