Learning & Theory/Algo (1) 썸네일형 리스트형 [ Algo ] 페이징 알고리즘 1. 전체 페이지 수 가. 기본공식 $$ \begin{align} &T : \text{전체 게시물 수 (Total number of posts)} \newline &P : \text{페이지 별 게시물 수 (Posts per page)} \newline &N : \text{전체 페이지 수 (Number of pages)} \newline \newline &N = \left\lfloor\left( \frac{T - 1}{P} \right)\right\rfloor + 1 \end{align} $$ 나. 언어 별 구현 코드 1) Java public static int getTotalPageCnt(int totalPostCnt, int pagePerPostCnt) { int totalPageCnt = (tota.. 이전 1 다음