0 Answer
  • 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 195

Backtrace:

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/views/question.php
Line: 195
Function: _error_handler

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/controllers/Questions.php
Line: 416
Function: view

File: /home/u125378470/domains/lawhelpguru.org/public_html/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Issue with merge sort

<button aria-describedby="--stacks-s-tooltip-weqkpzyc" aria-label="Bookmark" aria-pressed="false" class="js-bookmark-btn s-btn s-btn__unset c-pointer py4 js-gps-track" data-controller="s-tooltip" data-gps-track="post.click({ item: 1, priv: 0, post_type: 1 })" data-s-tooltip-placement="right" data-selected-classes="fc-yellow-600"></button><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" height="18" viewbox="0 0 19 18" width="19"></svg>

 

I'm trying to run merge sort using python and recursion it is working fine for some cases not not working fine for most of the cases please correct me I tried and unable to find error in code.

def merge_sort(a,min,max):
    if max-min<2:
        return a[min:max]

    mid=(min+max)//2
    L=merge_sort(a,min,mid)
    R=merge_sort(a,mid,max)
    return(sort(L,R))

def sort(L,R):
    (c,m,n)=([],len(L),len(R))
    (i,j)=(0,0)
    while(i+jif i==m :
            c.append(R[j])
            j+=1
        elif  j==m :
            c.append(L[i])
            i+=1
        elif R[j]<=L[i]:
            c.append(R[j])
            j+=1
        elif L[i]1
    return c