Swap in pairs until sorted.
Example:
- 3, 4, 2, 1 (Initial)
- 3, 4, 2, 1
- 3, 2, 4, 1
- 3, 2, 1, 4
- 2, 3, 1, 4
| import { VFSPath } from "./path" | |
| export abstract class VFSEntity { | |
| basename: string | |
| parent?: VFSEntity | |
| constructor(basename: string, parent?: VFSEntity) { | |
| this.basename = basename | |
| this.parent = parent | |
| } |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| struct Array { | |
| int* values; | |
| int size; | |
| }; | |
| struct Array performInitialization(struct Array array) { | |
| int i; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Progress Bar</title> | |
| <script src="https://unpkg.com/vue@next"></script> | |
| </head> |
| const getPath = (path) => { | |
| path = path.replace(/(\"|\')?\]/g, "."); | |
| path = path.split("["); // fbrac | |
| path = path.map(p => p.startsWith("\"") ? p.replace("\"", "") : (p.startsWith("'") ? p.replace("'", "") : p)); | |
| path = path.map(p => p.endsWith(".") ? p.slice(0, p.length - 1) : p); | |
| path = path.join(".").split("."); | |
| return path; | |
| } | |
| const dotnot = "xd.lmao[0]hello.oof['oofies']"; |