【参加活动】提名高教 --笨妈辣妈联合提名# pets - 心有所宠
n*a
1 楼
算法:
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
c++:
一个类A有一个char*的成员, 如果要支持以下代码:
A a,aa;
...
strcmp(a,aa);
需要加个什么method到这个类里面去?
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
c++:
一个类A有一个char*的成员, 如果要支持以下代码:
A a,aa;
...
strcmp(a,aa);
需要加个什么method到这个类里面去?