asghar

0 Reputation

2 Badges

13 years, 97 days

MaplePrimes Activity


These are replies submitted by asghar

acer 6651

You code is clean and easy to understand, And it works perfectly. Thanks a lot!

acer 6651

You code is clean and easy to understand, And it works perfectly. Thanks a lot!

We haven't learnt evalb and 'and' in thos course. Can it be done without it somehow?

We haven't learnt evalb and 'and' in thos course. Can it be done without it somehow?

The numelems is not working for some reason. I tried getListSize here. It works!!!! Thank you so much sir. I'll definately get back to you if I need more help. Have a great day!

The numelems is not working for some reason. I tried getListSize here. It works!!!! Thank you so much sir. I'll definately get back to you if I need more help. Have a great day!

And this other one, is what my proff. hinted at.

merge := proc (M1, M2)

local i, j, cp3, L3;

for i to getListSize(M1) do

for j to getListSize(M2) do

for cp3 to getListSize(M1)+getListSize(M2) do

if M1[i] < M2[j] then

L3[cp3] := M1[i];

if M2[j] < M1[i] then

L3[cp3] := M2[j]

end if

end if

end do

end do

end do

end proc 

And this other one, is what my proff. hinted at.

merge := proc (M1, M2)

local i, j, cp3, L3;

for i to getListSize(M1) do

for j to getListSize(M2) do

for cp3 to getListSize(M1)+getListSize(M2) do

if M1[i] < M2[j] then

L3[cp3] := M1[i];

if M2[j] < M1[i] then

L3[cp3] := M2[j]

end if

end if

end do

end do

end do

end proc 

It's not an assignment, it's practice for the finlas and I really need to get it done. I will paste what I tried to do :

Merge := proc (L1, L2)

local i, j, Size1, Size2, L3, S;

Size1 := getListSize(L1);

Size2 := getListSize(L2);

for i to Size1 do for j to Size2 do

if L1[i] < L2[j] then

S[i] := L3[i] = L1[i]

end if;

for i to Size1 do

for j to Size2 do

if L2[i] < L1[i] then

S[i] := L3[i] = L2[i]

end if

end do

end do

end do

end do;

return S

end proc

 

It doesn't work.

Page 1 of 1