Without recursive implementation of the infinite level of classification, a simple test of performance than recursion a little bit better, but write too complex, or recursive simple convenient point
Code:
1, ' pid ' =>0, ' deep ' =>0, ' name
The example in this article describes the way to implement an infinite loop for the Go language simulation while statement. Share to everyone for your reference. The implementation methods are as follows:
This code uses the For statement as a while
There are roughly three ways to type PHP's infinite categories,
1, the database by setting the parent class ID to make a unique index, and then use the function of recursive calls to achieve an infinite classification;
2, database design through a
This article illustrates the infinite-level tree-shaped menu effect code implemented by Json+jquery. Share to everyone for your reference. Specifically as follows:
This demonstrates the JSON tree menu, the JS Tree-level Tree menu, the introduction
Recently read an article about the JSON infinite folding menu, feel good writing, but also to study the next his code, so he also made a demo, in fact, such a menu item is our site or project navigation menu items are very common effect, especially
This paper illustrates the method of realizing infinite classification of php+mysql database. Share to everyone for your reference. The specific analysis is as follows:
This PHP unlimited classification code more complete, including the database is
The example of this article describes the implementation of JS infinite-level tree navigation list effect code. Share to everyone for your reference. Specifically as follows:
This is a JS to achieve an infinite level of tree-shaped drop-down
This article describes the method of realizing the infinite pole classification of smarty template in PHP. Share to everyone for your reference, specific as follows:
". $n $class _arr[$i][1]. "
\n "; }else{$str. = " $n. $class _arr[$i][1]
Table1 table with infinite hierarchy, ID (primary key), ParentID (parent ID) queries all subordinates or all ancestors of an ID, using the WITH as,union all query1, the query ID is 1 all subordinate withT as( SELECT * fromTable1WHEREId=1
Objective:Whether the database table design of infinite tree structure is reasonable, directly affects whether the UI layer is convenient to query the associated data according to the tree.1. Table field:int uncheckedf_name nvarchar (+)
First, create a DBCREATE TABLE IF not EXISTS ' class ' ( ' id ' mediumint (6) is not NULL auto_increment, ' title ' varchar () ' is not NULL, ' PID ' Mediumint (6) Not NULL default ' 0 ', PRIMARY KEY (' id ')) engine=myisam default
The jsTree-based infinite tree JSON data conversion code. For more information, see. Jstree homepage:
Http://www.jstree.com/
It provides a form of rendering data from the background into a tree:
The Code is as follows:
$ ("# Mytree"). tree
This article mainly introduces the implementation of JQuery asynchronous loading of the infinite drop-down box cascade function. For more information, see
The Code is as follows:
/*JQuery asynchronously loads the infinite pole drop-down box
XML is as follows:
The function originally intended to be implemented is to make the transparency from 0 to 1, wait for 2 seconds, and then let the transparency from 1 to 0 to achieve the goal of flashing; the advantage of doing so is
Given any D, it is the probability that some H's bad Sample (i.e. Ein and eout are not close) is:That is, the number of alternative functions in H m=| H| The less the sample data is, the smaller the probability of the sample becoming a bad sample.
Infinite class Classification 、、、 but efficiency is not the best ... Do you have code for faster and better efficiency?
Use recursion to wait for more categories to affect efficiency!
Please share!
Class.sql
The structure of the----table ' class '-
Recently in can PHP directory operation, made a directory infinite traversal:
The functions used are:
Isset () Determines whether a variable is defined
ChDir () changes the current directory to the specified directory.
Opendir () to open the
Php+mysql Unlimited class instances without recursive implementations (non-recursive), MySQL recursion
Recursion is generally the first and easiest to implement for infinite classification, but recursion is generally considered a resource-intensive
Infinite classification is implemented, but you want to display a tree view of the rendering
such as the root directory
|____ Big Class 1
| |-Small Class 1
| |-Small Class 2
|____ Big Class 2
Infinite classification I have implemented it with
Implementation of infinite nested GridView in. net 2.0Note: To put it simply. the infinite nesting of the GridView in net2.0 (a slight modification is Repeater .. of course, in actual development, you may not use it or be replaced by other methods
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.