惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Engineering at Meta
Engineering at Meta
T
Tenable Blog
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Secure Thoughts
N
News and Events Feed by Topic
Google DeepMind News
Google DeepMind News
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
H
Hacker News: Front Page
I
InfoQ
L
LangChain Blog
Security Latest
Security Latest
The Cloudflare Blog
Forbes - Security
Forbes - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Stack Overflow Blog
Stack Overflow Blog
TaoSecurity Blog
TaoSecurity Blog
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
Scott Helme
Scott Helme
爱范儿
爱范儿
A
Arctic Wolf
F
Full Disclosure
酷 壳 – CoolShell
酷 壳 – CoolShell
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - gyhanonline

Function Point in Vbscript Window API in QTP Simulate click event using widows API. Static Constructor A Go Set program A Go Set program About Inherit Code for Inter-process communicate Integrity Level Test for publish blog by word 2007 托管为什么安全 The usage of intellisense in Vs .net 2005 我的面试(七) 关于singlton的一些问题 我的面试(六) 我的面试(四)补充1 我的面试(四) 我的面试(三) 我的面试(二)
我的面试(五)
gyhanonline · 2007-10-01 · via 博客园 - gyhanonline

八月十五中秋佳节,俺再一次赶赴北京。为我的北漂奔波!足足用了一天的时间,晚上11点才回到家。
这家公司在上地,好远。做的题和以前面试做的差不多不想再赘述了。当一件事情干过n次之后就趋于麻木,我现在对于面试这件事情就是在麻木的临界状态。不想那么多了。慢慢来吧!
这次是测试工程师,不知道能不能行!面试官说就剩下跟我谈薪水问题了。等等吧,如果一个公司连5K都拿不出来,这样的公司也不用去了。
出道题数组a[0,1……n-1]中的数是乱序,有数b[0,1……m],m<n,不新建数组把a中数升序放到b中,编吧。

       /// <summary>
        
/// 数组排序
        
/// </summary>
        
/// <param name="a1">带排序数组</param>
        
/// <param name="lenth">排序后新数组长度</param>
        
/// <returns>排完的数组</returns>

        static int[] SortArray(int[] a1, int lenth)
        
{
            
if (lenth < a1.Length)
            
{
                
throw new Exception("越界了,甭玩儿啦!");
            }

            
int[] b1 = new int[lenth];
            b1[
0= a1[0];
            
for (int i = 1; i < a1.Length; i++)
            
{

                
int low = 0;
                
int high;
                
if (i <= lenth - 1)
                
{
                    high 
= i - 1;
                }

                
else if (a1[i] > b1[lenth-1])
                
{
                    
continue;//都比最大的大了,还玩啥?!
                }

                
else
                
{
                    high 
= lenth - 1;
                }

                
while (low <= high)
                
{
                    
int mid = (low + high) / 2;
                    
if (a1[i] < b1[mid]) high = mid - 1;
                    
else low = mid + 1;
                }
//找出来往哪插
                if (i <= lenth - 1)
                
{
                    
for (int j = i - 1; j >= high + 1; j--)
                        b1[j 
+ 1= b1[j];
                }

                
else
                
{
                    
for (int j = lenth - 2; j >= high + 1; j--)
                        b1[j 
+ 1= b1[j];
                }
//腾地方,把插入点后边的向后挪。(满了的最后一个就不要了)
                b1[high+1= a1[i];//都给您老腾地儿了还不赶快进去!
            }

            
return b1;//得,打完收工。
        }
//看不懂的去看《数据结构》的插入排序法