Tag:array

  • C-bubble sort

    Time:2019-11-17

    I. definition Bubble sorting: to sort the elements of an array from large to small or from small to large. Note: bubble sorting test array and for understanding, mainly for interview; Two. Analysis. int[] nums={9,8,7,6,5,4,3,2,1,0}; 0 1 2 3 4 5 6 7 8 9 The first comparison: 8 7 6 5 4 3 2 […]

  • 20 common JavaScript string methods

    Time:2019-11-17

    Abstract:Play JS string. Original text: Top 20 common string methods and usage of JS Translator: front-end wit Fundebug is reprinted by authorization, and the copyright belongs to the original author. This paper mainly introduces some of the most commonly usedJSString function. 1. charAt(x) charAt(x)Return stringxCharacter in position, subscript from0Start. //charAt(x) var myString = ‘jQuery FTW!!!’; […]

  • What’s missing in [IOS]

    Time:2019-11-17

    I. afnetworking post pure string Modify location afurlrequestserialization Before modification NSString * AFQueryStringFromParameters(NSDictionary *parameters) { NSMutableArray *mutablePairs = [NSMutableArray array]; for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { [mutablePairs addObject:[pair URLEncodedStringValue]]; } return [mutablePairs componentsJoinedByString:@”&”]; } After modification NSString * AFQueryStringFromParameters(NSDictionary *parameters) { if ([parameters isKindOfClass:[NSString class]]) return (NSString *)parameters; NSMutableArray *mutablePairs = [NSMutableArray array]; for (AFQueryStringPair […]

  • JavaScript (JS) Note 1

    Time:2019-11-16

    JS notes JavaScript annotations are the same as Java annotations //Single line notes /* multiline comment */ JS five basic types:    number (numeric), string (string), Boolean (Boolean), undefined type, null type numberIncludes: numeric type, include integer, floating point, Nan, and infinity. On the space length of arrays: How to get the space length of […]

  • How much do you know about the go language [data structure]?

    Time:2019-11-16

    Pointer This chapter focuses on the application of string, number, array, slice, map, channel, structure and pointer assignment and function parameter transfer   Character string String itself is the structure of stringheader, including data pointer and string length, as follows type StringHeader struct { Data uintptr Len int } The memory address pointed to by […]

  • The difference between array and linked list in data structure

    Time:2019-11-15

    Original link: he Xiaodong blog arrayandLinked listThe main difference between them is their structure. Arrays are index based data structures in which each element is associated with an index. On the other hand, a linked list relies on references, where each node consists of data and references to the previous and next elements. Arrays are […]

  • [convert] javascript high performance array de duplication

    Time:2019-11-13

    Original address: https://www.cnblogs.com/wisewrong/p/9642264.html   I. test template Array de duplication is a commonplace problem. There are various solutions on the Internet In order to test the performance of these solutions, I wrote a test template to calculate the time-consuming of array de duplication // distinct.js let arr1 = Array.from(new Array(100000), (x, index)=>{ return index }) […]

  • Conversion methods of go structure, array, dictionary and JSON string

    Time:2019-11-13

    The encoding / JSON package in go language can easily convert structure, array and dictionary into JSON string. Quote import “encoding/json” Analytic grammar //V passes in instance variables such as structure, array, etc //[] byte array //Possible errors func Marshal(v interface{}) ([]byte, error) Inverse analysis //[] byte array //V pointer address of instance variables such […]

  • HashMap source code — JDK1.8

    Time:2019-11-12

    Important attributes The default capacity is 16 /** * The default initial capacity – MUST be a power of two. *N power of 2 is recommended */ static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16 Default load factor /** * The load factor used when none specified in constructor. */ static final […]

  • Detailed explanation of ES6 array and object’s Deconstruction and assignment

    Time:2019-11-11

    In this paper, an example is given to illustrate the deconstruction and assignment of ES6 arrays and objects. To share with you for your reference, as follows: Deconstruction and assignment of arrays Basic Usage ES6 allows you to extract values from arrays and objects and assign values to variables according to certain patterns, which is […]

  • Learning route of zero basic C language system

    Time:2019-11-9

    How to learn C language is a question many people leave a message asking. In fact, there is no correct answer to this question. A thousand readers have a thousand Hamlets, and everyone’s learning methods and habits are different. Here, I will combine some people’s learning experience and their own learning experience, and give three […]

  • Simple paging and search function under Vue

    Time:2019-11-9

    Recently, Vue and element UI have been used to write a small page to record the simple implementation of paging and search. Emmmm Search box input   search complete         The data is written directly here: cardPhoto:[ {Name: ‘girlish! Cute girl ‘, href: ‘/details’, img: require(‘@/assets/1/1.jpg’), time: ‘2019-09-22’, }, ……… ……… ……… […]