Here the two variables are swapped in a single statement . The cost is reduced than the known swapping methods.
- Temporary variables are not used.
- addition and subtraction only.
- can be used for any data types and this is efficient than the normal methods.
- time is saved.
- space is saved.
- complexity reduced.