Question: how can we interchange indices and entries of a table?

for example,if we have a table T=table([aa=2, bb=3 cc=4, dd=5]),how can we get another table(2=aa,3=bb,4=cc,5=dd) ?

another question:
if we have table([aa=3,bb=5,cc=1,dd=3]),how can we output indices according to entries' ascending order?

thank you

Please Wait...