首页 | 本学科首页   官方微博 | 高级检索  
     检索      

免用第三变量的两变量值交换
引用本文:徐金建,汤彬.免用第三变量的两变量值交换[J].广西科学院学报,2004,20(2):55-56,63.
作者姓名:徐金建  汤彬
作者单位:东华理工学院,江西临川,344000
摘    要:针对采用第三变量两变量值的交换占用多余内存的不足,提出算术运算法、布尔型变量的交换法、异或运算法和异或运算取反法等4个免用第三个临时变量的两变量值交换方法,并分析这些方法的优缺点。关键词:变量交换第三变量异或运算

关 键 词:第三变量  两变量值交换  异或运算取反法  算术运算法  布尔型变量交换法  程序设计
收稿时间:2003/9/27 0:00:00

Swap of Two Variables without the Third Variable
Xu Jinjian and Tang Bin.Swap of Two Variables without the Third Variable[J].Journal of Guangxi Academy of Sciences,2004,20(2):55-56,63.
Authors:Xu Jinjian and Tang Bin
Institution:East China Institute of Technology, Linchuan, Jiangxi, 344000, China and East China Institute of Technology, Linchuan, Jiangxi, 344000, China
Abstract:To solve the problem of taking surplus of memory in swapping two variables using the third variable,the methods of arithmetic algorithm,swapping of boolean type variables,XOR and negated XOR are suggested.The advantages and disadvantages of these methods are discussed.
Keywords:swap of variables  the third varcable  XOR  
本文献已被 CNKI 维普 万方数据 等数据库收录!
点击此处可从《广西科学院学报》浏览原始摘要信息
点击此处可从《广西科学院学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号