摘要: Problem:Remove all elements from a linked list of integers that have value val;ExampleGiven :1->2->6->3->4->5->6 val=6Return:1->2->3->4->5Solution: 1 ... 阅读全文
posted @ 2016-01-18 21:52 尾巴草 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Problem:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. ... 阅读全文
posted @ 2016-01-18 21:17 尾巴草 阅读(283) 评论(0) 推荐(0) 编辑
摘要: Problem: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... 阅读全文
posted @ 2016-01-18 21:00 尾巴草 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目描述:请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。Solution:#include using namespace std;void replaceBlank(char str[],i... 阅读全文
posted @ 2016-01-18 20:24 尾巴草 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Problem:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are s... 阅读全文
posted @ 2016-01-18 16:04 尾巴草 阅读(118) 评论(0) 推荐(0) 编辑