上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: public class 平衡二叉树{ public class TreeNode { TreeNode left; TreeNode right; int val; TreeNode(int x) { this.val = x; } } // 获取深度 private int getDepth(T 阅读全文
posted @ 2017-05-28 12:03 qingtianBKY 阅读(894) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } */ //思路: 阅读全文
posted @ 2017-05-23 23:17 qingtianBKY 阅读(184) 评论(0) 推荐(0) 编辑
摘要: package wangChaoPA实习工作练习.com.leetcode;import java.util.ArrayList;import java.util.Stack;class TreeNode{ TreeNode left; TreeNode right; int val; TreeNo 阅读全文
posted @ 2017-05-17 21:40 qingtianBKY 阅读(10379) 评论(1) 推荐(0) 编辑
摘要: package wangChaoPA实习工作练习.com.leetcode;public class InsertList{ public ListNode insertionSortList(ListNode head) { if (head == null || head.next == nul 阅读全文
posted @ 2017-05-14 20:56 qingtianBKY 阅读(166) 评论(0) 推荐(0) 编辑
摘要: //接口+抽象类+实现类package wangChaoPA实习工作练习.com.进阶篇.二叉查找树;import java.util.Iterator;public interface Tree<E extends Comparable<E>>{ // 从树中删除e boolean delete( 阅读全文
posted @ 2017-05-12 23:09 qingtianBKY 阅读(184) 评论(0) 推荐(0) 编辑
摘要: /* 使用接口+抽象类+具体类实现 ArrayList实现原理:添加元素时要判断ArrayList中是否还有多余空间,若没有 则创建大小是当前数组两倍的新数组, 然后在复制原来的数组到新数组中 LinkList实现原理:利用结点(node),当向链表中加入一个新的元素时,就会产生一个包含它的结点 类 阅读全文
posted @ 2017-05-11 15:12 qingtianBKY 阅读(267) 评论(0) 推荐(0) 编辑
摘要: package wangChaoPA实习工作练习.com.leetcode;/** * * <p> * 描述该类情况 {@link 代表跟谁有关系} * </p> * * @author 王超 * @since 1.0 * @date 2017年5月10日 下午8:16:20 * @see 新建|修 阅读全文
posted @ 2017-05-10 22:54 qingtianBKY 阅读(624) 评论(0) 推荐(0) 编辑
摘要: package wangChaoPA实习工作练习.com.进阶篇.排序;import java.util.ArrayList;/** * * <p> * 描述该类情况 {@link 代表跟谁有关系} * </p> * * @author 王超 * @since 1.0 * @date 2017年5月 阅读全文
posted @ 2017-05-10 18:34 qingtianBKY 阅读(132) 评论(0) 推荐(0) 编辑
摘要: /*一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下:首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值:Z:0 1 2 阅读全文
posted @ 2017-04-24 20:28 qingtianBKY 阅读(206) 评论(0) 推荐(0) 编辑
摘要: setw()是设置域宽的函数,默认是前面加空格右对齐。 setfill()是设置填充填充字符。 #include <iostream> using namespace std; #include <iomanip> int main() { cout<<setw(8)<<setfill('*')<< 阅读全文
posted @ 2017-04-20 20:51 qingtianBKY 阅读(2266) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页