top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Given an array A of n elements, find three indices i,j & k such that A[i]^2+A[j]^2=A[k]^2 ?

+3 votes
120 views
Given an array A of n elements, find three indices i,j & k such that A[i]^2+A[j]^2=A[k]^2 ?
posted Jun 28, 2016 by Shivam Kumar Pandey

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
brute force approach requires n^3 time complexity but I need to solve this problem in n^2 time complexity
http://www.geeksforgeeks.org/find-a-sorted-subsequence-of-size-3-in-linear-time/

its not the algorithm for question, but I think this will be helpful for developing logic for your question,
hope it will be helpful
I'll update you after checking if it fulfills my requirement or not.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...