![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
practice for C++
Drscq
STRIVE FOR MY DREAM
展开
-
Random Numbers In Normal Distribution Visualization in C++ and Python
【代码】Random Numbers In Normal Distribution Visualization in C++ and Python。原创 2023-06-03 11:22:48 · 200 阅读 · 0 评论 -
Generate a random number with normal distribution (googleUnitTest)
【代码】Generate a random number with normal distribution (googleUnitTest)原创 2023-06-03 10:45:32 · 323 阅读 · 0 评论 -
How to free a array variable in 3 dimensions in your C/C++ files?
【代码】How to free a array variable in 3 dimensions in your C/C++ files?原创 2023-05-23 21:55:55 · 375 阅读 · 0 评论 -
Amazing Remote-SSH
Visual Studio Code (VSCode) is a popular code editor that has many useful features. One of these features is the Remote-SSH plugin. This plugin allows you to work on a remote machine using VSCode. In this blog post, we will explore the usefulness of this p原创 2023-05-23 18:03:48 · 619 阅读 · 0 评论 -
【无标题】
To extract the files from the archive, you can use the command in the terminal. Here’s the command you can use:This command will extract the contents of the archive into a directory named in the current working directory. Here’s what each option of th原创 2023-05-22 21:51:13 · 409 阅读 · 0 评论 -
How to Use Valgrind to Detect Memory Leaks in C++
【代码】How to Use Valgrind to Detect Memory Leaks in C++原创 2023-05-12 23:02:44 · 504 阅读 · 1 评论 -
459. Repeated Substring Pattern
s。原创 2023-03-19 16:11:15 · 309 阅读 · 0 评论 -
28. Find the Index of the First Occurrence in a string
Given two strings and , return the index of the first occurrence of in , or -1 if is not part of .Example 1:Input: = “sadbutsad”, = “sad”Output: 0Explanation: “sad” occurs at index 0 and 6. The first occurrence is at index 0, so we return 0.Example原创 2023-03-19 10:09:09 · 379 阅读 · 0 评论 -
26. Remove Duplicates from Sorted Array
【代码】26. Remove Duplicates from Sorted Array。原创 2023-03-14 10:11:24 · 177 阅读 · 0 评论 -
214. Shortest Palindrome
s。原创 2023-03-13 21:55:29 · 46 阅读 · 0 评论 -
349. Intersection of Two Arrays
【代码】349. Intersection of Two Arrays。原创 2023-02-08 10:14:33 · 62 阅读 · 0 评论 -
242. Valid Anagram
Given two strings s and t, return true if t is an anagram of s, and false otherwise.An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original exactly once.原创 2023-02-08 09:54:59 · 45 阅读 · 0 评论 -
142. Linked List Cycle II
【代码】142. Linked List Cycle II。原创 2023-02-06 23:28:11 · 52 阅读 · 0 评论 -
19 Remove Nth Node From of List
【代码】19 Remove Nth Node From of List。原创 2023-02-06 23:02:18 · 158 阅读 · 0 评论 -
206. Reverse Linked List
【代码】206. Reverse Linked List。原创 2023-02-04 21:54:08 · 58 阅读 · 0 评论 -
Leetcode 455. Assign Cookies
【代码】Leetcode 455. Assign Cookies。原创 2023-01-20 12:14:56 · 1280 阅读 · 0 评论 -
Just Use Addition Operation to Achieve Factorial for a Given Integer in Recursive Version
Factorial calculation for a given integer in a recursive fashion.原创 2022-12-28 20:24:26 · 46 阅读 · 0 评论 -
The Two Ways to Handle the Backpacking Problem
【代码】The Two Ways to Handle the Backpacking Problem。原创 2022-12-08 22:12:30 · 95 阅读 · 0 评论 -
A simple example for creating a vec_ZZ and vec_ZZ_p and their transformation in NTL
The basic attempt for using the vector in NTL原创 2022-11-23 18:22:01 · 98 阅读 · 0 评论 -
C++起多个线程能够对同一个文件进行读写?Can we use multi-threads read or write a file in same time in C++ language?
【代码】C++起多个线程能够对同一个文件进行读写?原创 2022-11-21 09:39:15 · 685 阅读 · 0 评论 -
203. Remove Linked List Elements
【代码】203. Remove Linked List Elements。原创 2022-08-22 21:51:49 · 187 阅读 · 1 评论 -
6152. Minimum Hours of Training to Win a Competition
You are entering a competition, and are given two positive integers initialEnergyinitialEnergyinitialEnergy and initialExperienceinitialExperienceinitialExperience denoting your initial energy and initial experience respectively.You are also given two 0-i原创 2022-08-21 21:12:07 · 114 阅读 · 0 评论 -
1302. Deepest Leaves Sum
Given the rootrootroot of a binary tree, return the sum of values of its deepest leaves.an exampleThe DFS and directly return the last layer sum of valuesBFS with log all the sum of values for every layersThe corresponding results原创 2022-08-18 22:49:32 · 67 阅读 · 0 评论 -
977. Squares of a Sorted Array
Given an integer array numsnumsnums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.exampleInput: nums=[−4,−1,0,3,10]nums = [-4, -1, 0, 3, 10]nums=[−4,−1,0,3,10]Output: [0,1,9,16,100][0, 1, 9,原创 2022-08-17 19:57:08 · 78 阅读 · 0 评论 -
27. Remove Element
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.Since it is impossible to cyouhange the length of the array in some languages, you must instead have the re原创 2022-08-14 21:25:09 · 116 阅读 · 0 评论 -
344. Reverse String
Write a function that reverses a string. The input string is given as an array of characters s.You must do this by modifying the input array in-place with constant extra memory.An example:Input: s = [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]Output: [‘o’, ‘l’, ‘l’, ‘e’,原创 2022-08-13 22:04:16 · 129 阅读 · 0 评论 -
640.Solve the Equation
Solve a given equation and return the value of in the form of a string . The equation contains only operation, the variable and its coefficient. You should return if there is no solution for the equation, or if there are infinite solutions for the e原创 2022-08-12 21:51:36 · 220 阅读 · 0 评论 -
1413.Minimum Value to Get Positive Step by Step Sum
代码】1413.Minimum Value to Get Positive Step by Step Sum。原创 2022-08-09 09:55:13 · 115 阅读 · 0 评论 -
Spiral Matrix
Given a n×nn \times nn×n matrix, output its elements in spiral and chronological order.The codes for the second problemconclusionknow your variables and use them correctly.原创 2022-08-06 20:18:01 · 66 阅读 · 0 评论 -
1161. Maximum Level Sum of a Binary Tree
代码】1161.MaximumLevelSumofaBinaryTree。原创 2022-08-02 16:14:53 · 76 阅读 · 0 评论 -
The sorting algorithm including selection, bubble, and insertion
代码】Thesortingalgorithmincludingselection,bubble,andinsertion。原创 2022-08-02 15:28:54 · 81 阅读 · 0 评论 -
An interesting example to illustrate the difference of emplace_back() and push_back()
代码】Aninterestingexampletoillustratethedifferenceofemplace_back()andpush_back()原创 2022-07-19 22:20:35 · 70 阅读 · 0 评论 -
The Permutation Results by backtracking method (dfs)
代码】ThePermutationResultsbybacktrackingmethod(dfs)原创 2022-07-18 11:46:15 · 70 阅读 · 0 评论 -
The Solution for Fibonacci from simple to complicated
F(0)=0,F(1)=1F(0) = 0, F(1) = 1F(0)=0,F(1)=1F(n)=F(n−1)+F(n−2),forn>1.F(n) = F(n - 1) + F(n - 2), for n > 1.F(n)=F(n−1)+F(n−2),forn>1.在这里插入图片描述](https://img-blog.csdnimg.cn/d5acb07170554d98b8b90c65741b2e7a.png)原创 2022-07-11 11:42:46 · 81 阅读 · 0 评论 -
648. Replace Words
an exampleSolution 1the intuitionspliet the sentence into wordscheck whether each word need to be changed or not.merge all the processed word into sentenceThe codes for thisthe corresponding resultsThe corresponding results原创 2022-07-09 09:29:00 · 58 阅读 · 0 评论 -
1200.Minimum Absolute Difference
an exampleThe solution 1The intuitionThe corresponding codesThe resultThe corresponding resultsThe corresponding result原创 2022-07-06 10:10:33 · 90 阅读 · 0 评论 -
241. Different Ways to Add Parentheses
The recursive methods the implementation of binary tree原创 2022-07-01 14:39:28 · 87 阅读 · 0 评论 -
515. Find Largest Value in Each Tree Row
The first time pass the code in once time原创 2022-06-24 22:10:22 · 62 阅读 · 0 评论 -
513. Find Bottom Left Tree Value
an example原创 2022-06-23 09:03:11 · 98 阅读 · 0 评论 -
508. Most Frequent Subtree Sum
an exampleThe intuition for this problemThe corresponding codesThe result原创 2022-06-20 09:25:09 · 51 阅读 · 0 评论