Browse Source

Updated files

master
adiao 3 years ago
parent
commit
9e28463838
  1. 44
      栈队.md
  2. 49
      资产系统开发笔记.md

44
栈队.md

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
栈:FEDCBA
出三
栈:FED
入三 ;队:CBA
栈:FEDZYX
退all 入队
栈:空 队:FEDZYXCBA
63
64
2n = n0 +(n0 +1) + 1
64 + 63 + 1 = 128
2x+1 = 256
x = 257/2

49
资产系统开发笔记.md

@ -928,6 +928,53 @@ private static Collection<? extends GrantedAuthority> getAuthorities(List<Role> @@ -928,6 +928,53 @@ private static Collection<? extends GrantedAuthority> getAuthorities(List<Role>
这样,在用户登录成功后,Spring Security 就能够根据用户名称从数据库中获取用户信息并进行身份验证。
---
算法:
希尔排序实际应用:
~~~java
在Spring Boot项目中,实现希尔排序可以采用以下步骤:
1.定义一个排序方法,使用希尔排序算法实现排序过程。
2.编写测试类,测试排序方法的正确性和效率。
3.在需要排序的地方调用排序方法。
下面是一个简单的示例代码:
```java
//定义希尔排序算法
public static void shellSort(int[] arr) {
int n = arr.length;
for (int gap = n / 2; gap > 0; gap /= 2) {
for (int i = gap; i < n; i++) {
int temp = arr[i];
int j = i;
for (; j >= gap && arr[j - gap] > temp; j -= gap) {
arr[j] = arr[j - gap];
}
arr[j] = temp;
}
}
}
//测试排序方法
public static void main(String[] args) {
int[] arr = {3, 1, 6, 2, 5, 8, 7, 4};
System.out.println("排序前:" + Arrays.toString(arr));
shellSort(arr);
System.out.println("排序后:" + Arrays.toString(arr));
}
//在需要排序的地方调用排序方法
public void testSort(){
int[] arr = {3, 1, 6, 2, 5, 8, 7, 4};
ShellSort.shellSort(arr);
}
```
上述示例代码中,我们首先定义了一个静态方法`shellSort`,并在其中实现了希尔排序算法。然后,我们编写了一个测试类`main`,并在其中测试了排序方法的正确性和效率。最后,我们在需要排序的地方调用了排序方法。需要注意的是,在Spring Boot项目中,所有的Java代码都应当放在正确的包中,并通过Maven或Gradle等构建工具进行管理。
~~~
----
思路1:
@ -962,4 +1009,6 @@ private static Collection<? extends GrantedAuthority> getAuthorities(List<Role> @@ -962,4 +1009,6 @@ private static Collection<? extends GrantedAuthority> getAuthorities(List<Role>
验证模块
token 密钥:NBNtndVbuixdd19h8L1YlYVW96GjRltY6uRGyPvNnjQ29rMOKm
消息队列模块

Loading…
Cancel
Save