61. Comparison of several common sorting methods
Sorting method |
Average Time |
Worst case scenario |
Degree of stability |
Extra Space |
Bubble |
O (N2) |
O (N2) |
Stability |
O (1) |
Exchange |
O (N2) |
O (N2) |
Not stable |
O (1) |
Choose |
O (N2) |
O (N2) |
Not stable |
O (1) |
Insert |
O (N2) |
O (N2) |
Stability |
O (1) |
Base |
O (LOGRB) |
O (LOGRB) |
Stability |
O (N) |
Shell |
O (NLOGN) |
O (NS) 1<s<2 |
Not stable |
O (1) |
Fast |
O (NLOGN) |
O (N2) |
Not stable |
O (LOGN) |
Merge |
O (NLOGN) |
O (NLOGN) |
Stability |
O (N) |
62. Optimize the 7 major measures that Hibernate encourages:
1). Use Many-to-one as much as possible and avoid using single One-to-many
2). Flexible use of unidirectional one-to-many
3). Do not use one-to-many substitution
4). Configure the object cache without using the collection cache
5). Use set for one-to-many use of bag
6). Inheritance use show polymorphic Hql:from object polymorphism= "exlicit" to avoid investigation of all objects
7). Eliminate large tables, use level two cache
The difference between post and get in 63.HTTP
Operation mode |
Data location |
Vmcontext |
Data security |
Length limit |
Application Scenarios |
GET |
HTTP Header |
Plaintext |
Not safe |
Small length |
Querying data |
POST |
HTTP body |
Can be clear and dense |
Safety |
Supports large data transfer |
modifying data |
64.Java class Loader
Class loading is done by the ClassLoader, which includes the root loader (BootStrap), the extension loader (Extension), the system loader (systems), and the user-defined class loader (subclass Java.lang.ClassLoader). Starting with Java 2 (JDK 1.2), the class loading process takes the Father delegation mechanism (PDM). PDM better guarantees the security of the Java platform, in which the JVM's own Bootstrap is the root loader, and the other loaders have only one parent class loader. The load of a class first requests that the parent ClassLoader be loaded, and the parent ClassLoader is not loaded by its child ClassLoader. The JVM does not provide a reference to the Bootstrap to the Java program. The following is a description of several class loaders:
- Bootstrap: Generally implemented with native code, responsible for loading the JVM base Core class library (Rt.jar);
- Extension: Loads the class library from the directory specified by the Java.ext.dirs system property, and its parent loader is Bootstrap;
- System class Loader: Also called the application ClassLoader, whose parent class is Extension. It is the most widely used class loader. It is the default parent loader for the user-defined loader, which records the class from the environment variable classpath or the directory specified by the system attribute Java.class.path.
- User-defined class loader: Subclass of Java.lang.ClassLoader
65.
java--Notes (7)