Linear data structure query efficiency improving method

A technology of query efficiency and linear data, applied in electrical digital data processing, instruments, memory systems, etc., can solve problems such as increased time complexity of linear search

Inactive Publication Date: 2016-08-10
SHENZHEN SUNGREAT COMM CO LTD
View PDF5 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0015] It can be seen that as the number of band searches (m) and the length of

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
  • Linear data structure query efficiency improving method
  • Linear data structure query efficiency improving method
  • Linear data structure query efficiency improving method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] Embodiment 1, this embodiment is a method of searching the linear array in the shared memory by converting it into a red-black tree.

[0030] In this embodiment, the following arrays are stored in the shared memory:

[0031]

[0032] The array in the shared memory contains the information of 1000 students. If a process needs to search for 1000 students, the time spent is 1000*(1000 / 2)=500000 time units.

[0033] At this time, this process may construct a dedicated red-black tree construction process to construct the following red-black tree:

[0034]

[0035]

[0036] In the red-black tree structure defined above, we can use the student number as the key of the red-black tree, and the address of the array element of the student information as the data field of the red-black tree, so as to construct a red-black tree, so as to realize the The lookup of a linear array is converted into a lookup of a red-black tree.

[0037] Here, I assume that the insertion oper...

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 present invention relates to a linear data structure query efficiency improving method. The method comprises the following steps: taking an ID of a linear storage data object as a KEY of a red-black tree node, and taking an address of the data object in a storage medium as a data domain of the red-black tree node, so as to construct a red-black tree; and inquiring the KEY of the red-black tree in the red-black tree, and when the key corresponding to the ID of the same data object is inquired, obtaining a to-be-searched object from data directing storage addresses. Thus, query in linear storage elements is converted into query in the red-black tree, so that search time is significantly saved.

Description

technical field [0001] The invention relates to the field of query methods, in particular to a method for querying in a shared memory. In the method, data objects in the shared memory are sequentially and linearly stored. Background technique [0002] In the field of programming, there is a concept called an array. In implementation, an array is a linear storage space with continuous addresses such as figure 1 Shown: [0003] This piece of space is divided into equal parts, for each part, it can be expressed as follows: [0004] arr[i] [0005] where i is 0~(n-1) [0006] We call arr[i] an element of this array, and i is called a subscript. [0007] For the search of the array, each element of the array is traversed and then compared, for example: [0008] [0009] The time complexity is a function of n: [0010] f(n)=O(n) [0011] If there are m values ​​to be compared, such as [0012] [0013] Then the time complexity is: [0014] f(n)=O(m*n) [0015] It ...

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
IPC IPC(8): G06F12/06
CPCG06F12/0623
Inventor 欧军和黄楚恩
Owner SHENZHEN SUNGREAT COMM CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products