Function to update the Binary Index Tree by replacing all ancestors of index by their respective sum with val
def updateBIT ( BITree , n , index , val ) : NEW_LINE INDENT index = index + 1 NEW_LINE DEDENT