Re: [R] Please correct my iterative merge sort code. The lack of recursion in the code is the main condition.

2019-12-16 Thread Jeff Newmiller
The Posting Guide is pretty clear about "no homework" (it is also clear that this is a plain text mailing list). I think the recent replies to the OP have been clear on how this should be approached. I don't know what the OP "intends", but isolated (not replies to the original message) emails

Re: [R] Please correct my iterative merge sort code. The lack of recursion in the code is the main condition.

2019-12-16 Thread Henrik Bengtsson
Folks on this list, this is my personal opinion, but please refrain from answering this person's requests. It's pretty clear by now that they are misusing your good intentions of trying to help people interested in R to get their homework-like "questions" answered. There are no indications that

[R] Please correct my iterative merge sort code. The lack of recursion in the code is the main condition.

2019-12-16 Thread Александр Дубровский
mrg <- function(A,B){ R <- c() while(length(A)>0 length(B)>0){ if(A[1](x%/%2)){ W <- c(W,mrg(R[(j+1):(j+(x%/%2))],R[(j+(x%/%2)+1):length(R)])) } if((length(R)%%x)<=(x%/%2) && (length(R)%%x)!=0){ W <- c(W,R[(j+1):length(R)]) } x <- x*2 R <- W W <- c()