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 c...@zip.com.au wrote:
On 30May2013 21:54, bhk...@gmail.com 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
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 ilen(lefthalf)
On Thu, May 30, 2013 at 7:48 PM, bhk...@gmail.com 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),
bhk755 at 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 function
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
code
bhk755 at 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
On Thu, May 30, 2013 at 8:19 PM, bhk...@gmail.com 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
On 30 May 2013 10:48, bhk...@gmail.com 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),
On 30 May 2013 11:19, bhk...@gmail.com 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]
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 that
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;
and then we go
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;
and then we go
On Thu, May 30, 2013 at 10:39 PM, bhk...@gmail.com 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
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
On 05/30/2013 08:42 AM, bhk...@gmail.com wrote:
SNIP lots of double-spaced googlegroups nonsense. Please read
this 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
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
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
On 30May2013 21:54, bhk...@gmail.com 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
19 matches
Mail list logo