[2024 KBW] 비탈릭 Keynote 세션 후기
·
BlockChain/Research
KBW에서 비탈릭의 실시간 라이브 Keynote 세션 내용 정리 + 약간의 후기Vitalik Keynote: Ethereum and AI: Synergies and Potential Applications 비탈릭은 AI와 블록체인의 특징을 아래와 같이 분류했습니다.AI: High functionality, Centralized, Not TransparentBlockchain: Limited functionality, Decentralized, Transparent, Open 블록체인의 탈중앙성은 AI의 중앙화로부터 일어나는 문제를 해결할 수 있고,블록체인의 투명성은 AI의 불투명성을 해결할 수 있는 등 시너지를 낼 수 있다고 합니다.왜냐하면 AI는 데이터가 필요하고, 블록체인은 데이터 저장과 추적에 용이..
[NeetCode/Python] Buy and Sell Crypto
·
Algorithm/NeetCode
문제 링크: https://neetcode.io/problems/buy-and-sell-crypto NeetCode neetcode.io 투 포인터/슬라이딩 윈도우 [내 풀이]class Solution: def maxProfit(self, prices: List[int]) -> int: maxProfit = 0 for i in range(len(prices)-1): for j in range(i, len(prices)): profit = prices[j] - prices[i] if profit > maxProfit: maxProfit = profit ret..
[NeetCode/Python] Min Cost Climbing Stairs
·
Algorithm/NeetCode
문제 링크: https://neetcode.io/problems/min-cost-climbing-stairs NeetCode neetcode.io 예전에 알고리즘 감을 살릴겸, 순차적으로 구하는 방법, 역순으로 구하는 방법 두 방법 모두를 사용해서 풀어보았다.점점 이제 이지 난이도에서 벗어나야할텐데... 준비중이다!  [내 코드 1: 순차적 풀이]class Solution: def minCostClimbingStairs(self, cost: List[int]) -> int: n = len(cost) result = [0 for i in range(len(cost))] # cost.length >= 2 result[0], result[1] = cost..
[B+Tree/BTree/BST/Hash Table] 인덱스에서 B+Tree를 사용하는 이유
·
Computer Science/Data Structure
DB 설계에서 가장 중요한 인덱스에 대해서 아는게 너무 없는 것 같아 개인적으로 공부한 내용들이다.  데이터 구조인덱스는 왜 B+Tree를 사용하고 있을까? 이 질문에 대한 해답을 찾기에 앞서, 탐색에 용이한 데이터 구조들과 특징들에 대해 살펴보자. Binary Search Tree(BST) 이진 탐색 트리(Binary Search Tree, BST)는 이진 탐색과 연결 리스트(Linked List)의 장점을 결합한 자료구조이다.이진탐색장점: 탐색에 소요되는 시간복잡도가 O(log N)으로 빠르다.연결 리스트장점: 자료 입력, 삭제에 필요한 시간 복잡도가 O(1). (하지만 맨 앞 또는 맨 뒤의 데이터에 대해서만 시간 복잡도가 O(1)이고 특정 노드 다음에 삽입, 삭제가 이루어지는 경우에는 O(n+1) ..
[LeetCode/Python] 9. Palindrome Number
·
Algorithm/LeetCode
문제 링크: https://leetcode.com/problems/palindrome-number/?envType=study-plan-v2&envId=top-interview-150 숫자를 문자열로 바꿔서 풀면 아주 쉬운 문제다.근데 문제 말미에 문자열로 안바꾸고 풀어보라는 챌린지가 있길래 시도했다가 처참히 실패했다..ㅠ 일단 인풋을 문자열로 바꾸지 않고 숫자 자체로 두고 푼 코드는 아래와 같다.class Solution: def isPalindrome(self, x: int) -> bool: if x 0: n = len(str(x)) divisor = 10 **(n-1) left = x // divisor ..
[LeetCode/Python] 67. Add Binary
·
Algorithm/LeetCode
문제 링크: https://leetcode.com/problems/add-binary/description/?envType=study-plan-v2&envId=top-interview-150 숫자로 쉽게 치환해서 패키지를 써서 이진법 덧셈을 할 생각이었는데, string 자체로 풀어보고 싶다고 생각했다.  [내 풀이]class Solution: def addBinary(self, a: str, b: str) -> str: # without converting string to int carry = 0 i, j = len(a) - 1, len(b) - 1 result = [] while i >= 0 or j >= 0 or carry: ..