- 3
- 0
- 约8.25千字
- 约 21页
- 2026-03-29 发布于福建
- 举报
第PAGE页共NUMPAGES页
2026年金融科技工程师面试题库及答案解析
一、编程语言与算法(共5题,每题10分,总分50分)
1.Java编程题
题目:编写一个Java方法,实现快速排序算法,并对输入的整数数组进行排序。要求时间复杂度为O(nlogn)。
答案:
java
publicclassQuickSort{
publicstaticvoidquickSort(int[]arr,intlow,inthigh){
if(lowhigh){
intpivotIndex=partition(arr,low,high);
quickSort(arr,low,pivotIndex-1);
quickSort(arr,pivotIndex+1,high);
}
}
privatestaticintpartition(int[]arr,intlow,inthigh){
intpivot=arr[high];
inti=low-1;
for(intj=low;jhigh;j++){
if(arr[j]pivot){
i++;
inttemp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
}
}
inttemp
原创力文档

文档评论(0)