PROBLEM SOLVING TECHNIQUES
By
Dept. of CSE
PVPSIT, Kanuru.
PRASAD V. POTLURI SIDDHARTHA INSTITUTE OF TECHNOLOGY
Department of CSE
2025-26
REMOVAL OF DUPLICATES FROM AN ORDERED ARRAY
PVPSIT (Autonomous)
Problem Solving Techniques
1. a pair of duplicates has been encountered;
2. The two elements are different
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
i:=2
While (a[i-1]<>a[i] and i<n) do i:=i+1;
If a[i-1]<>a[i] then i:=i+1;
J:=i-1
While i<n do
begin
i:=i+1
if a[i-1]<>a[i] then
begin
j:= j+1
a[j]:=a[i]
end
end;
n:=j //reduce the size of array
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
Algorithm:
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
PVPSIT (Autonomous)
Problem Solving Techniques
Department of CSE
2025-26
Applications
PVPSIT (Autonomous)
Problem Solving Techniques