Unlock instant, AI-driven research and patent intelligence for your innovation.

An Algorithm Optimization Method Based on Java Set Collection

An optimization method and collection technology, applied in the field of JAVA, can solve the problems of poor time efficiency and space efficiency of Set, complicated relationships, waste of memory space, etc., to reduce coupling, reduce memory usage, and improve operating efficiency.

Active Publication Date: 2021-09-17
ANHUI ZHONGXIN SOFTWARE
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

HashSet, LinkedHashSet, and TreeSet are the specific implementations of three types of Set, but they all use Map to perform operations such as deduplication and storage of elements, which makes the relationship between the two top-level interfaces of Java complicated, and they are doing a lot of character elements. When deduplication work, the current Set time efficiency and space efficiency are not very good, especially when the order of deduplication strings reaches more than one million, a lot of memory space will be wasted

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • An Algorithm Optimization Method Based on Java Set Collection

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] In order to make the technical means, creative features, goals and effects achieved by the present invention easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the The described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0023] Such as figure 1 A method of algorithm optimization based on Java Set collection shown includes the following steps:

[0024] Step 1. Construct the set collection and construct the internal class of the nodes in the set collection. Specifically, the set collection can be realized through collections such as HashSet and TreeSet; ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the technical field of JAVA, in particular to an algorithm optimization method based on Java Set collection, which includes constructing a set collection and constructing an inner class of nodes in the set collection, constructing an internal interface of an object entity through the inner class, The internal interface sets the actual element of the storage collection, the internal interface sets the attribute value of the actual element, the internal interface provides the acquisition method, setting method, comparison method, hash value acquisition, and construction of a hash table of the actual element , store the object of the node in the hash table, perform element comparison, rebuild the set separately under the branch of the set set, and de-duplicate the set through a Bloom filter for a large number of strings. The invention abandons the method of realizing Set through Map, independently designs and completes the method of deduplication and storage of Set collection elements, improves the operation efficiency of java code and reduces the coupling degree of java source code modules; independently realizes a large number of string deduplication methods and reduces memory usage.

Description

technical field [0001] The invention relates to the technical field of JAVA, in particular to an algorithm optimization method implemented based on a Java Set collection. Background technique [0002] Java is one of the hottest programming languages ​​for software system development at present, with a huge number of users. Java Set is a single-element collection in Java, and its characteristic is the uniqueness of elements. HashSet, inkedHashSet, and TreeSet are the specific implementations of three kinds of Set respectively. Among them, the deduplication method of HashSet is realized through HashMap, TreeSet is realized through TreeMap, and LinkedHashSet is realized through LinkedHashMap. Java Set does not do corresponding actual processing for deduplication of a large number of character elements. [0003] Java Set is a single-element collection in java, which is characterized by element uniqueness. HashSet, LinkedHashSet, and TreeSet are the specific implementations of ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/41
CPCG06F8/443
Inventor 孟彦章文友朱静轩
Owner ANHUI ZHONGXIN SOFTWARE