NEW SORTING ALGORITHM W-SORT
in this new soritng algoruthm here weight is importnat
imahine we have four values 21 41 31 12
then have weight ount algotihm for them for soritng of them how thsi weight algoritm is working
imagine we have taken minumu wight we have taken one iamgainry number and count the weight of 12 then ,means we have takne 5 so 5 devide 12 getting 2 remainder
then 2 devide 5 then 1 devieve 2 then we sum up this then we use 12 to devide anhy randome taht come 31 then it devide 31 same like above happnde then sum up themas weight then others as weight we sum up them as a weights,
so how e meurae weight ther is four elements we will take first elements and otehr three to count wieght then we count weight to dveide them then we take firts minum element fidn by weight comariosn then when firts willbe chsoes we choose secodn element atrandom means if thene we use that and we will devide by that numbers the weight to fidn minmum value then we find minmum value then we chosoe because firts will have theree fro divison and seocnd wil have two for divison then third will have one for divdiaon ans coversion of their devvsison will contuenit o minimum values like if 12 we found minmum because 12 devie so self then we took then firt have three elements and we have weight of them but we choose which valeu is
in it what will have imagine we have 31 firts so 31 dveide itself nad other numbers taht will have emore then and less then,that numbers will be theres,
so 12 is less then and 32 and 45 is great then their weight will calculate to arrange them so 12 will arrange firts then 31 have 0 wigth then it ararnge after 12 then otehr 32 and 45 whose ararngent numer we dont we know only weight so weight accoridn we chosoe whihc numebr is suitable for then we sort then accoridng to them
so there si number 12 ,34,31,13,45,67,10,5,4,37
in it if array firts number is 12 then we got wieght in nemainder in negatives we devide so if wieght coud come less then 12 then these numebr will come before 12 in not ararnge mmanner so these numebr will shift but and then from that numbe wieght will chosoe whcih will be less then till teh 12 then aftre we could take and any number to works weight is like 31 devide by 12 then then 7 7devdie 12 then 5 5 dveide 7 then 2 2 dvdie 5 then 1 devide 2 tehn su up of devisors
wieght sort coudl use in ram
Comments
Post a Comment