渥太华IT面试编程试题

我觉得讨论挨踢的问题挺有意思,能不能单独开一个板块?
 
这活也就是5、6行code, 没人敢接?:confused:
一开始考虑的时候想错方向了,现在应该对了,多来点,哈哈

0 1 2 3 4 5 6 7 8 9 10 11 12 13

------------0
0
--------1-------2
0*2+1 0*2+2
------3---4----5---6
1*2+1 1*2+2 2*2+1 2*2+2
-----7-8-9-10-11-12-13
3*2+1 3*2+2 4*2+1 4*2+2 5*2+1 5*2+2 6*2+1 null
代码:
public static Node decode(object[] data, int index, Node parent)
    int nCap = data.length - 1;
    if (nCap >index ) {
        if (parent == null) {
            parent= new Node();
        }
        parent.data = data[index];
        parent.left = decode(data, index * 2 + 1, parent.left);
        parent.right = decode(data, index * 2 + 2, parent.right);
        return parent;
    }
    return null;
}
decode(new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12,13}, 0, null);
家里没java,没eclipse,有没有错不负责
 
对了,我还想问问:在公司除了写程序,你们还写报告和做presentation吗?
现在找工作都要Excellent written and oral communication,
你们都excellent了吗?
 
对了,我还想问问:在公司除了写程序,你们还写报告和做presentation吗?
现在找工作都要Excellent written and oral communication,
你们都excellent了吗?
如何让面试的人看你顺眼,跟同事和睦相处,在各大办公室的office politics的夹缝中生存下来,这些基本就是Excellent written and oral communication的整合与概括了
 
感谢。我总觉得,英语不是母语,写个excellent,有点吹牛不可靠的感觉。

如何让面试的人看你顺眼,跟同事和睦相处,在各大办公室的office politics的夹缝中生存下来,这些基本就是Excellent written and oral communication的整合与概括了
 
你只能在resume跟interview上头来表现你的Excellent written and oral communication了,一进公司的门,你英文再不地道,人家也没法直接因为这个理由开除你,除非合同有写
 
我通常用Effective written and oral communication
看来要改成Excellent才行?

你只能在resume跟interview上头来表现你的Excellent written and oral communication了,一进公司的门,你英文再不地道,人家也没法直接因为这个理由开除你,除非合同有写
 
一开始考虑的时候想错方向了,现在应该对了,多来点,哈哈

0 1 2 3 4 5 6 7 8 9 10 11 12 13

------------0
0
--------1-------2
0*2+1 0*2+2
------3---4----5---6
1*2+1 1*2+2 2*2+1 2*2+2
-----7-8-9-10-11-12-13
3*2+1 3*2+2 4*2+1 4*2+2 5*2+1 5*2+2 6*2+1 null
代码:
public static Node decode(object[] data, int index, Node parent)
    int nCap = data.length - 1;
    if (nCap >index ) {
        if (parent == null) {
            parent= new Node();
        }
        parent.data = data[index];
        parent.left = decode(data, index * 2 + 1, parent.left);
        parent.right = decode(data, index * 2 + 2, parent.right);
        return parent;
    }
    return null;
}
decode(new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12,13}, 0, null);
家里没java,没eclipse,有没有错不负责


思路是不错,只是index设置得比较诡异:D
 
思路是不错,只是index设置得比较诡异:D
别提了,我一开始的想法是不用那么诡异的index的:blowzy:,后来在公司调试的时候还搞出了stackoverflow,:D直接放弃,去干正经事了
 
别提了,我一开始的想法是不用那么诡异的index的:blowzy:,后来在公司调试的时候还搞出了stackoverflow,:D直接放弃,去干正经事了


估计不会有别人参与了。

代码:
public static TreeNode convertArrayToTree(int arr[], int start, int end)
{
     if (end < start) return null;

     int mid = (start + end) / 2;
     TreeNode n = new TreeNode(arr[mid]);
     n.left = convertArrayToTree(arr, start, mid - 1);
     n.right = convertArrayToTree(arr, mid + 1, end);
     return n;
}

public static TreeNode createBST(int array[])
{
     return convertArrayToTree(array, 0, array.length - 1);
}
 
后退
顶部