Redian新闻
>
求教bcl-xl蛋白命名格式
avatar
求教bcl-xl蛋白命名格式# Biology - 生物学
m*r
1
Design a method findEvenFreq(int[] a), which returns the single integer
value in the array which occurs with even frequency. Other numbers occur odd
numbers , which may be 7, 11 or even larger. All integers will be positive.
What if the integers are continuous.
For example, [1, 2, 3, 1] should return 1.
What if the integers may not be continuous.
example, [4, 8, 7, 5, 8 ] should return 8
The largest number can be INT_MAX.
I know how to solve it by hahstable.
Better ideas about O(1) space with O(n) time ?
thanks
avatar
a*k
2
我说给他揉揉鼻梁吧,他根本不让碰,摸不得,自己揉鼻子,然后哭。我说你揉也没用
,而且越哭越堵,妈妈给你揉揉也许就通了,他满不听那套,根本不让我碰他鼻子,也
不让喷那个spray,怎么弄啊?
avatar
g*c
3
哈哈
avatar
z*t
4
paper proof需要更正老鼠bcl-xl的蛋白命名
问题来了我看见有n种不同的写法
Bcl-xL
BCL-XL
Bcl-xl
BCL-XL(L下标)楼主已晕...
求教正确的命名格式,还是我直接用BCL2L1命名了事?
avatar
l*a
5
I assume that you can only use a counter like
bool counter[65535];
int counter[65535]

odd
positive.

【在 m****r 的大作中提到】
: Design a method findEvenFreq(int[] a), which returns the single integer
: value in the array which occurs with even frequency. Other numbers occur odd
: numbers , which may be 7, 11 or even larger. All integers will be positive.
: What if the integers are continuous.
: For example, [1, 2, 3, 1] should return 1.
: What if the integers may not be continuous.
: example, [4, 8, 7, 5, 8 ] should return 8
: The largest number can be INT_MAX.
: I know how to solve it by hahstable.
: Better ideas about O(1) space with O(n) time ?

avatar
w*t
6
没必要,他会学会用嘴巴呼吸,你示范一下就好了
过2天就好了
avatar
C*8
7
The last one you mentioned is correct BCL-XL(L下标)
avatar
p*2
8
他要求O(1)space

【在 l*****a 的大作中提到】
: I assume that you can only use a counter like
: bool counter[65535];
: int counter[65535]
:
: odd
: positive.

avatar
g*n
9
bcl2l1 (都是小写)
avatar
l*a
10
我认为
固定space就是O(1)
所谓O(n)的意思是随着输入的增长,所需空间线性增长
。。。

【在 p*****2 的大作中提到】
: 他要求O(1)space
avatar
x*d
11

不是吧?老鼠蛋白名得全部大写:BCL2L1

【在 g*****n 的大作中提到】
: bcl2l1 (都是小写)
avatar
p*2
12

有道理。不过这个跟hashtable不一样吗?hashtable说不定比这个还省空间。而且如果
变成int64的话,空间不就增加了?
我怎么感觉应该用异或呢?不过我没导出来公式呢。

【在 l*****a 的大作中提到】
: 我认为
: 固定space就是O(1)
: 所谓O(n)的意思是随着输入的增长,所需空间线性增长
: 。。。

avatar
g*n
13
人的蛋白名全部大写,老鼠蛋白名全部小写。
avatar
l*a
14
你说得对
但是只能这么做了。否则咋办
不知道LZ在那里看到的题。。。
异或感觉上肯定不成

【在 p*****2 的大作中提到】
:
: 有道理。不过这个跟hashtable不一样吗?hashtable说不定比这个还省空间。而且如果
: 变成int64的话,空间不就增加了?
: 我怎么感觉应该用异或呢?不过我没导出来公式呢。

avatar
x*d
15

不知道你的依据是什么,MGI规定了老鼠的蛋白名要大写:
1.5.2 Protein symbols
Protein designations follow the same rules as gene symbols, with the
following two distinctions:
Protein symbols use all uppercase letters.
Protein symbols are not italicized.
http://www.informatics.jax.org/mgihome/nomen/gene.shtml#ps
另外举个期刊的例子,老鼠的蛋白名和人的一样要大写
Capitalization of gene and protein symbols should be styled according to
species. For example,
Humans and non-human primates:
Full name: peroxisome proliferator–activated receptor γ
Gene symbol: PPARG
Protein symbol: PPARγ
Mice and rats:
Full name: peroxisome proliferator–activated receptor γ
Gene symbol: Pparg
Protein symbol: PPARγ
http://www.jci.org/kiosk/publish/genestyle

【在 g*****n 的大作中提到】
: 人的蛋白名全部大写,老鼠蛋白名全部小写。
avatar
q*c
16
O(1) space means no extra space.Maybe we can use partition to solve this,
though don't have a solid idea now.
avatar
B*5
17
这个要是design成bit operation会更合理吧
话说没出现过的数难道不也是偶数次?或许我强词夺理了。。。

【在 l*****a 的大作中提到】
: I assume that you can only use a counter like
: bool counter[65535];
: int counter[65535]
:
: odd
: positive.

avatar
j*j
18
异或好像是只有一两个出现一次,其余都出现两次的情况

【在 p*****2 的大作中提到】
:
: 有道理。不过这个跟hashtable不一样吗?hashtable说不定比这个还省空间。而且如果
: 变成int64的话,空间不就增加了?
: 我怎么感觉应该用异或呢?不过我没导出来公式呢。

avatar
p*2
19

这个题不就是只有一个出现偶次数吗?

【在 j*****j 的大作中提到】
: 异或好像是只有一两个出现一次,其余都出现两次的情况
avatar
l*a
20
那么多不一样的你怎么把它们消掉?

