This article is a mirror article of machine translation, please click here to jump to the original article.

View: 6964|Reply: 4

Introduction to data structures and algorithms

[Copy link]
Posted on 2/14/2019 9:54:38 AM | | |

1: What is it?

1. What is a data structure: an arrangement of data in computer memory or disk (array, linked list, stack, binary tree, etc.).

2. What is an algorithm: various processing of data with those structures.

2: Function

1. Real-life data storage: HR enters the relevant information of an employee's file, enters the information of new products in the supermarket into the storage system, etc., and these systems are composed of many data structures.

2. Developer's tools: used by the program itself, data structures are used to simplify some operations of program development.

3. Modeling: The use of diagrams can create mountain road maps, aircraft flight route maps, etc.

An array of data storage structures

a. Arrays are the simplest data storage structures relative to other structures, and they are simple and easy to understand.

A diagram will take you to analyze this structure.


Lookup: Here suppose an ascending ordered array is defined, when looking for a value of 80, the subscript will start from 0 until 7 finds the corresponding value.

b. How to play

Syntax 1: dataType[] arrayRefVar = new dataType[arraySize];

Syntax 2: dataType[] arrayRefVar = {value0, value1, ..., valuek};


Another efficient search for array relative linear search - dichotomous search

The premise of the dichotomous algorithm is that the array has been sorted in an orderly manner, and the most classic is the guessing game 1-100.

The algorithm is as follows:

1. Determine the search range front=0, end=N-1, and calculate mid=(front+end)/2.

2. If a[mid]=x or front>=end, the search is ended; Otherwise, continue down.

3. If a[mid]x, the value of the element to be found can only be within a range smaller than the middle element, assign the value of mid-1 to end, recalculate the mid, and move to step 2.






Previous:【Practical Combat】Kibana 6.5.2 Chinese Chinese Tutorial
Next:The latest CCNA videos and books for beginners
Posted on 3/24/2019 10:05:06 PM |

Learn to learn
 Landlord| Posted on 3/25/2019 10:37:55 AM |
Good morning everyone
 Landlord| Posted on 4/3/2019 11:04:59 AM |
Is anyone interested in data algorithms? Welcome to discuss together.
 Landlord| Posted on 9/27/2019 3:55:03 PM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com