PROBLEM SOLVING TECHNIQUES
By
B. Vinay Kumar
Assistant Professor
Dept. of CSE
PVPSIT, Kanuru.
PRASAD V. POTLURI SIDDHARTHA INSTITUTE OF TECHNOLOGY
B. Vinay Kumar
Wednesday, January 18, 2023
SORTING BY EXCHANGE
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques
begin
sorted:=false;
i:=0;
while (i<n) and (not sorted) do
begin
sorted:=true;
i:=i+1
for j:=1 to n-i do
if a[j]>a[j+1] then
begin
t:=a[j];
a[j]:= a[j+1];
a[j+1]:=t;
sorted:= false
end
end
end
B. Vinay Kumar
Wednesday, January 18, 2023
Pseudo-code
begin
for i:=1 to n-1 do
for j:=1 to n-i do
if a[j] > a[j+1] then
begin
t := a[j];
a[j] := a[j+1]; a[j+1] := t
end
end
OR
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques
B. Vinay Kumar
Wednesday, January 18, 2023
PVPSIT (Autonomous)
Problem Solving Techniques