public Node findBiggest (Node n1, Node n2){

    Node c1 = n1;
Node c2 = n2;
boolean isPositive = false;
if(n1.value == '-'){
if(n2.value != '-'){
return n2;
}
c1=n1.next;
if(n2.value == '-'){
isPositive = false;
c2=n2.next;
}
}
else{
if(n2.value == '-'){
return n1;
}
isPositive = true;
if(n2.value == '+'){
c2 = n2.next;
}
if(n1.value == '+'){
c1 = n1.next;
}
}
while(c1 != null && c2 != null){
int d1 = c1.value - '0';
int d2 = c2.value - '0'; if(d1 > d2){
if(isPositive){
return n1;
}
else{
return n2;
}
}
else if(d1 < d2){
if(isPositive){
return n2;
}
else{
return n1;
}
}
else{
c1 = c1.next;
c2 = c2.next;
}
}
if(c2 != null && isPositive){
return n2;
}
if(c2 != null && !isPositive){
return n1;
}
if(c1 != null && isPositive){
return n1;
}
if(c1 != null && !isPositive){
return n2;
}
return null;
}

Microsoft - Find Biggest Node的更多相关文章

  1. microsoft webMatrix 使用 IISnode 进行node express 开发

    微软的microsoft webMatrix是一个免费的开发工具,我们可以使用它进行node 开发并利用iisnode 模块进行iis 的nodejs网站的维护,还是比较方便的. 一个简单的node ...

  2. Installing node-oracledb on Microsoft Windows

    版本 7 由 Laura Ramsey-Oracle 于 2015-10-19 下午11:46创建,最后由 cj 于 2015-10-22 下午7:44修改. Installing node-orac ...

  3. Win10下 VS2017 安装失败 未能安装包“Microsoft.VisualStudio.AspNet45.Feature,version=15.0.26208.0”

    事情的起因是这样的,前段时间,VS2017发布当天,想在自己的Win10上安装VS2017,然而,由于自己的系统很久没有更新(PS:自己关闭了Windows更新). 安装提示:未能安装包“Micros ...

  4. GitHub实战系列~3.提交github的时候过滤某些文件 2015-12-10

    GitHub实战系列汇总:http://www.cnblogs.com/dunitian/p/5038719.html ———————————————————————————————————————— ...

  5. The .NET of Tomorrow

    Ed Charbeneau(http://developer.telerik.com/featured/the-net-of-tomorrow/) Exciting times lie ahead f ...

  6. Leetcode: K-th Smallest in Lexicographical Order

    Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n. N ...

  7. 【官档整理】Visual Studio 2017 VS2017 中文离线安装包下载

    [官档整理]Visual Studio 2017 VS2017 中文离线安装包下载 转 https://blog.csdn.net/fromfire2/article/details/81104648 ...

  8. 浅谈一下mshta在CVE-2017-11882里的命令构造

    Evi1cg同学前不久放出CVE-2017-11882的一个 python利用脚本,地址在https://github.com/Ridter/CVE-2017-11882/,不过其中一个版本里边有一个 ...

  9. git忽略除指定文件/指定后缀名文件外的文件

    不需要从头写.gitignore文件,GitHub已经为我们准备了各种配置文件,只需要组合一下就可以使用了.所有配置文件可以直接在线浏览:https://github.com/github/gitig ...

随机推荐

  1. php正则表达式的三个最基本原则分享

    我个人认为,正则表达式的常规用法可以分为如下三个最基本的原则:1.找谁.2.怎么找.3.找它干什么. 接下来,我分享一下一个正则表达式分三个部分: 原子字符 . 匹配除换行符以外的任意字符 \w 匹配 ...

  2. Win7 默认.lnk打开方式全是别的程序 还原的办法

    Xu言: no zuo no die~ 今天,一个朋友问我,他电脑桌面上点任何东西都是提示下载... - -||| 本以为是中毒了,然后上去看了一眼..发现他自己把所有.lnk 的默认打开方式选择了搜 ...

  3. javascritp文章 You-Dont-Know-JS

    https://github.com/getify/You-Dont-Know-JS 有6个系列.git在线免费. 第一本, up and going (点击链接) Mission: 作者建议在开始学 ...

  4. DOM文档对象模型

  5. 【模板/经典题型】带有直线限制的NE Latice Path计数

    平移一下,变成不能接触y=x+1. 注意下面的操作(重点) 做点p=(n,m)关于这条直线的对称点q=(m-1,n+1). ans=f(p)-f(q). 其中f(x)为从(0,0)到点x的方案数.

  6. Blog Post Rating CodeForces - 806E (线段树二分)

    题目链接 题目大意: 有一个博客, 初始分数为$0$, 有$n$个人, 第$i$个人有一个期望值$a_i$, 如果第$i$个人浏览博客时,博客赞数高于$a_i$博客分数$-1$, 低于$+1$, 相等 ...

  7. POJ 1442 treap

    裸treap. 只需增加一个size记录其儿子个数便可找到第k大数. #include <cstdio> #include <cstring> #include <cti ...

  8. ShardedJedis的使用

    假定有2个 redis 服务实例(A和B)在运行,在客户端进行 set 操作: set a0 xxx set a1 xxx set a2 xxx set a3 xxx 我们希望a0, a1, a2, ...

  9. HTTP使用 multipart/form-data 上传多个字段(包括文件字节流 octet-stream)

    自己用到的一个向服务器上传多个字段的实例,代码不全,仅做参考. 用的是WinINet,上传的字段中包括文件字节流 /* PHttpRequest中自行组装body之后,HttpSendRequest中 ...

  10. EasyGui 学习文档【超详细中文版】

    演示使用 Python 3.3.3 版本 0. 安装 EasyGui 官网:http://easygui.sourceforge.net 最新版: <ignore_js_op> easyg ...