最近在用php语言实现各种数据结构算法排序,可以说是很蛋疼的一件事,最近遇到了一个问题,不知道是什么原因,姑且放到这里,希望能看到的人予以帮助

首先我用php写了这样一个类

class ListNode
{
private $val;
private $next=null; function __construct($val)
{
$this->val=$val;
} public function __get($propertyName){
return $this->$propertyName;
} public function __set($name,$value){
$this->$name=$value;
}
}

然后是一个算法

 function partitionLinkedList($head,$x){
var_dump($head);
$dummy=new ListNode(0);
$pivot=new ListNode($x);
$first=$dummy;
$second=$pivot;
$curr=$head->next; while ($curr!=null) {
// var_dump($curr);
$next=$curr->next;
echo $curr->val;
if($curr->val<$x){
$first->next=clone $curr;
$first=$curr;
$first->next=null;
}else{
$second->next=clone $curr;
$second=$curr;
$new2=new ListNode(100);
// $second->next=null;
$second->next=$new2;
}
echo "dummy";
var_dump($dummy);
echo "pivot";
var_dump($pivot);
$curr=$next;
}
$first->next=$pivot->next;
return $dummy;
} $arr=array(4,3,2,1,2,5);
$L=new ListNode(0);
$L1=$L;
foreach ($arr as $nodeval) {
// echo $nodeval." ";
$new = new ListNode($nodeval);
// echo $new->val.' ';
$L1->next=$new;
$L1=$new;
// echo $L1->val;
// echo "<br/>";
}

问题就出在第16行和第21行,下面是执行的截图

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWcAAAG8CAIAAACNI/M2AAAfh0lEQVR4nO2dQZLlNo5Ac1Un6kWdoo7gXd+jN45w+Ai17OiT+CY+R7VHs8gZWUUCIACSEiW9FxkVSooCIPvzidLnz/+xAQBE+Li6AAC4GbI1Pj7Udm0XALwEQQG2GrAGwMspFfApBawBABo/KWA3AtYAAA2vNT4ObNVdTNFe4Gkvssw6XQDo5qeRL25ru7Q+2kazXQwLAKvRtkbTDlq70xpGTABYkPIuo7iD2LAGAPxMe73GadZAGQC3wLXKq3haWfcR2/3WKCIAwMo03isp2rdKEEV73VLHPG4c4887SQAYyCpjFWsA3IWLx6o4rwGAlWG4AkAMrAEAMbAGAMTAGgAQA2sAQAysAQAxsAYAxM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CVIeiepkgjB4h+keP4rGqn5QUxwSzrRpSmiM3XZvehxAZPZwORdUpgjxCXEQeeV8YsdmZsrnrzZVrg4shP/COPJYxSh7BZFIjgKqjZON7D2IqU4U6fPRovnPVLA/uXFXTc7X+PFgVRtLOMWJW67kEx/WuHxV8M1XaSIbTJLCkpm+NfY86OuUxMBK4BcijzNiuFG4E8gCQIA8ACfIAkCCPR+O0ZdIzrMeQx3TOz6HTPPY4mvGU++9//P3+KhYGQR7Xpa17nqQNc8+k0+akvwMxlYA8ytxOHqtD+MWkYCaNIcHCIsijArWjbO7sqmrJ5rRZ2dm6btiEURvPyq8KtW0063zKfZ8XHSdI6ngvMe3URr4hj1qOmZSUm6mTV8vrJxJSbR3vkbDztqYv5wKrPFYRVMh2yPJjuiOPMVzkid38lDnU5G2be3GlBNOgaX+ePIrzK1MJyGM8F5GHysXg0NGAP1DklQd673/KHXmcxNM+0F6Ux5LJVXBdjjxO4jkfaE8a5sfmWxVArXdFXBv+ovxYIS9RhUGQR5QZ3SdcHORRprnbhruDPAAkyANAgjwAJMgDQII8ACRPJw9evKpe/Vl3G3kAnA/yAJAgDwAJ8gCQIA8ACfIAkCAPAAnyAJAgDwAJ8gCQ/A9VUQlSqSX2PwAAAABJRU5ErkJggg==" alt="" />

