LeetCode 33 | Search in Rotated Sorted Array | Algorithm Explained (Java)

Publié le: 16 mars 2020
sur la chaîne: Xavier Elon
361
11

The description reads:
"Given an integer array nums sorted in ascending order, and an integer target.

Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).

You should search for target in nums and if you found return its index, otherwise return -1.



Example 1:

Input: nums = [4,5,6,7,0,1,2], target = 0
Output: 4
Example 2:

Input: nums = [4,5,6,7,0,1,2], target = 3
Output: -1
Example 3:

Input: nums = [1], target = 0
Output: -1"

Github: https://github.com/xavierelon1
Github HackerRank Solutions: https://github.com/XavierElon1/Hacker...
Github Leetcode Solutions: https://github.com/XavierElon1/LeetCo...
Facebook:   / xavier.hollingsworth.3  
Instagram:   / xavierelon  
LinkedIn:   / xavier-hollingsworth-524144127  
Twitter:   / elon_xavier  


Sur cette page du site, vous pouvez voir la vidéo en ligne LeetCode 33 | Search in Rotated Sorted Array | Algorithm Explained (Java) durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Xavier Elon 16 mars 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 361 fois et il a aimé 11 téléspectateurs. Bon visionnage!