top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

If I am jumping array indexes in powers of 2, i.e. 1,2,4,8.. the what would be complexity?

+2 votes
204 views
If I am jumping array indexes in powers of 2, i.e. 1,2,4,8.. the what would be complexity?
posted Aug 22, 2014 by Tapesh Kulkarni

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+3 votes

In an "N" element integer sorted array, a particular elements is repeating "(N/2)+1" times. How much time it take to find the repeating element.

+4 votes

Can someone please write a C program to reverse "N" nodes of list. In the above question N= 3.
Program should be generic so it can work for any value assigned to N.

Input List => 1 2 3 4 5 6 7 8 9 10 11
Output List => 3 2 1 6 5 4 9 8 7 10 11
for N=3

Input List => 1 2 3 4 5 6 7 8 9 10 11
Output List => 4 3 2 1 8 7 6 5 9 10 11
for n=4

+3 votes

Given a binary tree print it in inward spiral order i.e first print level 1, then level n, then level 2, then n-1 and so on.

For Ex -

         1 
   2           3 
 4    5       6     7 
8 9  10 11  12 13  14 15 

Print- 1 15 14 13 12 11 10 9 8 2 3 7 6 5 4

...