Do PHP programmers want to learn about data structures?

Source: Internet
Author: User
Keywords Php
Recently participated in a number of major companies in the school recruitment test, most of the questions are data structures and algorithms, such as how to use the data structure PHP? Please give my brother some instructions, reply

Reply content:

Programmers have to learn the data structure is the foundation, linked list, binary tree, hash, sorting algorithm, you may write PHP code, not necessarily be able to use, but, master them can let you to the operation principle of the program to have a deeper understanding.

To give a simple example:
We often use PHP arrays, PHP arrays can not only be a foreach way to traverse, but also through the key-value way to access, we feel very convenient, then the problem comes, for God horse will this?
The reason is that the array of PHP5 is a Hashtable (hash table, which supports key-value direct mapping), and the elements are joined together by a doubly linked list (traversal is supported). If the students do not learn the data structure, linked lists and hashes do not know, much less understand the internal operating principle.

This is a data structure application of the iceberg , want to have a deep understanding of technology, learning data structure is necessary. And better grasp the principle layer, but also can promote our program optimization and thinking, the use of more resource-saving system to complete our business needs. Simply from the point of view of PHP code is not required, but the school recruit you have not done any project, that does not ask you data structure and algorithm, ask you what question? At the very least, data structures and algorithms can test whether you are studying hard in college. Tuesday just interviewed a PHP programmer, in addition to a question, the qualified answer is O (n^2) cross-traverse two arrays, the good answer is O (n) traverse the first array to make a map, and then traverse the second array by the way of map.

However this person except call PHP method In_array (?) , we don't know how to make a map. Now we're obsessed with trying to recruit this guy.






It's weird. If you don't learn it, you don't learn it, so what do you learn? Personal advice is: take care of the work first, spare time for the study. There is time in this brush to find the answer, it is better to find the data structure of the book to look at it! The master was young, mistakenly into the MLM organization, inside the various traversal of the tree since the Association of the road, the database structure is not enough, but also the operating system principle, parallel computing have to battle, this is much tired ah, if the money is not much, really can not dry. No need to learn, five years later to management post
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.