2 votes 2 votes Algorithms algorithms time-complexity testbook-test-series + – thor asked Nov 28, 2016 • retagged Jul 9, 2022 by Lakshman Bhaiya thor 417 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes When size of array is not known : Then Move Twice from state element location to . If you find # then success if not found then repeate that step. [we are working on indexes so no need of sorting] it will take O(logn) Prashant. answered Nov 28, 2016 • selected Jan 6, 2018 by Anu007 Prashant. comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Prashant. commented Nov 28, 2016 reply Follow Share take start index is i then move 2i evry time. so 1,2,4,8,16,32,..... 1 votes 1 votes Hradesh patel commented Nov 28, 2016 reply Follow Share @Anirudh kkk got it 0 votes 0 votes Veerendra V commented Nov 28, 2016 reply Follow Share what if if the length falls between 2^(K+1) and 2^K. Do we need to apply binary search to find the bound? 0 votes 0 votes Please log in or register to add a comment.