如图所示,当我将链表的next设置为null时,第一遍循环并没有将后续next变为null,却在第二遍循环以后将后续next变为null,不理解是为什么,所以发到这儿希望大家帮助,详细代码可以到我的github上下载(https://github.com/xzjs/interview_php/blob/master/t31.php)

php执行的困惑的更多相关文章

  1. requestAnimationFrame 执行机制探索

    1.什么是 requestAnimationFrame window.requestAnimationFrame() 告诉浏览器--你希望执行一个动画,并且要求浏览器在下次重绘之前调用指定的回调函数更 ...

  2. gen_server terminate与trap_exit

    不论是新手还是熟手,写gen_server时常会遇到terminate/2,有时执行,有时却不执行的困惑. 比如stackoverflow中的Handling the cleanup of the g ...

  3. t-SNE完整笔记

    http://www.datakit.cn/blog/2017/02/05/t_sne_full.html t-SNE(t-distributed stochastic neighbor embedd ...

  4. Bash 翻译

    Bash参考手册 目录 1简介 1.1什么是Bash? 1.2什么是shell? 2定义 3基本外壳功能 3.1 Shell语法 3.1.1外壳操作 3.1.2报价 3.1.2.1逃逸角色 3.1.2 ...

  5. 立即执行函数表达式(IIFE)

    原文地址:benalman.com/news/2010/11/immediately-invoked-function-expression/ 译者:nzbin 也许你还没有注意到,我是一个对术语比较 ...

  6. Struts2拦截器的执行过程浅析

    在学习Struts2的过程中对拦截器和动作类的执行过程一度陷入误区,特别读了一下Struts2的源码,将自己的收获分享给正在困惑的童鞋... 开始先上图: 从Struts2的图可以看出当浏览器发出请求 ...

  7. SQL Server SQL性能优化之--通过拆分SQL提高执行效率,以及性能高低背后的原因

    复杂SQL拆分优化 拆分SQL是性能优化一种非常有效的方法之一, 具体就是将复杂的SQL按照一定的逻辑逐步分解成简单的SQL,借助临时表,最后执行一个等价的逻辑,已达到高效执行的目的 一直想写一遍通过 ...

  8. javascript中异步和闭包产生的困惑

    这里我不打算大谈特谈什么是异步,什么是闭包,这些内容在博客园都已经写的够多的了,但是这些内容出现的多,并不代表所有初学者都已经撑握了,所以我还是打算,用一个比较常见的示例来分析一下,或许能让对这个问题 ...

  9. Select查询执行顺序

    链接:http://blog.jobbole.com/55086/ 很多程序员视 SQL 为洪水猛兽.SQL 是一种为数不多的声明性语言,它的运行方式完全不同于我们所熟知的命令行语言.面向对象的程序语 ...

随机推荐

  1. 遍历 集合 Dictionary 的时候修改集合 方法

    Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("1" ...

  2. 【Spark学习】Apache Spark监控与测量

    Spark版本:1.1.1 本文系从官方文档翻译而来,转载请尊重译者的工作,注明以下链接: http://www.cnblogs.com/zhangningbo/p/4137952.html

  3. 设置sonar 界面为中文环境

    sonar 默认是英文的界面 1.下载http://repository.codehaus.org/org/codehaus/sonar-plugins/l10n/sonar-l10n-zh-plug ...

  4. workstack windows to openstack

    https://www.mirantis.com/openstack-portal/express-openstack-portal/migrating-from-vmware-for-windows ...

  5. 第二百六十六天 how can I 坚持

    有些小郁闷,上班没事干,技术.要买房,还要结婚,买了房哪还有彩礼钱,还得借钱,愁人. 该咋办,毕梦琪. 哎.今天还和程秀通说好的去看房呢,整天犹豫不定的.烦. 今天平安夜啊.吃了个苹果,一生平平安安, ...

  6. 转载robots.txt的学习

    转载原地址: http://www.monring.com/seo/aspdotseo-robot.html 在国内,robots.txt文件,对于用户来说他是个可有可无的东西,也不会有人去看.但对于 ...

  7. 开发程序过程中遇到的调用Web Api小问题

    在用Umbraco Web Api开发程序时,前端使用React调用Web Api 当时是有一个页面Search.cshtml,把用React产生的脚本代码,在这个页面进行引用 写了一个Api, 调用 ...

  8. poj 3635 Full Tank? ( bfs+dp思想 )

    Full Tank? Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5857   Accepted: 1920 Descri ...

  9. OGNL stack value 值栈(主要参考官方手册)

    The framework uses a standard naming context to evaluate OGNL expressions. The top level object deal ...

  10. 提高Scrum站会效率的一个小工具

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:提高Scrum站会效率的一个小工具.