Whether two linked lists intersect

Given the head nodes headA and headB of two single linked lists, please find and return the starting node where the two single linked lists intersect. If two linked lists have no intersection, null is returned. Note: there may be rings in the chain structure. First, judge whether a single linked list is a ring. Given a linked list, return the ...

Posted by pchytil on Mon, 24 Jan 2022 02:13:02 +0100

[case of algorithm thousand questions] practice LeetCode punch in once a day - 103 Intimate string

📢 preface 🚀 Algorithm problem 🚀 🌲 Punching out an algorithm problem every day is both a learning process and a sharing process 😜🌲 Tip: the problem-solving programming languages in this column are C# and Java🌲 To maintain a state of learning every day, let's work together to become the great God of algorithm 🧐!🌲 Tod ...

Posted by bolerophone on Mon, 24 Jan 2022 00:55:10 +0100

Code Capriccio brush questions - string

This article is a note taken when writing questions with the code Capriccio every day, which is used to summarize and review. catalogue 344. Reverse string 541. Reverse string II Sword finger offer 05 Replace spaces 151. Reverse the words in the string Sword finger offer 58 - Ⅱ Left rotation string 28. Implement str () 459. Duplicate ...

Posted by nads1982 on Sun, 23 Jan 2022 23:47:10 +0100

2021-06-26 force deduction algorithm problem summary

@Binary tree summary Binary tree phased summary From today on, I began to record my daily study and life. I didn't blog much before. Although I learned some Markdown grammar, I'm still not very familiar with it. The topics of Li Kou are recorded through pycharm. Later, in this form, I'll record all kinds of learning, do algorithm problems and ...

Posted by MrBillybob on Sun, 23 Jan 2022 13:49:58 +0100

01 knapsack problem of classical problem of dynamic programming

Problem description Give you a backpack with a weight of W and N items. Each item has two attributes: weight and value. The weight of the ith item is wt[i] and the value is val[i]. Now, what is the maximum value you can pack with this back package? Problem solving ideas 01 knapsack problem is a very classic dynamic programming problem, ...

Posted by tinuviel on Sun, 23 Jan 2022 13:19:17 +0100

LeetCode_LinkedList_92. Reverse Linked List II (C++/Java) [recursion]

catalogue 1, Title Description English description Chinese description 2, Problem solving ideas 3, AC code C++ Java 4, Problem solving process First Bo   1, Title Description English description Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from posi ...

Posted by taz321 on Sun, 23 Jan 2022 04:30:06 +0100

Leetcode Brush Title Notes - Basic Operation and Classic Title of Chain List

Brush the title from: Code Casual Recording 1. Chain list basic operations 707. Design Chain List Leetcode Link Design the implementation of the chain table. You can choose to use single or double-linked lists. A node in a single-chain table should have two attributes: val and next. val is the value of the current node, and next is the ...

Posted by qrt123 on Sat, 22 Jan 2022 21:35:16 +0100

Day 12 & PriorityQueue

"This is the fourth day of my participation in 2022's first update challenge. See the activity details: 2022 first update challenge」 This blog post will be released in Nuggets community first! subject The daily practice is changed from the original > = 5 questions to > = 3 questions. There is no way, > = 5 questions are a ...

Posted by mrjameer on Sat, 22 Jan 2022 14:18:07 +0100

leetcode -- array, double pointer, sliding window

1. How to write the correct algorithm: clarify the definition of variables. public int binarySearch(int[] a){ int l = 0, r = n - 1; // Find target in the range of [l...r] while( l <= r){ // When l == r, the interval [l...r] is still valid int mid = l + (r - l) / 2; if(a[mid] == target){ return mid; ...

Posted by darkfreaks on Sat, 22 Jan 2022 11:03:30 +0100

Find the maximum and minimum values of the array

Find the maximum and minimum values of the array In the program, we often use an array (list) to store a given linear sequence (such as {1,2,3,4}), so how to find the maximum or minimum value in the array (sequence)? There are many algorithms for finding the maximum or minimum value in an array (sequence). Next, we take the {3,7,2,1} sequence ...

Posted by Arbitus on Sat, 22 Jan 2022 09:41:58 +0100