-
데이터 조회 속도 개선 > part.1 DB■ Back-End/- PostgreSQL 2019. 5. 24. 09:00
연락처 서비스 개발시 많은 데이터를 조회해서 화면에 뿌려줘야 하는 경우가 있었는데, 페이징 처리를 하지 않고 한 번에 다 보여줘야 했다. 우선 DB에서 데이터를 조회할 때 함께 Join 걸어야 하는 테이블의 수가 많아서, 데이터가 많을 경우 시간이 오래 걸렸다. 그리고 화면에서는 보여줘야할 값들이 많아서, 스크롤을 내릴 때마다 버벅거림이 심했다. 이 두 가지 이슈를 해결하기 위해 쿼리 튜닝과 Indexed DB를 이용한 캐싱 처리를 진행했다. 1. 쿼리 튜닝 DB 구조 테이블 명 구조 기본정보 address_service_no(PK), user_no(PK), user_name, .... 전화번호 정보 address_service_no(PK/FK), phone_no(PK), phone_type, phone..
-
[자료구조] Javascript로 Queue 구현하기■ Front-End/- JavaScript & TypeScript 2019. 5. 23. 00:21
Javascript로 Queue를 구현한 코드이다. 이 코드도 Stack과 마찬가지로 Javascript에서 기본적으로 제공하는 push(), pop() 메서드를 사용하지 않고 작성했다. class Queue { constructor() { this.bucket = []; } isEmpty() { return this.bucket.length == 0; } enqueue(val) { this.bucket[this.bucket.length] = val; } dequeue() { if(this.bucket.length == 0) { return -1; } let val = this.bucket[0]; this.bucket = this.bucket.slice(1, this.bucket.length); cons..
-
[자료구조] Javascript로 Stack 구현하기■ Front-End/- JavaScript & TypeScript 2019. 5. 23. 00:07
Javascript에서 제공하고 있는 push(), pop()을 사용하지 않고 Stack Class를 만들어 구현하는 코드이다. class Stack { constructor() { this.top = -1; this.bucket = []; } isEmpty() { return this.bucket.length == 0; } push(val) { this.bucket[++this.top] = val; } pop() { if(this.top < 0) { return -1; } else { let popVal = this.bucket[this.top]; this.bucket = this.bucket.slice(0, this.top); this.top--; return popVal; } } peek() { r..
-
[알고리즘] #Maximum Depth of N-ary Tree■ Algorithm 2019. 5. 22. 10:00
출처 :https://leetcode.com/problems/maximum-depth-of-n-ary-tree/ Maximum Depth of N-ary Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the..
-
[알고리즘] #Minimum Depth of Binary Tree■ Algorithm 2019. 5. 22. 08:59
출처: https://leetcode.com/problems/minimum-depth-of-binary-tree/ Minimum Depth of Binary Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to..
-
[알고리즘] #Increasing Order Search Tree■ Algorithm 2019. 5. 20. 00:45
출처: https://leetcode.com/problems/increasing-order-search-tree/ Increasing Order Search Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no le..
-
[알고리즘] #Maximum Depth of Binary Tree■ Algorithm 2019. 5. 19. 22:50
출처 : https://leetcode.com/problems/maximum-depth-of-binary-tree/ Maximum Depth of Binary Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to th..
-
[자료구조] Java로 Tree 구현하기■ Back-End/- Java 2019. 5. 19. 13:57
Java로 Tree 클래스를 만들어보았다. 알고리즘 문제를 풀다보면 트리 클래스를 직접 만들어서 구현해야할 때가 있는데, 이럴 때 사용하면 편리하다. class Tree { private int val; private Tree leftNode; private Tree rightNode; public Tree(int val) { this.val = val; } public int getVal() { return this.val; } public void setVal(int val) { this.val = val; } public Tree getLeftNode() { return this.leftNode; } public void setLeftNode(Tree leftNode) { this.leftNode ..