提供下面提到的代码摘录的简明功能概述 [英] Provide a concise functional overview of the code excerpt mentioned below

查看:70
本文介绍了提供下面提到的代码摘录的简明功能概述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提供下面提到的代码摘录的简明功能概述,

问题1

Provide a concise functional overview of the code excerpt mentioned below,
Question 1

procedure f(var A : array of integer; L, R: Integer);
var
 I, J: Integer;
 P, T: Integer;
begin
 repeat
 I := L;
 J := R;
 P := A[(L + R) shr 1];
 repeat
 while A[I] < P do
 Inc(I);
 while A[J] > P do
 Dec(J);
 if I <= J then
 begin
 T := A[I];
 A[I] := A[J];
 A[J] := T;
 Inc(I);
 Dec(J);
 end;
 until I > J;
 if L < J then
 f(A, L, J);
 L := I;
 until I >= R;
end;
Question 2
procedure f( var a : integer; var b : integer );
begin
 a := a xor b;
 b := a xor b;
 a := a xor b;
end;

推荐答案

这是面试问题是问,只是想知道函数的输出是什么,并解释我的逻辑。
This is the interview question was asked, just want to know the what is the output of the functions and explain me the logic.


这篇关于提供下面提到的代码摘录的简明功能概述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