- 1 100 Swapping Algorithm Start Read X Y Store The Value Of Xin A New Variable 2 Z X Swap X With Y Transfer The Value 1 (26.08 KiB) Viewed 51 times
1. [%100] Swapping Algorithm START READ X Y Store the value of Xin a new variable 2 Z-x Swap X with Y Transfer the value
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. [%100] Swapping Algorithm START READ X Y Store the value of Xin a new variable 2 Z-x Swap X with Y Transfer the value
1. [%100] Swapping Algorithm START READ X Y Store the value of Xin a new variable 2 Z-x Swap X with Y Transfer the value of X stored in 2 to variable YAZ PRINT XY END The flowchart given above is the flowchart of swapping algorithm to exchange values of variable using a third variable. Although this algorithm is working and accurate, it is not used in the computer hardware. In the computer architecture, algorithms to swap two numbers without using third variable are used. There are various swapping algorithms without using a third variable in the literature. Study those algorithms, understand how they work draw one of its flowchart and write a Matlab program performing your algorithm