Tag:Double chain

  • Foundation of glibc heap management mechanism

    Time:2021-8-19

    Recently, I was studying the heap management mechanism under Linux, collected books and information on the network, sorted it out with my own understanding and made a record. If there is anything wrong, welcome to point out! Memory Allocator Common memory management mechanisms Dlmalloc: Universal allocator Ptmalloc2: glibc allocator, which inherits from dlmalloc and provides […]

  • 016 learn the safe double linked list layout of rust through the linked list

    Time:2021-8-6

    introduce Video address:www.bilibili.com/video/av78062009/Relevant source code:github.com/anonymousGiga/Rust-link… Details At the beginning of this section, we will design a secure double ended queue. For the layout of double ended queues, we mainly use RC and refcell. Rc RC: data can be shared through the RC pointer. Because the rust language has the concept of ownership, after the data […]

  • 017 element addition through linked list rust

    Time:2021-8-5

    introduce Video address:www.bilibili.com/video/av78062009/Relevant source code:github.com/anonymousGiga/Rust-link… Details In the previous section, we defined our double linked list. In this section, we create new function and pushfront function for the double linked list. new impl<T> Node<T> { fn new(elem: T) -> Rc<RefCell<Self>> { Rc::new(RefCell::new(Node { elem: elem, prev: None, next: None, })) } } impl<T> List<T> { […]

  • 021 iterator implemented by linked list rust

    Time:2021-7-31

    introduce Video address:www.bilibili.com/video/av78062009/Relevant source code:github.com/anonymousGiga/Rust-link… Details In this section, let’s implement the iterator for our double linked list. IntoIter The implementation code is as follows: //Implement intoiter pub struct IntoIter<T>(List<T>); impl<T> List<T> { pub fn into_iter(self) -> IntoIter<T> { IntoIter(self) } } impl<T> Iterator for IntoIter<T> { type Item = T; fn next(&mut self) -> […]

  • 018 pop front through the implementation of linked list rust

    Time:2021-7-29

    introduce Video address:www.bilibili.com/video/av78062009/Relevant source code:github.com/anonymousGiga/Rust-link… Details pop front In the previous section, we implemented the new and push front methods for the double linked list. In this section, we implemented pop front. The code is as follows: pub fn pop_front(&mut self) -> Option<T> { self.head.take().map(|node| { match node.borrow_mut().next.take() { Some(next) => { next.borrow_mut().prev.take(); self.head = […]

  • Case study on how Yixin restructures supply chain financial services by using blockchain dual chain technology

    Time:2021-4-2

    Recently, the China Banking and Insurance Regulatory Commission issued the guidance of the general office of the China Banking and Insurance Regulatory Commission on promoting the supply chain financial services for the real economy (hereinafter referred to as the “opinion”), which proposed to encourage banking and insurance institutions to embed new technologies such as the […]

  • Explain the basic operation of double linked list (C language)

    Time:2020-12-23

    @ catalog 1. Definition of bidirectional linked list 2. Creation of double linked list 3. Insert double linked list 4. Deletion of double linked list 5. Change node data in bidirectional linked list 6. Search of double linked list 7. Printing of double linked list 8. Test function and result 1. Definition of bidirectional linked […]

  • Data structure — linked list

    Time:2020-12-23

    Single chain list Double linked list

  • Golang write algorithm

    Time:2020-12-18

    Recently, in reviewing data structure and algorithm knowledge, I intend to use golang to implement common algorithms, including array, single linked list, double linked list, queue, stack, sorting algorithm, binary search, binary search, binary tree search, size heap, recursion, backtracking, greed, divide and conquer, graph search, skip table, bitmap, cache elimination algorithm, dynamic planning In […]

  • Linear lists — arrays and linked lists

    Time:2020-11-4

    outline Linear table is a linear structure, which is a finite sequence of n (n ≥ 0) data elements of the same type. This paper first introduces several basic components of linear list: array, one-way linked list and two-way linked list, and then gives the implementation of bidirectional linked list in Java language. Article reprinted […]

  • Computer experiment of data structure (2)

    Time:2020-11-1

    1. Various basic operations of sequence table #include #include #define MaxSize 50 typedef char ElemType; typedef struct { ElemType elem[MaxSize]; int length; } SqList; //Initialization o (1) void InitList(SqList *&L) { L=(SqList *)malloc(sizeof(SqList)); L->length=0; } //Destruction o (1) void DestroyList(SqList *L) { free(L); } //Judge whether it is empty o (1) int ListEmpty(SqList *L) { […]