Tech Interview

A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!

    • 22 Jun 2016

      Right Rotate an array by k elements

      Posted at 7:13 am by Admin, on June 22, 2016

      An array of elements is given arr
      arr is of length n
      Right rotate array by k elements
      Time complexity O(n) and space complexity O(1)

      Sample Input:
      arr = {1,2 ,3,4,5}
      n = 5
      k = 2
      Output :
      arr = {4,5,1,2,3}

      0 Comments
      Posted in Uncategorized

Proudly powered by WordPress.

Theme: Minipress by Obox Themes.