导航

上一页 1 ··· 4 5 6 7 8

2015年7月30日

摘要: 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 o... 阅读全文

posted @ 2015-07-30 21:13 骄阳照林 阅读(104) 评论(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.top()... 阅读全文

posted @ 2015-07-30 20:25 骄阳照林 阅读(149) 评论(0) 推荐(0) 编辑

摘要: Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as shown ... 阅读全文

posted @ 2015-07-30 16:42 骄阳照林 阅读(92) 评论(0) 推荐(0) 编辑

摘要: Reverse a singly linked list.解法一:记录单链表每个节点的val,然后重新为单链表赋值。(取巧,仅仅是将val部分改变,原始node节点并没有改变)代码如下:/** * Definition for singly-linked list. * public class L... 阅读全文

posted @ 2015-07-30 15:35 骄阳照林 阅读(105) 评论(0) 推荐(0) 编辑

摘要: Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文

posted @ 2015-07-30 14:08 骄阳照林 阅读(130) 评论(0) 推荐(0) 编辑

2015年7月27日

摘要: Description:Count the number of prime numbers less than a non-negative number,n.Credits:Special thanks to@mithmattfor adding this problem and creating... 阅读全文

posted @ 2015-07-27 19:17 骄阳照林 阅读(105) 评论(0) 推荐(0) 编辑

摘要: Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文

posted @ 2015-07-27 15:50 骄阳照林 阅读(132) 评论(0) 推荐(0) 编辑

摘要: Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文

posted @ 2015-07-27 15:27 骄阳照林 阅读(103) 评论(0) 推荐(0) 编辑

摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo... 阅读全文

posted @ 2015-07-27 14:33 骄阳照林 阅读(114) 评论(0) 推荐(0) 编辑

摘要: Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl... 阅读全文

posted @ 2015-07-27 13:03 骄阳照林 阅读(95) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8