33. Search in Rotated Sorted Array 📄 Problem Statement : There is an integer array nums sorted in ascending order (with distinct values). Before being passed to your function, nums may be rotated at an unknown pivot index k (where 1 <= k < nums.length ) such that the array becomes [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] . You are given the array nums after the rotation and an integer target . Your task is to return the index of the target if it exists in nums , or return -1 if it does not exist. You must solve it in O(log n) time. 📚 Examples : 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 📜 Constraints : 1 <= nums.length <= 5000 -10⁴ <= nums[i] <= 10⁴ All values of nums are unique . nums is a sorted array, possibly rotated . -10⁴ <= target <= 10⁴ ...
Reading is an important communicative process and reading skills are probably the most important language skills required for academic and professio nal purposes. Quick, efficient and imaginative reading techniques are essential to enhance the effectiveness. Professionals spend on receiving information (listening and reading) is more than what they spend on sending (speaking and writing) information.
Purpose of Reading
Professionals may have to read a variety of texts ranging from a short email to a voluminous book or lengthy report every day.
Reading is concerned with four factors:
◾Decoding
◾Comprehending
◾Text Analysis
◾Response
The basic purpose of reading is to extract information from various sources such as text books,research papers, and articles in technical journals, teaching notes, notices, web materials,encyclopedias and technical reports.
One readss
◾To understand a topic or enrich one's knowledge about a topic;
◾To derive pleasure;
◾To understand what happens around.
In addition, one needs to connect the ideas on the text to what one already knows. During reading one needs to concentrate and be alert so that one will be able to grasp the message first and has to read again to understand the finer aspects of the topic.
Comments
Post a Comment
If you have any suggestions then comment me .