Microsoft - Find Biggest Node

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的更多相关文章
- microsoft webMatrix 使用 IISnode 进行node express 开发
微软的microsoft webMatrix是一个免费的开发工具,我们可以使用它进行node 开发并利用iisnode 模块进行iis 的nodejs网站的维护,还是比较方便的. 一个简单的node ...
- Installing node-oracledb on Microsoft Windows
版本 7 由 Laura Ramsey-Oracle 于 2015-10-19 下午11:46创建,最后由 cj 于 2015-10-22 下午7:44修改. Installing node-orac ...
- Win10下 VS2017 安装失败 未能安装包“Microsoft.VisualStudio.AspNet45.Feature,version=15.0.26208.0”
事情的起因是这样的,前段时间,VS2017发布当天,想在自己的Win10上安装VS2017,然而,由于自己的系统很久没有更新(PS:自己关闭了Windows更新). 安装提示:未能安装包“Micros ...
- GitHub实战系列~3.提交github的时候过滤某些文件 2015-12-10
GitHub实战系列汇总:http://www.cnblogs.com/dunitian/p/5038719.html ———————————————————————————————————————— ...
- The .NET of Tomorrow
Ed Charbeneau(http://developer.telerik.com/featured/the-net-of-tomorrow/) Exciting times lie ahead f ...
- 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 ...
- 【官档整理】Visual Studio 2017 VS2017 中文离线安装包下载
[官档整理]Visual Studio 2017 VS2017 中文离线安装包下载 转 https://blog.csdn.net/fromfire2/article/details/81104648 ...
- 浅谈一下mshta在CVE-2017-11882里的命令构造
Evi1cg同学前不久放出CVE-2017-11882的一个 python利用脚本,地址在https://github.com/Ridter/CVE-2017-11882/,不过其中一个版本里边有一个 ...
- git忽略除指定文件/指定后缀名文件外的文件
不需要从头写.gitignore文件,GitHub已经为我们准备了各种配置文件,只需要组合一下就可以使用了.所有配置文件可以直接在线浏览:https://github.com/github/gitig ...
随机推荐
- [.NET开发] C# 如何在PDF文档中创建表格
表格能够直观的传达数据信息,使信息显得条理化,便于阅读同时也利于管理.那在PDF类型的文档中如何来添加表格并且对表格进行格式化操作呢?使用常规方法直接在PDF中添加表格行不通,那我们可以在借助第三方组 ...
- WPF如何给窗口Window增加阴影效果
https://blog.csdn.net/w_sx12553/article/details/45072861
- Android之EventBus1.0 和EventBus3.0的使用详解
当Android项目越来越庞大的时候,应用的各个部件之间的通信变得越来越复杂,那么我们通常采用的就是Android中的解耦组件EventBus.EventBus是一款针对Android优化的发布/订阅 ...
- ubuntu64位库
安装 12.04ubuntu32位库:sudo apt-get install ia32-libs
- 原生JS和jQuery版实现文件上传功能
<!doctype html> <html lang="zh"> <head> <meta charset="utf-8&quo ...
- linux和window是文件挂载
1. 首先在windows下面创建share文件夹并设置共享(右键->属性->共享)2. 确认ubuntu安装了mount.cifs,apt-get install mount.cifs ...
- React Js之组件(Component)与state
React Js组件: 组件(Component)是为了更好的维护我们的应用,可以在不影响其他的组件的情况下更新或者更改组件. state:是标记数据的来源,我们使state比较简单和单一,如果我们有 ...
- Amaze UI 发布基于jQuery新版本v2.0.0之web组件
首先Amaze Ui第一版时我收到邮件邀请去试用,去了官网看了下,是基于zepto.js的一个类似bootstrap的响应式框架,提到框架当然是好事,快速开发呗.这词2.0的弃用zepto.js改用j ...
- 使用简单的python语句编写爬虫 定时拿取信息并存入txt
# -*- coding: utf-8 -*- #解决编码问题import urllibimport urllib2import reimport osimport time page = 1url ...
- Delphi 项目 结构 文件夹 组织
Delphi Project Structure Folder Organization http://delphi.about.com/od/delphitips2008/qt/project_la ...