- mst<-function(x,x1,s,t){
- if(s==t){
- x1[s]<-x[s]
- }
- else{
- m<-(s+t)/2
- x1<-mst(x,x1,s,m)
- x1<-mst(x,x1,m+1,t)
- x1<-merge(x,x1,s,m,t)
- }
- return(x1)
- }