Tag：subject

Time：2021621
[exercise 11] calculate the byte sizes of int, float, double and char Title:Calculates the byte sizes of int, float, double and char 1. AnalysisThe sizeof operator is used to calculate the byte sizes of int, float, double and char variables.Sizeof is a monocular operator, which gives the storage size of its operands in byte form. […]

Time：2021618
Let’s look at the title: leetcode9Palindrome, that is to say, forward reading and reverse reading are the same. For example, 12321 is a palindrome number and daaad is a palindrome string.If a string type is given, we can use [0] and. Size () – 1 to traverse the strings on both sides at the same […]

Time：2021613
[exercise 21] calculate the sum of natural numbers Title:Calculating the sum of natural numbers 1. AnalysisPractice using the for loop structure. The for loop allows a loop control structure to execute a specified number of times. 2. Procedure: #include int main() { int i, iNum, iSum; Printf (“enter a positive integer):”; scanf(“%d”,&iNum); iSum = 0; […]

Time：2021612
Title addresshttps://leetcodecn.com/problems/convertsortedarraytobinarysearchtree/ Middle order traversal (DFS) First of all, we need to know that the results of a binary search tree are in the order from small to large. According to the array given by the topic, we can naturally associate with the middle order traversal.For traversing DFs in medium order, we can consider the […]

Time：2021612
Jump game II I’ll copy the title here~ Given an array of nonnegative integers, you are first in the array. Each element in the array represents the maximum length you can jump at that position. Your goal is to reach the last position of the array with the least number of jumps. Example: Input: [2,3,1,1,4] […]

Time：202162
The next day. Actually, I left work very early today, but I spent the whole night learning the usage of option, some and box in rust. There was almost no time to brush the questions, so I just brush one. The topics are as follows: You are given two nonempty linked lists representing two nonnegative […]

Time：2021531
Title: Given a string, find the length of the longest substring without repeating characters. Example 1: Input: “abcabcbb” Output: 3 Explanation: The answer is “abc”, with the length of 3. Example 2: Input: “bbbbb” Output: 1 Explanation: The answer is “b”, with the length of 1. Example 3: Input: “pwwkew” Output: 3 Explanation: The answer […]

Time：2021530
Title: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). You may assume nums1 and nums2 cannot be both empty. Example 1: nums1 = [1, 3] nums2 = [2] The median is 2.0 […]

Time：2021530
These are some of the things that have been influenced by the circle of friends beforeIntimacy testInspired by the development of an interactive answering application. function Create a custom topic and set the correct options Generate sharing map and invite friends to answer questions Friends get transcripts, and can generate pictures to share The notification […]

Time：2021529
Title: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: “babad” Output: “bab” Note: “aba” is also a valid answer. Example 2: Input: “cbbd” Output: “bb” Title Translation: Very classic topic, for the longest palindrome string How to solve […]

Time：2021529
1. Variable value exchange Title Description:In the premise of not using the third variable, the binary method is used to exchange the values of two integer variables. Solution code: >>> a = 1234 >>> b = 5678 >>> a = a ^ b >>> b = a ^ b >>> a = a ^ b […]

Time：2021529
136. A number that appears only once Title Source: https://leetcodecn.com/problems/singlenumber subject Given a non empty integer array, each element appears twice except one. Find the element that appears only once. explain: Your algorithm should have linear time complexity. Can you do it without extra space? Example 1: Input: [2,2,1] Output: 1 Example 2: Input: [4,1,2,1,2] […]