Stack and queue oj questions
Stack and queue oj questions
[the external chain image transfer fails. The source station may have anti-theft chain mechanism. It is recommended to save the image and upload it directly (img-gqdvgkrh-1644978540376) (E: \ markdown \ note. 1 \ image \ image-20214095416601. PNG)]
[the external chain picture transfer fails, and the source stati ...
Added by colB on Wed, 16 Feb 2022 04:38:15 +0200
c language data structure, you may not know the sequence table
Python wechat ordering applet course video
https://edu.csdn.net/course/detail/36074
Python actual combat quantitative transaction financial management system
https://edu.csdn.net/course/detail/35475
Data structure sequence table
Sequence table definition
1. Preface
The sequential storage of linear table is also called sequential table. I ...
Added by dark_destroyer on Wed, 16 Feb 2022 00:21:39 +0200
Stack containing min function (Sword finger Offer 30)
Title Description: define the data structure of the stack. Please implement a min function that can get the smallest element of the stack in this type. In this stack, the time complexity of calling min, push and pop is O(1).
Problem solving ideas: push and pop methods belong to the basic methods in the stack; The min and top methods return the ...
Added by dapuxter on Tue, 15 Feb 2022 17:04:35 +0200
Summary of single linked list routine
21. Merge two sequential tables
Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] There is nothing to say about using an empty node.
class Solution:
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
dummy = ListNode()
p = dummy
while l1 and l2:
if l1.val < l2.val:
...
Added by twister47 on Tue, 15 Feb 2022 15:56:13 +0200
Array: question brushing record
Overview of knowledge points:
1. Sum of two numbers:
Given an integer array , nums , and an integer target value , target, please find the , and the , integers with the target value , target , in the array and return their array subscripts.
You can assume that each input will correspond to only one answer. However, the same e ...
Added by cuvaibhav on Tue, 15 Feb 2022 15:34:49 +0200
Minimum spanning tree and bipartite graph in graph theory (acwing template)
Directory navigation:
Minimum spanning tree:
For a graph with n points, the edges must be greater than or equal to n − 1. The minimum spanning tree is to select from these edges
N-1 edges connect all n points, and the sum of edge weights of these n − 1 edges is the smallest of all schemes
One more thing:
There are n ...
Added by Crave on Tue, 15 Feb 2022 05:56:21 +0200
The List and tuple of the basic knowledge of programming can be lazy to a certain extent~
preface
Previously, we learned several basic data types: string, integer and floating point,
Now we learn two types of tuple and tuple.
1, List
1. What is a List
List is a data type built into Python. It is an ordered collection, in which the elements can be added and deleted at any time Plain.
So why List?
Let's use an example to illust ...
Added by PHP-Editors.com on Mon, 14 Feb 2022 17:12:19 +0200
[data structure] (Yan Weimin version) implementation and code of relevant functions of sequence table
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define MAXSIZE 100
#define OK 1
#define ERROR 0
#define OVERFLOW -2
using namespace std;
typedef int Status;
typedef int ElemType;
typedef struct{
ElemType *elem;
int length;
}SqList;
//Linear table initialization
Statu ...
Added by parboy on Mon, 14 Feb 2022 13:59:50 +0200
LeetCode -- array
LeetCode brush question array
1, Array
1.1 definition of array
An array is a collection of several objects with a certain order. The objects that make up the array are called array elements. Where the vector corresponds to a one-dimensional array and the matrix corresponds to a two-dimensional array.
1.2 storage characteristics of array
Ar ...
Added by zMastaa on Mon, 14 Feb 2022 12:56:46 +0200
Java data structure and algorithm stack and queue
In life, we often encounter such situations: 1. When someone sends a book at school, if he wants to take out the top book, he can take it out directly. However, if he wants to take out the book in the middle, he must remove the book pressed on it to see the book. At this time, only the top can be taken out first, and the bottom can be taken out ...
Added by son.of.the.morning on Mon, 14 Feb 2022 10:03:03 +0200