导航

上一页 1 ··· 5 6 7 8 9 10 11 12 下一页

2016年3月31日

摘要: Reverse a singly linked list. 题目:翻转一个单向链表 很简单,不过要注意设置两个辅助指针变量 阅读全文

posted @ 2016-03-31 01:05 CSU蛋李 阅读(103) 评论(0) 推荐(0) 编辑

摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文

posted @ 2016-03-31 00:58 CSU蛋李 阅读(105) 评论(0) 推荐(0) 编辑

摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the 阅读全文

posted @ 2016-03-31 00:49 CSU蛋李 阅读(150) 评论(0) 推荐(0) 编辑

2016年3月30日

摘要: 如果一个字母延伸到中线之上,如d或f,则称其有上出头部分。如果一个字母延伸到中线之下,如p或g, 则称其有下出头部分。编写程序,读入一个单词,输出最长的即不包含上出头部分,也不包含下出头部分单 词。 // 9_49.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"# 阅读全文

posted @ 2016-03-30 18:21 CSU蛋李 阅读(261) 评论(0) 推荐(0) 编辑

摘要: Each rectangle is defined by its bottom left corner and top right corner as shown in the figure. Assume that the total area is never beyond the maximu 阅读全文

posted @ 2016-03-30 01:49 CSU蛋李 阅读(127) 评论(0) 推荐(0) 编辑

摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文

posted @ 2016-03-30 00:43 CSU蛋李 阅读(129) 评论(0) 推荐(0) 编辑

2016年3月29日

摘要: Invert a binary tree. to Trivia:This problem was inspired by this original tweet by Max Howell: 这个题目只要实现一个递归调用即可 阅读全文

posted @ 2016-03-29 10:59 CSU蛋李 阅读(114) 评论(0) 推荐(0) 编辑

摘要: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文

posted @ 2016-03-29 01:52 CSU蛋李 阅读(124) 评论(0) 推荐(0) 编辑

摘要: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 像1->2->1,1->2->2->1,1,NULL这种都是回文链表 阅读全文

posted @ 2016-03-29 01:17 CSU蛋李 阅读(143) 评论(0) 推荐(0) 编辑

2016年3月28日

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文

posted @ 2016-03-28 01:53 CSU蛋李 阅读(196) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 下一页