自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Gawing_的博客

Talk is cheap, show me the code.

  • 博客(21)
  • 资源 (1)
  • 收藏
  • 关注

原创 1002. A+B for Polynomials (25)

This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a p

2017-02-20 09:14:28 250

原创 1001. A+B Format (20)

Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEach input file cont

2017-02-20 08:31:47 260

原创 226. Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original tweet by Max Howe

2016-09-29 15:47:25 151

原创 167. Two Sum II - Input array is sorted

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two number

2016-09-29 15:41:40 144

原创 389. Find the Difference

Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the letter that was

2016-09-29 14:56:30 138

原创 104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.int maxDepth(struct TreeNode* root

2016-09-28 22:21:56 143

原创 258. Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has on

2016-09-28 22:07:55 163

原创 136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e

2016-09-28 21:45:03 156

原创 371. Sum of Two Integers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.int getSum(int a, int b) { int result = a ^ b;

2016-09-27 22:37:32 151

原创 292. Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the

2016-09-27 21:35:01 125

原创 338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example:For num = 5

2016-09-27 21:24:13 138

原创 21. Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.struct ListNode* mergeTwoLists(struct ListNode* l1, str

2016-09-26 22:26:56 153

原创 24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y

2016-09-26 22:25:39 119

原创 141. Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?快慢指针,但不额外占用空间的方法没找到。/** * Definition for singly-linked list. * struct ListNode

2016-09-26 22:22:39 150

原创 83. Remove Duplicates from Sorted List

For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.开始的时候想着还要free啥的,结果超时,果断去掉free,AC。。有一点需要注意,链表中有连续两个以上重复元素的处理方式。代码贴上/** * Definition for singly-linked list.

2016-09-21 23:00:52 137

原创 328. Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in

2016-09-21 22:20:06 132

原创 237. Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value

2016-09-21 20:28:54 115

原创 206. Reverse Linked List

Reverse a singly linked list.递归与指针实现代码贴上#include struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} };class Solution {public: ListNode* reverse

2016-09-21 20:27:19 143

原创 树的同构

给定两棵树T1和T2。如果T1可以通过若干次左右孩子互换就变成T2,则我们称两棵树是“同构”的。例如图1给出的两棵树就是同构的,因为我们把其中一棵树的结点A、B、G的左右孩子互换后,就得到另外一棵树。而图2就不是同构的。图1图2现给定两棵树,请你判断它们是否是同构的。输入格式:输入给出2棵二叉树树的信息。对于每棵树

2016-09-17 17:08:33 564

原创 Pop Sequence

Given a stack which can keep MM numbers at most. Push NN numbers in the order of 1, 2, 3, ..., NN and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequ

2016-09-15 17:28:34 243

原创 Reversing Linked List

Given a stack which can keep MM numbers at most. Push NN numbers in the order of 1, 2, 3, ..., NN and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequ

2016-09-12 22:19:41 330

操作系统真象还原pdf

操作系统真象还原共分16章,讲解了开发一个操作系统需要的技术和知识,主要内容有:操作系统基础、部署工作环境、编写MBR主引导记录、完善MBR错误、保护模式入门、保护模式进阶和向内核迈进、中断、内存管理系统、线程、输入输出系统、用户进程、完善内核、编写硬盘驱动程序、文件系统、系统交互等核心技术。 本书适合程序员、系统底层开发人员、操作系统爱好者阅读,也可作为大专院校相关专业师生用书和培训学校的教材

2018-04-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除