04-C. DS bidirectional linked list - Zuma
04 - sequence table and stack exercise
Title Description Zuma is a game once popular all over the world. Its playing method is: several colored beads are initially arranged on a track, of which any three adjacent beads will not be completely the same color. After that, you can launch the beads into orbit and add them to the original sequenc ...
Posted by glassroof on Thu, 07 Oct 2021 22:55:58 +0200
Summary of common C++STL
Summary of common C++STL
1, vector, variable length array, multiplication idea
size() returns the number of elements empty() returns whether it is empty front()/back() returns the head or tail of the array push_back() insert element at tail pop_ Delete element at the end of back() Iterator: begin()/end() Support random addressing: []
Support ...
Posted by MrAdam on Thu, 07 Oct 2021 20:56:45 +0200
❤ C language -- linked list -- data structure ❤
1. Concept of linked list
Linked list is a basic data structure. Linked list can dynamically allocate storage. In other words, linked list is a very powerful array. It can define a variety of data types in nodes, and can add, delete and insert nodes as needed. We only allocate memory for one node at a time. The linked list uses pointers to ...
Posted by rajsekar2u on Thu, 07 Oct 2021 20:27:00 +0200
Tree of basic data structure and algorithm - C language implementation
Binary tree
The main operation sets provided are:
Three recursive TraversalsThree non recursive Traversalslevel traversal Output leaf nodeRecursively find the height of binary treeCreate a binary tree from an arrayDestroy binary treeConstructing expression tree from suffix expression
code implementation
#include <stdio.h>
#include < ...
Posted by KrisNz on Thu, 07 Oct 2021 09:56:28 +0200
Four traversals of binary trees (recursive and non recursive)
Preorder traversal and postorder traversal
First traverse the root node, then the left subtree, and then the right subtree.
Post order traversal first traverses the left subtree, then the right subtree, and then the root node.
Recursive implementation of preorder traversal:
public static void preOrderByRecursion(TreeNode root) {
// Prin ...
Posted by Eman on Thu, 07 Oct 2021 09:08:48 +0200
5. Your reflection
I didn't have time to watch the opening ceremony in the morning. When I came to the computer room, I was surprised to find that:
I
also
Ke
with
water
...
Posted by tc48 on Thu, 07 Oct 2021 05:45:30 +0200
Mo team algorithm --- elegant violence --- natural algorithm
Mo team algorithm - elegant violence
Mo team - elegant violence. When encountering a large number of interval queries, if the left and right subscripts of the interval have a certain law, how can we solve it?
For example:
[
1
,
3
...
Posted by kratos-2012 on Wed, 06 Oct 2021 21:47:35 +0200
[postgraduate entrance examination] sorting algorithm
12 kinds of ranking of postgraduate entrance examination are listed
Bubble sorting
Compare adjacent elements. If the first is larger than the second, exchange them.Do the same for each pair of adjacent elements, starting from the first pair to the last pair. After completion, the last element will be the largest element.Repeat the above ste ...
Posted by yozyk on Wed, 06 Oct 2021 00:52:01 +0200
KMP algorithm-C language implementation of basic data structures and algorithms
Summary
KMP (invented by Knuth,Morris,Pratt) algorithm with time complexity:
T
=
O
(
n
+
m
)
...
Posted by mika79 on Mon, 04 Oct 2021 19:26:44 +0200
Intensive reading of big talk data structure, accompany you to win 45 points EP5 string application and implementation
strlen function
Function of strlen
The strlen function calculates the length of a string
char* p ="abcdef";
int ret = strlen(p);
Action mechanism of strlen
When the string is stored, the last bit will be set to 0 by default
char* p = "abcdef";
abcdefABCDEF \ 0 is stored in memory When our strlen function works, it starts from ...
Posted by Hayce on Sun, 03 Oct 2021 22:50:31 +0200