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

推荐订阅源

A
About on SuperTechFans
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tenable Blog
WordPress大学
WordPress大学
小众软件
小众软件
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
T
The Exploit Database - CXSecurity.com
Attack and Defense Labs
Attack and Defense Labs
Simon Willison's Weblog
Simon Willison's Weblog
C
CXSECURITY Database RSS Feed - CXSecurity.com
量子位
有赞技术团队
有赞技术团队
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Fortinet All Blogs
S
Schneier on Security
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
F
Full Disclosure
Scott Helme
Scott Helme
GbyAI
GbyAI
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
Cloudbric
Cloudbric
云风的 BLOG
云风的 BLOG
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
Hacker News - Newest:
Hacker News - Newest: "LLM"
Security Latest
Security Latest
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
L
Lohrmann on Cybersecurity
PCI Perspectives
PCI Perspectives
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
D
Docker
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Secure Thoughts
C
Check Point 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;//得,打完收工。
        }
//看不懂的去看《数据结构》的插入排序法