tag:blogger.com,1999:blog-1594850644649683004.post3685551049842125554..comments2024-02-15T04:15:57.260-03:00Comments on Pseudo-random tech thoughts: Merge Sort for DelphiAlexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-1594850644649683004.post-9635138937383583382015-03-16T07:28:48.289-03:002015-03-16T07:28:48.289-03:00Yes, the original Insertion Sort comes from the bo...Yes, the original Insertion Sort comes from the book. It is a modified version meant to be faster. But it clearly breaks the stability of the merge sort algorithm.Alexandre Caldas Machadohttps://www.blogger.com/profile/01461341015084340422noreply@blogger.comtag:blogger.com,1999:blog-1594850644649683004.post-22084158295054982012015-03-16T02:59:26.539-03:002015-03-16T02:59:26.539-03:00Great! I notice you simplified the insertion sort....Great! I notice you simplified the insertion sort. Was the original one from the book?<br /><br />Thanks, but I'd prefer not to use my real name because I don't link this account with my real name.dangphhttps://www.blogger.com/profile/11832580837328826375noreply@blogger.comtag:blogger.com,1999:blog-1594850644649683004.post-16446580105650676832015-03-12T11:45:53.024-03:002015-03-12T11:45:53.024-03:00Hi dangph,
the code is fixed. Please check my ne...Hi dangph,<br /><br />the code is fixed. Please check my new post about this subject. If you can give me your name, I can include it in the unit credits :-)<br /><br />Thank you very much!Alexandre Caldas Machadohttps://www.blogger.com/profile/01461341015084340422noreply@blogger.comtag:blogger.com,1999:blog-1594850644649683004.post-13880401866645492742015-03-12T10:11:24.688-03:002015-03-12T10:11:24.688-03:00Sure, please do.Sure, please do.dangphhttps://www.blogger.com/profile/11832580837328826375noreply@blogger.comtag:blogger.com,1999:blog-1594850644649683004.post-26316141760465582072015-03-12T09:36:10.623-03:002015-03-12T09:36:10.623-03:00Hi dangph,
thanks for your feedback. I'll tak...Hi dangph,<br /><br />thanks for your feedback. I'll take a look at your test case and I'll probably post the results here, OK?Alexandre Caldas Machadohttps://www.blogger.com/profile/01461341015084340422noreply@blogger.comtag:blogger.com,1999:blog-1594850644649683004.post-18338408175432265712015-03-12T05:51:01.940-03:002015-03-12T05:51:01.940-03:00If you remove the calls to the Insertion Sort, the...If you remove the calls to the Insertion Sort, then it becomes stable. But I'm not sure I trust it now.dangphhttps://www.blogger.com/profile/11832580837328826375noreply@blogger.comtag:blogger.com,1999:blog-1594850644649683004.post-39958400528947459322015-03-12T05:32:13.658-03:002015-03-12T05:32:13.658-03:00Unfortunately it doesn't appear to be complete...Unfortunately it doesn't appear to be completely stable. I wrote some DUnit tests, and one of them fails (TTestCaseMergeSort.Test10000). <br /><br />http://pastie.org/10020369dangphhttps://www.blogger.com/profile/11832580837328826375noreply@blogger.com