목록전체 글 (133)
고양이와 코딩
업무를 하다보면, 그냥 앞서 짜여져 있는 코드를 따라 나도 비트 마스크, 시프트 연산을 마구 사용하지만막상 남이 짠 연산 코드를 빨리 해석해서 공유해야 하는 상황이 오면 당황하게 된다 .... 사실 나는 컴퓨터가 아니기 때문에 왜 곱셈/나눗셈을 안하고 시프트 연산을 썼을까 .. 하면서 1차로 함수 이름으로 어떤 연산을 하는지 추측하곤 한다 ^^ ㅋ 이렇게 하면 훨씬 쉬워지지만 ~ 비트 연산도 결국 연산이니까 ,,, 어렸을때 곱셈 나눗셈 구몬 무한반복 했을때처럼 하면 좀 익숙해지지 않을까 싶어서 .. 아무튼 시작 1. 비트 제어 패턴value |= (1U | 연산자는 또는(OR)니까, 같은 자리에 둘 중 하나만 1이어도 1이 된다! & 연산자는 그리고(AND)니까, 같은 자리에 둘 다 1이어야 1이 된..
Chapter 01ARM은 프로세서 설계를 전 세계의 선도적인 반도체 회사들의 대부분을 포함한 비즈니스 협력사들에게 라이센스를 해준다.협력사들은 ARM의 저가이면서 저전력 프로세서 설계를 기반으로 하여 프로세서와 마이크로컨트롤러, 그리고 시스템-온-칩(SoC)를 만든다.이러한 비즈니스 모델은 일반적으로 지적 소유권(Intellectual Property: IP) 라이센싱이라고 불린다. → ARM은 직접 반도체를 생산하지 않고, IP라이선스를 제공하는 비지니스 모델을 가지고 있음즉, 반도체 회사(삼성, 퀄컴, 미디어텍, NXP ,,,)가 ARM으로부터 CPU코어(IP)를 라이선스 받아, 자신들의 칩(SoC, MCU등)에 포함시키는 방식임.칩을 개발하는 회사들은 필요한 IP들을 라이선스로 구매하여 조합하고,..
1. 모음 제거#include #include #include char* solution(const char* my_string) { char vowels[] = {'a', 'e', 'i', 'o', 'u'}; int str_len = strlen(my_string); char* answer = (char*)malloc(str_len + 1); int idx = 0; for(int i = 0; i vowels 는 배열로 선언. answer는 얼마가 될 지 모르는 문자열을 동적으로 할당하는것이므로 포인터가 필요!str_len + 1은 문자열 뒤 '\0' 공백이 차지하는 자리를 고려한것 2. 배열의 평균값 #include #include #include // number..
연결리스트 문제는,, 첨 풀어봐서 ~ 검색해보고 아이디어를 얻어서 힘겹게 ㄱ ㅡ풀어냈다(이게 easy라니 이게easy라니 이게easy라니 죽자) You are given the heads of two sorted linked lists list1 and list2.Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists.Return the head of the merged linked listInput: list1 = [1,2,4], list2 = [1,3,4]Output: [1,1,2,3,4,4]Example 2:Input: list1 = [], ..
프로그래머스에서 풀었었던 괄호문제! Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brackets.Open brackets must be closed in the correct order.Every close bracket has a corresponding open bracket of the same type. Example 1:Input: s = "()"Output: trueExample 2:Inpu..
14. Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1:Input: strs = ["flower","flow","flight"]Output: "fl"Example 2:Input: strs = ["dog","racecar","car"]Output: ""Explanation: There is no common prefix among the input strings. Constraints:1 0 strs[i] consists of only lower..