pre-order depth-first traversal
recursive algorithm:
do_explorer
set node visited
do something
for each children of the node
call do_explorer
iterative algorithm:
do_explorer
create a stack
push node
while stack is not empty
pop node
set node visited
do something
for each children of the node
push child into stack if child is not visited
post-order depth-first traversal
recursive algorithm:
do_explorer
set node visited
for each children of the node
call do_explorer
do something
iterative algorithm:
do_explorer
create a stack
push node
while stack is not empty
peek a node
if all children of the node is processed
pop the node
do something
else
process next sibling of the node (push stack if not visited yet)
2016년 9월 27일 화요일
iterative depth-first traversal post-order
depth-first traveral 은 크게 pre-order / in-order / post-order tranversal 로 나누어 진다. 이 중 in-order 는 children 의 개수에 따라 정의가 애매하므로 pre-order 와 post-order 만 정리해 보도록 한다.
2016년 3월 8일 화요일
윈도우 개발 환경
cross platform 개발 환경을 추구하는 상태에서 기존에 mingw32 를 써 왔었는데, 최근에 보니 마지막 업데이트가 2013년 정도이고 이후 변한게 없었다. 왜 그런가 봤더니 64bits 가 나오면서 mingw64 로 넘어가서 사람들이 주로 쓰는 것은 이것인 것 같았다. 이에 따라 전체적인 윈도우에서의 컴파일러 / 개발 환경을 다음과 같이 바꾸기로 했다.
- 컴파일러: mingw64 (x84_64, posix)
- 환경: msys2
cygwin 도 고려 대상이었지만 DLL 의존성 때문에 cygwin 은 버리기로 했다.
P.S.
그나저나 .bashrc 는 어디로 사라진 걸까.
2016년 1월 15일 금요일
Windows 10 시작메뉴 복구
어느 순간부터 시작 메뉴 버튼을 눌러도 윈도우 키를 눌러도 나오는 것이 없어지는 경우가 생긴다. 이를 복구하기 위한 방법을 찾아봤지만 제대로 되는 방법은 하나도 없었다. 간신히 제대로 된 방법을 찾은 것은 바로 아래 링크이다.
- http://www.urtech.ca/2015/09/solved-fix-windows-10-start-button-does-nothing-in-10-minutes/
원리는 간단하다. 시작 메뉴의 database 가 깨졌기 때문에 다른 계정을 만들어서 새로 만든 깨끗한 database 를 복사해서 사용하는 것이다.
2015년 11월 10일 화요일
wxWidgets configure options
Windows Option--enable-monolithic --disable-shared --enable-optimise --enable-accel --enable-dccache CXXFLAGS="-std=c++11 -D__NO_INLINE__" OBJCXXFLAGS="-std=c++11 -D__NO_INLINE__"Mac Option--enable-monolithic --disable-shared --enable-optimise --enable-accel --enable-dccache CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++"
C++11 은 개뿔. 특정 플랫폼, 특정 컴파일러에서만 돌아가는 소스 코드를 만들지 않기 위해서는 C++11 을 쓰지 않는 것이 좋겠다는 결정을 내렸다. 예전부터 느꼈던 것이긴 하지만 C++ 은 참 애매한 녀석인 것 같다.
- Windows Option
- --enable-monolithic --disable-shared --enable-optimise --enable-accel --enable-dccache
- Mac Option
- --enable-monolithic --disable-shared --enable-optimise --enable-accel --enable-dccache --with-macosx-version-min=10.7 CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++"
참고로 아래 설명을 보면 GCC 에서 C++11 의 지원은 아직 실험적인 것 같다.
Important: GCC's support for C++11 is still experimental. Some features were implemented based on early proposals, and no attempt will be made to maintain backward compatibility when they are updated to match the final C++11 standard.
2015년 10월 19일 월요일
Champions of Conte
If you save up your units, yes you can have willpower and double edge. I haven't bothered....
Good setup:
Offense: (+10.5% crit rate, +52% crit dmg)
5 - precision
5 - Cruelty
1 - in all prereqs
Defense: (50% to resist block break)
5 - Stand your ground
1 or 4 - Perfect block
1 - in all pre-reqs
Optional: 3 salve, 3 recovery. (I haven't bothered yet)
Utility:
2 or 3 - dexterity (+20-33% increase in next attacks crit rate)
3 - pretrify
3 - pacify
3 - stupify
2 - Parry (stun duration increases with perfect block chance)
1 - pre-reqs
Do the offense first and use the stony cores for that. I did it without spending $0.01. Just save units from arena milestones, arena crystals, and completion/exploration awards.
FYI - always open arena crystals in batches of 10,20, or 30. If you open 10 at a time (20K battle chips), and press the open button, you will always get 15-75 units.
Good setup:
Offense: (+10.5% crit rate, +52% crit dmg)
5 - precision
5 - Cruelty
1 - in all prereqs
Defense: (50% to resist block break)
5 - Stand your ground
1 or 4 - Perfect block
1 - in all pre-reqs
Optional: 3 salve, 3 recovery. (I haven't bothered yet)
Utility:
2 or 3 - dexterity (+20-33% increase in next attacks crit rate)
3 - pretrify
3 - pacify
3 - stupify
2 - Parry (stun duration increases with perfect block chance)
1 - pre-reqs
Do the offense first and use the stony cores for that. I did it without spending $0.01. Just save units from arena milestones, arena crystals, and completion/exploration awards.
FYI - always open arena crystals in batches of 10,20, or 30. If you open 10 at a time (20K battle chips), and press the open button, you will always get 15-75 units.
피드 구독하기:
글 (Atom)
