일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python Implementation
- 715. Range Module
- DWG
- 43. Multiply Strings
- 프로그래머스
- Python Code
- 시바견
- Generator
- Python
- Class
- 30. Substring with Concatenation of All Words
- 109. Convert Sorted List to Binary Search Tree
- Protocol
- 컴퓨터의 구조
- 파이썬
- iterator
- 밴픽
- data science
- 운영체제
- Substring with Concatenation of All Words
- kaggle
- concurrency
- Convert Sorted List to Binary Search Tree
- attribute
- t1
- shiba
- Decorator
- Regular Expression
- LeetCode
- 315. Count of Smaller Numbers After Self
- Today
- Total
목록전체 글 (382)
Scribbling
This post will briefly summarize things I picked up about Java. I'll only handle stuff that is totally different from Python, C++, JavaScript context & syntax. In Java, all classes are Reference Types. Except for primitive types, all the instances or objects are stored on Heap. 1. String 1.1. Methods charAt(int): The charAt method accepts an index value as its input and returns the character loc..
#include #include class Solution { public: vector threeSum(vector& nums) { using namespace std; sort(nums.begin(), nums.end()); vector ret; for (size_t i=0; i 0 and nums[i] == nums[i-1]) { continue; } size_t j = i + 1, k = nums.size() - 1; while (j < k) { int num1 = nums.at(i), num2 = nums.at(j), num3 = nums.at(k); int summed = num1 + num2 + num3; if (summed == 0) { vector temp = {num1, num2, nu..
First thing first: To implement an expression tree with "Postfix", we can easily do so with a stack. For the evaluation part: "ABC" might be a bit unfamiliar, but all you need to know about it here is that you cannot initiate an instance with the ABC class (in this case Node class). In addition, an abstract method must be implemented in the child class. import abc from abc import ABC, abstractme..
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode* curPtr = new ListNode(0); ListNode* ret = curPtr; int sum=0, carry =..
#include #include using namespace std; class Solution { public: vector twoSum(vector& nums, int target) { vector res; unordered_map hash; for (int i = 0; i < nums.size(); i++) { int num = target - nums[i]; // found if (hash.find(num) != hash.end()) { res.push_back(hash[num]); res.push_back(i); return res; } hash[nums[i]] = i; } return res; } }; int main() { vector vec{ 2, 7, 11, 15 }; Solution()..
Data Science 101 1. Data Type and Null Check all_df.info() 1.1. Nullity #missing data total = all_df.isnull().sum().sort_values(ascending=False) percent = (all_df.isnull().sum()/all_df.isnull().count()).sort_values(ascending=False) missing_data = pd.concat([total, percent], axis=1, keys=['Total', 'Percent']) missing_data = missing_data.drop(['SalePrice'], axis=0) missing_data.head(20) 1.2. Featu..
class Queue: def __init__(self, size): self.size = size self.q = [0] * size self.cnt = 0 self.head, self.tail = 0, 0 def append(self, val): if self.cnt == self.size: print('Full Queue Error') return False self.cnt += 1 self.q[self.tail] = val self.tail += 1 if self.tail == self.size: self.tail = 0 return True def popleft(self): if self.cnt == 0: print('Empty Queue Error') return False self.cnt -..
1. Appending Rows to empty DataFrame tt = pd.DataFrame() tt = tt.append({'Date': date, 'Location': country, 'Sadness': arr[0], 'Anger': arr[1], 'Joy': arr[2], 'Optimism': arr[3]}, ignore_index=True) 2. Row Display Option pd.set_option('display.max_columns', 100)
Video I recommend: https://www.youtube.com/watch?v=SToUyjAsaFk In this post, I will cover "Recursive Descent Parsing". Details about it are well elaborated in the above video. This post is to summarize core concepts and implement the algorithm with an actual code. Goal: Implement a parser that parse an arithmetic experssion. - ( 3 + 5) * -2 Elements: Numbers Infix Operators (+, -, *, /) Prefix O..
Rabin-Karp Algorithm is an efficient algorithm to search a string pattern in a given sentence. The core of the idea is to use hash function to compare strings. Time complexity is O(n), where n is length of the string. However, this is true only when there is no hash collision. Time complexity is O(n * m) if hash function is poorly selected (producing many hash collisions), where m is length of t..