q '0'); 表示将q的所有位赋值为0,当q位数较多时比较方便。。。
信号属性函数:用来得到有关信号的行为功能信息;
信号‘event:当前的一个相当小的时间间隔内有信号事件发生,则返回’true’,否则返回‘false’;
关于conv_std_logic_vector 和 conv_integer 这两个函数的使用问题...
分类:
其他好文 时间:
2014-06-11 06:26:39
阅读次数:
240
在项目开发过程中,有时候在选择int还是Integer会有些纠结.今天就来聊一下这个问题.当然,下面所说的基本也适用于java中其他基本类型和其包装类型。Definitions:
int是原始类型,并不是一个Object.int的取值范围为-2的31次方到2的31次方.int的在计算时具备非常高.....
分类:
其他好文 时间:
2014-06-10 09:39:26
阅读次数:
280
题目:Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL...
分类:
其他好文 时间:
2014-06-09 23:03:18
阅读次数:
254
原题地址:https://oj.leetcode.com/problems/first-missing-positive/题意:Given
an unsorted integer array, find the first missing positive integer.For
example,G...
分类:
编程语言 时间:
2014-06-09 17:44:43
阅读次数:
980
字符串转换整数: 虽然有类似的Integer.parseInt(),但是笔试面试明显不会如此:
转字符串可以考虑为: 1、单个字符的转换 2、权值 如:从前往后依次扫描,则每次扫描一个字符 前面数值*10; 如345,扫描3,再3*10+4,再...
分类:
编程语言 时间:
2014-06-09 17:21:02
阅读次数:
228
这是个老题目了,主要考察的是能不能考虑到所有的情况,还有就是怎么判断是否溢出。
情况大致分为如下四种:(下面我使用@代替空格,x代表除数字之外的所有字符)
1. "@@[+-]3232343@@"
2. "@@[+-]333x54"
3. "@@[+-]4343"
4. "2147483648"或者"-2147483649"(也就是溢出的情况)
下面代码中给出了两个判断是否溢出的方法。...
分类:
其他好文 时间:
2014-06-08 15:47:49
阅读次数:
270
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-06-08 15:30:28
阅读次数:
227
题目如下:
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
click to show clarification.
Clarification:
What co...
分类:
其他好文 时间:
2014-06-08 14:58:13
阅读次数:
231
题目
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321。
解题思路:
颠倒一个整数中数字的位置,哈哈,类似翻转字符串一样,只不过整数需要计算,需要考虑溢出,其他无而。写出代码不难,只是溢出的时候怎么办,我这里是按照返回-1处理的,在leetcode上可以AC。
代码实现:...
分类:
其他好文 时间:
2014-06-08 14:47:58
阅读次数:
257
题目
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional el...
分类:
其他好文 时间:
2014-06-08 05:05:47
阅读次数:
268