【在 p*****2 的大作中提到】
:
: 这个题不就是只有一个出现偶次数吗?

avatar
p*2
21

看错了。

【在 l*****a 的大作中提到】
: 那么多不一样的你怎么把它们消掉?
avatar
e*r
22
continuous & 数都只出现一次,even的出现两次
int findEvenFreq(vector& arr) {
int i = 0;
const int n = arr.size();
while (i < n) {
if (arr[i] < 0) {
i++; continue;
}
int j = arr[i] % n;
if (arr[i] + arr[j] == -1) return arr[i];
if (j > i) {
int t = arr[j];
arr[j] = -arr[i]-1;
arr[i] = t;
} else i++;
}
return -1;
}

odd
positive.

【在 m****r 的大作中提到】
: Design a method findEvenFreq(int[] a), which returns the single integer
: value in the array which occurs with even frequency. Other numbers occur odd
: numbers , which may be 7, 11 or even larger. All integers will be positive.
: What if the integers are continuous.
: For example, [1, 2, 3, 1] should return 1.
: What if the integers may not be continuous.
: example, [4, 8, 7, 5, 8 ] should return 8
: The largest number can be INT_MAX.
: I know how to solve it by hahstable.
: Better ideas about O(1) space with O(n) time ?

avatar
p*2
23
不都是正数吗?

【在 e****r 的大作中提到】
: continuous & 数都只出现一次,even的出现两次
: int findEvenFreq(vector& arr) {
: int i = 0;
: const int n = arr.size();
: while (i < n) {
: if (arr[i] < 0) {
: i++; continue;
: }
: int j = arr[i] % n;
: if (arr[i] + arr[j] == -1) return arr[i];

avatar
e*r
24
类似的方法可以做类似 1 1 1 2 2 这种很多数字出现频率可能高于1
就是对于数a[i],得把它放到j=a[i]%n的位置(n是数组长度)
如果:
(0) 如果a[i]已经在正确的位置(i==j)或者a[i]<0,直接i++
(1) a[j] == a[i],那么把a[j]变成-a[i]-1, i++
(2) a[j] == -a[i]-1,那么把a[j]变成a[i], i++
(3) otherwise,交换a[i]和a[j],i不变
空间O(1),时间O(n)
最后再O(n)找那个负数,假设是a[k]。返回-a[k]+1就行

【在 e****r 的大作中提到】
: continuous & 数都只出现一次,even的出现两次
: int findEvenFreq(vector& arr) {
: int i = 0;
: const int n = arr.size();
: while (i < n) {
: if (arr[i] < 0) {
: i++; continue;
: }
: int j = arr[i] % n;
: if (arr[i] + arr[j] == -1) return arr[i];

avatar
e*r
25
看15楼我的说明。那个code是只针对连续、每个数出现一次、一个数出现两次的
15楼我的说明是针对连续的情况,不限出现多少次

【在 p*****2 的大作中提到】
: 不都是正数吗?
avatar
p*2
26

(3)会不会死循环呢?

【在 e****r 的大作中提到】
: 类似的方法可以做类似 1 1 1 2 2 这种很多数字出现频率可能高于1
: 就是对于数a[i],得把它放到j=a[i]%n的位置(n是数组长度)
: 如果:
: (0) 如果a[i]已经在正确的位置(i==j)或者a[i]<0,直接i++
: (1) a[j] == a[i],那么把a[j]变成-a[i]-1, i++
: (2) a[j] == -a[i]-1,那么把a[j]变成a[i], i++
: (3) otherwise,交换a[i]和a[j],i不变
: 空间O(1),时间O(n)
: 最后再O(n)找那个负数,假设是a[k]。返回-a[k]+1就行

avatar
e*r
27
如果不连续,我的想法还是用类似的方法(其实就是hash)
稍微麻烦一些。相同的数hash(%)到一起,用一样的方法处理
不同的数hash到一起,得用open addressing
(0) 如果a[i]已经在正确的位置(i==j)或者a[i]<0,直接i++
(1) a[j] == a[i], a[j] (2) a[j] == -a[i]-1, a[j] (3) otherwise, 如果((a[j] > 0) && (a[j] % n == j)) || ((a[j] < 0) && ((-a[j]
+1) % n == j))就说明是collision了(我们估且认为不同的数hash到一起才是
collision)。没有collision的话,就直接交换a[i]和a[j],i不变
处理collision就用open addressing:一个一个搜索,知道找到一个尚未处理过的位置
,或者找到正确的hash slot
细节蛮多的,基本上就是实现open addressing了……
大概意思就是这样

【在 e****r 的大作中提到】
: 类似的方法可以做类似 1 1 1 2 2 这种很多数字出现频率可能高于1
: 就是对于数a[i],得把它放到j=a[i]%n的位置(n是数组长度)
: 如果:
: (0) 如果a[i]已经在正确的位置(i==j)或者a[i]<0,直接i++
: (1) a[j] == a[i],那么把a[j]变成-a[i]-1, i++
: (2) a[j] == -a[i]-1,那么把a[j]变成a[i], i++
: (3) otherwise,交换a[i]和a[j],i不变
: 空间O(1),时间O(n)
: 最后再O(n)找那个负数,假设是a[k]。返回-a[k]+1就行

avatar
e*r
28
不会,因为交换a[i]和a[j]后,原先的a[i]这个数在正确的位置(j),已经处理过了,
不会再处理这个数

【在 p*****2 的大作中提到】
:
: (3)会不会死循环呢?

avatar
e*r
29
刚漏了一点,改了
每次循环,如果a[i]已经在正确的位置,就直接i++什么都不用做
判断a[i]是否在正确的位置的依据是:
(j == i) || (a[i] < 0)

【在 p*****2 的大作中提到】
:
: (3)会不会死循环呢?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。