原题如下:
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
我的代码:
public class Solution {
public int strStr(String...
分类:
其他好文 时间:
2015-07-31 18:41:56
阅读次数:
121
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 of queue.peek() -- Get the front element.empty(...
分类:
其他好文 时间:
2015-07-31 18:29:47
阅读次数:
93
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() -- Get the top element.empty() -- Return whet...
分类:
其他好文 时间:
2015-07-31 18:23:24
阅读次数:
77
字符串中子串的查找// 字符串中子串的查找.cpp : 定义控制台应用程序的入口点。
//#include "stdafx.h"
#include
#includeconst char *strstr(const char* src,const char* sub)
{
const char* bp;
const char* sp; if(...
分类:
其他好文 时间:
2015-07-31 18:20:13
阅读次数:
111
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...
分类:
其他好文 时间:
2015-07-30 22:43:42
阅读次数:
113
Spring Frameworkis built on theInversion of Control(IOC) principle.Dependency injectionis the technique to implement IoC in applications. This article...
分类:
编程语言 时间:
2015-07-30 21:10:34
阅读次数:
188
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()...
分类:
其他好文 时间:
2015-07-30 21:06:04
阅读次数:
113
Reverse a singly linked list.
click to show more hints.
Hint:
A linked list can be reversed either iteratively or recursively. Could you implement both?
使用迭代和递归实现单链表的反转。
迭代的方法之间在剑指offer上面...
分类:
其他好文 时间:
2015-07-30 13:38:43
阅读次数:
114
C 语言 字符串命令 strstr()的用法 实现将原字符串以分割串分割输出strstr() 命令是在原字符串中查找指定的字符串第一次出现的地址,用这个特性可以实现字符的分割,判断是否包涵等功能:下面的这个例子是实现字符串以分割串分割输出: 1 #include 2 #include 3 4 ...
分类:
编程语言 时间:
2015-07-30 09:27:54
阅读次数:
143
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using...
分类:
其他好文 时间:
2015-07-30 00:55:12
阅读次数:
139