def bububle_sort(alist):
"""冒泡排序(稳定|n^2m)"""
n = len(alist)
for j in range(n-1):
count = 0
for i in range(0,n-1-j):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#---------------------------------------------------------------------------------- | |
# author: Andy | |
# feature: clean useless git-branch, | |
# but master, current branch, other branch you passed in command line | |
# usage: bash auto_remote_local_git_branch.bash branch branch branch is you don't want remove | |
#---------------------------------------------------------------------------------- | |
echo -e "begin...\n" |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// narcissisticNumber | |
// | |
// Created by fzw on 10/7/18. | |
// Copyright © 2018 n. All rights reserved. | |
// | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// MergeTwoSortedArray | |
// | |
// Created by fzw on 9/26/18. | |
// Copyright © 2018 n. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// addBinary | |
// | |
// Created by fzw on 10/7/18. | |
// Copyright © 2018 n. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// RotateList | |
// | |
// Created by fzw on 10/7/18. | |
// Copyright © 2018 n. All rights reserved. | |
// | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// reverse node in k group | |
// | |
// Created by fzw on 10/12/18. | |
// Copyright © 2018 n. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func fib() func() int64 { | |
var i int64 | |
var j int64 = 1 | |
return func() int64 { | |
i, j = j, i+j | |
return i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
def move(n, x, y, z): | |
if n == 1: | |
print("%s --> %s" % (x, z)) | |
else: | |
move(n-1, x, z, y) | |
print("%s --> %s" % (x, z)) |
NewerOlder