Question:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the st...
分类:
其他好文 时间:
2015-07-17 07:07:50
阅读次数:
115
1.5 Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a...
分类:
其他好文 时间:
2015-07-17 07:07:29
阅读次数:
134
https://msdn.microsoft.com/en-us/library/hk90416s(v=vs.110).aspxVS中自带的只能提示,一个类继承自某一个接口。由VS为类生成接口所要求的方法using System;using System.Collections.Generic;us...
分类:
其他好文 时间:
2015-07-16 16:27:13
阅读次数:
115
原题如下:
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() -- ...
分类:
其他好文 时间:
2015-07-16 11:56:13
阅读次数:
105
44 Wildcard Matching链接:https://leetcode.com/problems/wildcard-matching/
问题描述:
Implement wildcard pattern matching with support for ‘?’ and ‘*’.'?' Matches any single character.
'*' Matches any sequen...
分类:
其他好文 时间:
2015-07-16 11:48:01
阅读次数:
106
题意:实现trie树的3个功能,只含小写字母的串。思路:老实做即可! 1 class TrieNode { 2 public: 3 TrieNode* chd[26]; 4 bool flag; 5 // Initialize your data structure her...
分类:
其他好文 时间:
2015-07-16 00:48:37
阅读次数:
150
1.2 Implement a function void reverse(char *str) in C or C++ which reverses a null-terminated string.这道题让我们用C++或C语言来翻转一个字符串,不算一道难题,在之前那道Reverse Words ...
分类:
其他好文 时间:
2015-07-16 00:28:29
阅读次数:
146
1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structure?这道题让我们判断一个字符串中是否有重复的字符...
分类:
其他好文 时间:
2015-07-15 14:56:26
阅读次数:
100
问题描述Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus +...
分类:
其他好文 时间:
2015-07-15 14:36:25
阅读次数:
116
Implement pow(x,n).思路:这个题虽然简单,但是一开始我也没做利索。我思路不简洁的地方有:1.首先我想到的是符号问题,因此我用了flag来标记x的正负。可实际并不需要。2.其次是n得正负问题,我们不用先计算后取倒数,而是直接取倒数在运算。 1 public double myPow(...
分类:
其他好文 时间:
2015-07-15 10:54:48
阅读次数:
99