On May 30, 2:48 pm, bhk...@gmail.com wrote:
> Code :
> -
> def mergeSort(alist):
> print("Splitting ",alist)
> if len(alist)>1:
> mid = len(alist)//2
> lefthalf = alist[:mid]
> righthalf = alist[mid:]
>
> mergeSort(lefthalf)
> mergeSort(righthalf)
On Fri, May 31, 2013 at 3:43 PM, Cameron Simpson wrote:
> On 30May2013 21:54, bhk...@gmail.com wrote:
> | One final question, Is there a way to edit the message once it has been
> posted?
>
> Essentially, no. If there's some error in a post, reply to it
> yourself with a correction. Transparency
On 30May2013 21:54, bhk...@gmail.com wrote:
| One final question, Is there a way to edit the message once it has been
posted?
Essentially, no. If there's some error in a post, reply to it
yourself with a correction. Transparency is a good thing. Revisionist
history pretty much is not.
--
Camer
Got It!!!, Finally. Thanks Dave
So, the control goes back to the place after the recursive function is called
once the no. of element is equal to one and starts merging after which it will
again start to split the remaining items.
Thank you Chris for your multiple explanations.
One final q
Got It!!!, Finally. Thanks Dave
So, the control goes back to the place after the recursive function is called
once the no. of element is equal to one and starts merging after which it will
again start to split the remaining items.
Thank you Chris for your multiple explanations. It was also ve
On 05/30/2013 08:42 AM, bhk...@gmail.com wrote:
http://wiki.python.org/moin/GoogleGroupsPython >
In the above output, the control goes to "HERE AFTER SPLIT" after the "Merging"
statement which is of-course the last statement in the function.On what condition this is happening.
Ideally
Thanks Chris, Wolfgang and Joshua for your replies.
In step 2b, all the steps from 1 through 3 are executed again (twice).
Soon, those calls will just output "Splitting" followed by "Merging";
and then we go back to 2c. That's why it *seems* that the code goes
from
On Thu, May 30, 2013 at 10:39 PM, wrote:
> Chris, Can you please let me know what makes the control of the program code
> go to 2c after the output "Merging".
It goes like this:
1. [eight element list]
2a. [eight element list]
2b. 1. [four element list]
2b. 2a. [four element list]
2b.
On Thursday, May 30, 2013 6:09:20 PM UTC+5:30, bhk...@gmail.com wrote:
> Thanks Chris, Wolfgang and Joshua for your replies.
>
>
>
> ---
>
> In step 2b, all the steps from 1 through 3 are executed again (twice).
>
> Soon, those calls will just output "Splitting" followed by "Merging";
>
> a
On Thursday, May 30, 2013 6:09:20 PM UTC+5:30, bhk...@gmail.com wrote:
> Thanks Chris, Wolfgang and Joshua for your replies.
>
>
>
> ---
>
> In step 2b, all the steps from 1 through 3 are executed again (twice).
>
> Soon, those calls will just output "Splitting" followed by "Merging";
>
> a
Thanks Chris, Wolfgang and Joshua for your replies.
---
In step 2b, all the steps from 1 through 3 are executed again (twice).
Soon, those calls will just output "Splitting" followed by "Merging";
and then we go back to 2c. That's why it *seems* that the code goes
from 3 to 2c. You'll notice th
On 30 May 2013 11:19, wrote:
> Also, Can you please let me know how did you found out that I am using Python
> 2 Interpreter.
Do you have access to a Python3 interpreter? If so, try running it and
your output will look like:
Splitting [54, 26, 93, 17, 77, 31, 44, 55, 20]
Splitting [54, 26, 9
On 30 May 2013 10:48, wrote:
> Question:
> -
> Function mergeSort is called only once, but it is getting recursively
> executed after the printing the last statement "print("Merging ",alist)". But
> don't recursion taking place except at these places "mergeSort(lefthalf),
> mergeSort(r
On Thu, May 30, 2013 at 8:19 PM, wrote:
> Thanks for the reply Chris.
>
> I am newbie to python, so please excuse me if I am asking chilly questions.
All questions are welcome!
> Can you please explain more about the following sentence.
> "When it says "Splitting" with a single-element list, it
gmail.com> writes:
>
> Thanks for the reply Chris.
>
> I am newbie to python, so please excuse me if I am asking chilly questions.
>
> Can you please explain more about the following sentence.
> "When it says "Splitting" with a single-element list, it then
> immediately prints "Merging" and
Thanks for the reply Chris.
I am newbie to python, so please excuse me if I am asking chilly questions.
Can you please explain more about the following sentence.
"When it says "Splitting" with a single-element list, it then
immediately prints "Merging" and returns (because all the rest of the
c
gmail.com> writes:
>
>
> Function mergeSort is called only once, but it is getting recursively
executed after the printing the last
> statement "print("Merging ",alist)". But don't recursion taking place
except at these places
> "mergeSort(lefthalf), mergeSort(righthalf)"
>
> Sometimes the func
On Thu, May 30, 2013 at 7:48 PM, wrote:
> Function mergeSort is called only once, but it is getting recursively
> executed after the printing the last statement "print("Merging ",alist)". But
> don't recursion taking place except at these places "mergeSort(lefthalf),
> mergeSort(righthalf)"
>
Code :
-
def mergeSort(alist):
print("Splitting ",alist)
if len(alist)>1:
mid = len(alist)//2
lefthalf = alist[:mid]
righthalf = alist[mid:]
mergeSort(lefthalf)
mergeSort(righthalf)
i=0
j=0
k=0
while ihttp://mail.
19 matches
Mail list logo