본문 바로가기

MS Jeong - Blog

검색하기
MS Jeong - Blog
프로필사진 숫눈길

  • 분류 전체보기 (36)
    • Programming (36)
      • Algorithms (13)
      • Function (21)
      • Coding Techniques (1)
    • etc. (0)
Guestbook
Notice
Recent Posts
Recent Comments
«   2025/12   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

MS Jeong - Blog

[Function] binarySearch: find x in v[0] <= v[1] <= ... <= v[n - 1]

/* binarySearch: find x in v[0]

Programming/Function 2017. 8. 8. 23:59
[Function] rightRot(unsigned x, unsigned n): rotate x to right by n bit positions

/* rightRot: rotate x to right by n bit positions */ unsigned rightRot(unsigned x, unsigned n) { unsigned int temp, len, mostRight; for (temp = x, len = 1; (temp >>= 1); len++) { ; } mostRight = (1 > 1) | mostRight); } else { x >>= 1; } } return x; }

Programming/Function 2017. 8. 8. 23:51
[Function] invert(unsitned x, int p, int n): returns x with n bit starting at p inverted

/* returns x with n bit starting at p inverted */ unsigned invert(unsigned x, int p, int n) { return (x ^ (~((~0)

Programming/Function 2017. 8. 8. 17:36
Prev 1 2 3 4 ··· 12 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바