Tag:Positive number

  • O. Θ, Ω, O, ω, don’t be confused!

    Time:2021-4-1

    preface This article is included in the album:http://dwz.win/HjK, click to unlock more knowledge of data structure and algorithm. Hello, I’m brother Tong, a hard core man who climbs 26 floors every day and doesn’t forget to read the source code. In the previous sections, we learned how to analyze the complexity of the algorithm, and […]

  • Front end bug record – what is scientific counting?

    Time:2021-3-26

    Scientific counting is a method of counting.Features: precision loss, space saving What is scientific counting Express a number as a and aThe form of multiplication of n-th power of 10(1 ≤| a | < 10, a is not a fraction, n is an integer).19971400000000 == 1.99714×10^13 == 1.99714e13 When we want toTo mark or calculate […]

  • The use of Yii redis set

    Time:2021-3-16

      The set of redis is unordered, and its members are unique and cannot be repeated. Users can quickly add elements, remove elements and check whether an element exists in the collection. Here are some common set processing commands and their use in Yii. SADD SADD:SADD key-name item [item …]Add one or more elements to […]

  • Leetcode 41. Missing first positive number | Python

    Time:2021-2-23

    41. Missing first positive number Title Source: leetcode https://leetcode-cn.com/problems/first-missing-positive subject To give you an unsorted integer array, please find the smallest positive integer that does not appear in it. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4, – 1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 Tips: The time complexity of your […]

  • Shaggot event book – regular expressions

    Time:2021-2-8

    //Nonzero positive integers var num1 = /^+?[1-9][0-9]*$/; //Positive integer + 0 var num2 = /^d+$/; //Positive number var num3 = /^d+(?=.{0,1}d+$|$)/; //Amount format var moneyReg = /(^[1-9]([0-9]+)?(.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9].[0-9]([0-9])?$)/; Keep updating

  • Stack sequential storage

    Time:2020-12-15

    Array implementation stack Create three files: stackearray. H, stackearray. C, stackearraytest. C stackArray.h #ifndef STACK_ARRAY_H_ #define STACK_ARRAY_H_ #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif #define ADT StackArray //Function: the process of comparison between a and B //Parameters: A, B //Return: a > B returns a […]

  • Circular queue – sequential storage

    Time:2020-11-30

    Array to achieve circular queue Create three files: queuearray. H, queuearray. C, and queuearraytest. C queueArray.h #ifndef QUEUE_ARRAY_H_ #define QUEUE_ARRAY_H_ #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif #define ADT QueueArray //Function: the process of comparison between a and B //Parameters: A, B //Return: a > […]

  • Circular double ended queue sequential storage

    Time:2020-11-29

    Array implementation of circular double ended queue Create 3 files: doubleendedqueuearray. H, doubleendedqueuearray. C, doubleendedqueuearraytest. C doubleEndedQueueArray.h #ifndef DOUBLE_ENDED_QUEUE_ARRAY_H_ #define DOUBLE_ENDED_QUEUE_ARRAY_H_ #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif #define ADT DequeArray //Function: the process of comparison between a and B //Parameters: A, B //Return: a […]

  • Binary heap sequential storage

    Time:2020-11-28

    Implementation of binary heap by array Create three files: heaprarray. H, heaprarray. C, heapararraytest. C heapArray.h #ifndef HEAP_ARRAY_H_ #define HEAP_ARRAY_H_ #ifdef __GNUC__ #define DEPRECATED __attribute__( (deprecated) ) #elif defined(_MSC_VER) #define DEPRECATED __declspec( deprecated ) #else #define DEPRECATED #endif #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif […]

  • Stack chain storage

    Time:2020-11-27

    Linked list implementation stack Create three files: stacklinked. H, stacklinked. C, stacklinkedtest. C stackLinked.h #ifndef STACK_LINKED_H_ #define STACK_LINKED_H_ #ifdef __GNUC__ #define DEPRECATED __attribute__( (deprecated) ) #elif defined(_MSC_VER) #define DEPRECATED __declspec( deprecated ) #else #define DEPRECATED #endif #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif #define ADT […]

  • Queue chain storage

    Time:2020-11-26

    Linked list realizes queue Create three files: queuelinked. H, queuelinked. C, queuelinkedtest. C queueLinked.h #ifndef QUEUE_LINKED_H_ #define QUEUE_LINKED_H_ #ifdef __GNUC__ #define DEPRECATED __attribute__( (deprecated) ) #elif defined(_MSC_VER) #define DEPRECATED __declspec( deprecated ) #else #define DEPRECATED #endif #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif #define ADT […]

  • Why is precision lost? Teach you to understand IEEE-754!

    Time:2020-9-27

    Link to the original text: https://ssshooter.com/2020-09… The image above is from Wikipedia. IEEE-754 standard is a floating-point number standard. There are three formats: 32-bit, 64-bit, and 128 bit (the above two pictures are 32-bit and 64 bit respectively, and the structure is consistent). JavaScript uses 64 bit, which is commonly known as “double precision”. This […]