The algorithm evolved from the Bellman-ford algorithm, first introduced the Bellman-ford algorithm.The shortest path is up to n-1 points, which can be obtained with the n-1 wheel relaxation operation. for(intI=0; i) D[i]=inf;d[0]=0; for(intk=0; k1; k++) for(intI=0; i//Check each edge{ intx=U[i]; inty=V[i]; if(d[x]INF) D[y]=min (d[y],d[x]+w[i]);} Of course, this algorithm I have not actually applied, but
The For loop is used in the previous article, and this section describes the common if statement, the for statement, and the while statement.1. If statementCars = ['BMW','Benz','BYD','Ford','Rowei'] forCarinchCars:ifCar = ='BMW': Print (Car.upper ())Else: Print (Car.title ())The meaning is that if there is a car brand is BMW, the capital output.Determines whether the code in the IF statement is executed based on the value of the condition test to TRUE
($type)
{
if ($type = = \ "Firestone\")
{
$this->property1 = \ "must be a Ford suv\";
}
}
function Color ($col)
{
$this->property2 = $col;
}
}
?>
How to use a well-defined class
Once the class is defined, we can create an instance of it. To use just the example below, we create an instance of the "Vehicle" class below.
$myCar = new Vehicle ();
$myCar->settires (\ "firestone\");
?>
Using variables in a class
The biggest difference is in the
-nov-81 5000 107844TURNER salesman 769808-sep-81 1500 0 307876ADAMS Clerk 778823-may-87 1100 207900JAMES Clerk 769803-dec-81 950 307902FORD ANALYST 756603-dec-81 3000 207934MILLER Clerk 778223-jan-82 1300 10Rows selected.The observation found that the database in the table has dependencies, such as 7369smith Manager is 7902,7902 also an employee, the name is Ford, his manager is 7566jones, and so on, we can eventually find the company's boss 7839 King
Label:First, select basic syntax: SELECT *| {[DISTINCT] column|expression [alias],...}
from table;
Select identifies which columns are selected.From identifies the table from which to select. 1. Remove all columns from the table SELECT * from EMP; Connected to Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 Connected as c##[emailprotected] sql> SE
Lect * from EMP; EMPNO ename JOB MGR hiredate SAL COMM DEPTNO--------------------------------------------- -------------------7369 SMITH
How to sort in MySQL:Select * from table name [where condition order by field name ( default is asc
in ascending order )]ASC is in ascending order andDESC is used to specify descending orderOracle Neutron query:SELECT * from table name where condition (SELECT * from table name where condition) Instance:In:select * from EMP where deptno in (select Deptno from dept where loc = ' DALLAS ' or loc = ' bostom ');All:select * from emp where sal > All (select Sal from emp where ename = ' JAMES
table represents the salary level, with the highest and lowest values for each grade. EMP table for employee's basic informationSql> select * from Salgrade;GRADE Losal Hisal---------- ---------- ----------1 700 12002 1201 14003 1401 20004 2001 30005 3001 9999Sql> Select Empno,ename,sal,grade2 from EMP e inner JOIN Salgrade s3 on e.sal between S.losal and S.hisal;EMPNO ename SAL GRADE---------- ---------- ---------- ----------7369 SMITH 800 17876 ADAMS 1100 17900 JAMES 950 17521 WARD 1250 27654
instance.
Example 1:
var test = {"Name":"Peter","Age":20};
document.write(test.Name + ": " + test.Age);
Display result:
Peter: 20
{"Name": "Peter", "Age": 20} in the test variable is an object with two elements (like an array of PHP ):The Name is Peter, and the Age is 20.
Of course, it can also become more complex.
Example 2:
var test = {"User":{"Name":"Peter","Age":20},"Company":"FORD"};
document.write(test.User.Name + ": " + te
(test.Name + ": " + test.Age);
Display result:
Peter: 20
{"Name": "Peter", "Age": 20} in the test variable is an object with two elements (like an array in PHP): Name is Peter, age is 20.
Of course, it can also become more complex:Procedure 2:
var test = {"User":{"Name":"Peter","Age":20},"Company":"FORD"};document.write(test.User.Name + ": " + test.Company);
Display result:
Peter: FORD
In this exampl
After the school competition is over, this school competition is very poor. There is no algorithm question, 2 water questions, 1 greedy, probability DP, DP, and number questions. DP hasn't started research yet. No number theory at all. The mathematics is too bad. In the Provincial Division, the number theory is still card number theory. I have to continue learning!
A rusty sword can only show its strength if it is constantly honed!
The following is a summary of the most short circuit:
The most
1. Which departments have more people than department 20.Select deptno, COUNT (*) FROM EMPGROUP BY DEPTNOHaving count (*)>(Select count (*) FROM EMPWhere deptno = 20);2. Who is SMITH's leader (non-associated subquery ).SELECT ENAMEFROM EMPWhere empno =(SELECT MGR FROM EMPWhere ename = 'Smith');
3. FORD leads (non-associated subqueries ).SELECT ENAMEFROM EMPWHERE MGR IN(SELECT EMPNO FROM EMPWhere ename = 'Ford
Tables available: SQL> SELECT deptno, ename FROM emp ORDER BY deptno, ename; deptno ename ------ ---------- 10 CLARK 10 KING 10 MILLER 20 ADAMS 20 FORD 20 JONES 20 SCOTT 20 SMITH 30 ALLEN 30 blke 30 JAMES 30 MARTIN 30 TURNER 30 WARD 14 rows selected. output: deptno ename ------ ---------- 10 CLARK, KING, MILLER 20 ADAMS, FORD, JONES, SCOTT, SMITH 30 ALLEN, BLAKE, JAMES, MARTIN, TURNER, in addition to using
reflect a data structure in a string mode, what is the difference between them.
Let's start with JSON and look at a simple instance.Procedure 1:
var test = {"Name":"Peter","Age":20};document.write(test.Name + ": " + test.Age);
Display result:
Peter: 20
{"Name": "Peter", "Age": 20} in the test variable is an object with two elements (like an array in PHP): Name is Peter, age is 20.
Of course, it can also become more complex:Procedure 2:
var test = {"User":{"Name":"Peter","Age":20},"Company"
+ =increasement; the } - returnSUMFOLW; in } the the About the intMain () the { theFreopen ("c:\\users\\lenovo\\desktop\\ work \ \ Huawei Challenge game \ Data _e-k.txt","R", stdin); + - for( ShortI=0; i) the for( Shortj=0; j)BayiCin>>Cap[i][j]; the the //Print adjacency matrix -cout"the adjacency matrix (a forward graph) is:"Endl; - for( ShortI=0; i) the for( Shortj=0; j) the { thecout" "; the if(j==arrsize-1) -coutEndl; the } thecou
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.