DSA 마스터 참고사항:
Master DSA는 S/w Ers에게 높은 급여를 받을 수 있는 자격이 있습니다.
DSA는 소프트웨어 엔지니어링의 주요 부분입니다.
코드를 작성하기 전에 더 큰 그림을 이해하고 세부 사항을 자세히 살펴보세요.
DSA는 언어에 구애받지 않으므로 개념을 시각적으로 이해한 다음 l/g를 통해 해당 개념을 코드로 변환하는 것이 전부입니다.
앞으로 나올 모든 컨셉은 어떻게든 이전 컨셉과 연결되어 있습니다. 그러므로 연습을 통해 개념을 완전히 익히지 않은 이상 주제를 바꾸거나 앞으로 나아가지 마세요.
개념을 시각적으로 학습하면 자료에 대한 더 깊은 이해를 얻게 되어 지식을 더 오랫동안 유지하는 데 도움이 됩니다.
이 조언을 따르면 잃을 것이 없습니다.
Linear DS: Arrays LinkedList(LL) & Doubly LL (DLL) Stack Queue & Circular Queue Non-linear DS: Trees Graphs
빅오 표기법
알고 성능 비교를 위해서는 이 표기법을 이해하는 것이 필수적입니다.
알고의 효율성을 비교하는 수학적 방법입니다.
시간 복잡도
코드 실행 속도가 빠를수록 코드는 낮아집니다
V. 대부분의 인터뷰에 임팩트가 있습니다.
공간 복잡도
저장 비용이 낮아 시간 복잡도에 비해 거의 고려되지 않습니다.
면접관이 이런 질문을 할 수도 있으니 이해가 필요합니다.
세 개의 그리스 문자:
- 오메가
- 세타
- Omicron, 즉 Big-O [가장 자주 보임]
알고 사례
- 최고의 사례 [오메가를 사용하여 표현됨]
- 평균 사례 [Theta를 사용하여 표현됨]
- 최악의 경우 [Omicron으로 표현]
기술적으로 평균 Big-O의 최상의 사례는 없습니다. 각각 오메가와 세타를 사용하여 표시됩니다.
우리는 항상 최악의 경우를 측정하고 있습니다.
## O(n): Efficient Code Proportional Its simplified by dropping the constant values. An operation happens 'n' times, where n is passed as an argument as shown below. Always going to be a straight line having slope 1, as no of operations is proportional to n. X axis - value of n. Y axis - no of operations // O(n) function printItems(n){ for(let i=1; i <pre class="brush:php;toolbar:false">## O(n^2): Nested loops. No of items which are output in this case are n*n for a 'n' input. function printItems(n){ for(let i=0; i<n i console.log for j="0;" printitems> <pre class="brush:php;toolbar:false">## O(n^3): No of items which are output in this case are n*n*n for a 'n' input. // O(n*n*n) function printItems(n){ for(let i=0; i<n i console.log iteration for j="0;" mid k="0;" inner printitems comparison of time complexity: o> O(n*n) ## Drop non-dominants: function xxx(){ // O(n*n) Nested for loop // O(n) Single for loop } Complexity for the below code will O(n*n) + O(n) By dropping non-dominants, it will become O(n*n) As O(n) will be negligible as the n value grows. O(n*n) is dominant term, O(n) is non-dominnat term here. </n>
## O(1): Referred as Constant time i.e No of operations do not change as 'n' changes. Single operation irrespective of no of operands. MOST EFFICIENT. Nothing is more efficient than this. Its a flat line overlapping x-axis on graph. // O(1) function printItems(n){ return n+n+n+n; } printItems(3); ## Comparison of Time Complexity: O(1) > O(n) > O(n*n)
## O(log n) Divide and conquer technique. Partitioning into halves until goal is achieved. log(base2) of 8 = 3 i.e we are basically saying 2 to what power is 8. That power denotes the no of operations to get to the result. Also, to put it in another way we can say how many times we need to divide 8 into halves(this makes base 2 for logarithmic operation) to get to the single resulting target item which is 3. Ex. Amazing application is say for a 1,000,000,000 array size, how many times we need to cut to get to the target item. log(base 2) 1,000,000,000 = 31 times i.e 2^31 will make us reach the target item. Hence, if we do the search in linear fashion then we need to scan for billion items in the array. But if we use divide & conquer approach, we can find it in just 31 steps. This is the immense power of O(log n) ## Comparison of Time Complexity: O(1) > O(log n) > O(n) > O(n*n) Best is O(1) or O(log n) Acceptable is O(n)
O(n log n) : Used in some sorting Algos. Most efficient sorting algo we can make unless we are sorting only nums.
Tricky Interview Ques: Different Terms for Inputs. function printItems(a,b){ // O(a) for(let i=0; i<a i console.log o for j="0;" printitems we can have both variables equal to suppose a is and b then will be very different. hence it eventually what call it. similarly if these were nested loops become> <pre class="brush:php;toolbar:false">## Arrays No reindexing is required in arrays for push-pop operations. Hence both are O(1). Adding-Removing from end in array is O(1) Reindexing is required in arrays for shift-unshift operations. Hence, both are O(n) operations, where n is no of items in the array. Adding-Removing from front in array is O(n) Inserting anywhere in array except start and end positions: myArr.splice(indexForOperation, itemsToBeRemoved, ContentTobeInsterted) Remaining array after the items has to be reindexed. Hence, it will be O(n) and not O(0.5 n) as Big-O always meassures worst case, and not avg case. 0.5 is constant, hence its droppped. Same is applicable for removing an item from an array also as the items after it has to be reindexed. Finding an item in an array: if its by value: O(n) if its by index: O(1) Select a DS based on the use-case. For index based, array will be a great choice. If a lot of insertion-deletion is perform in the begin, then use some other DS as reindexing will make it slow.
n=100에 대한 시간 복잡도 비교:
O(1) = 1
O(로그 100) = 7
O(100) = 100
O(n^2) = 10,000
n=1000에 대한 시간 복잡도 비교:
O(1) = 1
O(로그 1000) = ~10
O(1000) = 1000
O(1000*1000) = 1,000,000
주로 다음 4가지에 중점을 둘 것입니다.
Big O(n*n): 중첩 루프
Big O(n): 비례
Big O(log n): 분할 및 정복
빅오(1): 상수
O(n!)은 고의로 나쁜 코드를 작성할 때 주로 발생합니다.
O(n*n)는 끔찍해요 알고
O(n log n)은 허용되며 특정 정렬 알고리즘에서 사용됩니다
O(n) : 가능
O(log n), O(1) : 최고
공간 복잡도는 모든 DS, 즉 O(n)에서 거의 동일합니다.
공간 복잡도는 정렬 알고리즘에 따라 O(n)에서 O(log n) 또는 O(1)까지 다양합니다
시간 복잡도는 알고에 따라 다릅니다
문자열과 같은 숫자 이외의 정렬에 가장 적합한 시간 복잡도는 Quick, Merge, Time, Heap 정렬에 있는 O(n log n)입니다.
학습 내용을 적용하는 가장 좋은 방법은 가능한 한 많이 코딩하는 것입니다.
각 DS의 장단점을 토대로 어떤 문제 설명에서 어떤 DS를 선택할지 선택합니다.
자세한 내용은 bigoheatsheet.com을 참조하세요
위 내용은 DSA 및 Big O 표기법 소개의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

JavaScript 코어 데이터 유형은 브라우저 및 Node.js에서 일관되지만 추가 유형과 다르게 처리됩니다. 1) 글로벌 객체는 브라우저의 창이고 node.js의 글로벌입니다. 2) 이진 데이터를 처리하는 데 사용되는 Node.js의 고유 버퍼 객체. 3) 성능 및 시간 처리에는 차이가 있으며 환경에 따라 코드를 조정해야합니다.

javaScriptUSTWOTYPESOFSOFCOMMENTS : 단일 라인 (//) 및 multi-line (//)

Python과 JavaScript의 주요 차이점은 유형 시스템 및 응용 프로그램 시나리오입니다. 1. Python은 과학 컴퓨팅 및 데이터 분석에 적합한 동적 유형을 사용합니다. 2. JavaScript는 약한 유형을 채택하며 프론트 엔드 및 풀 스택 개발에 널리 사용됩니다. 두 사람은 비동기 프로그래밍 및 성능 최적화에서 고유 한 장점을 가지고 있으며 선택할 때 프로젝트 요구 사항에 따라 결정해야합니다.

Python 또는 JavaScript를 선택할지 여부는 프로젝트 유형에 따라 다릅니다. 1) 데이터 과학 및 자동화 작업을 위해 Python을 선택하십시오. 2) 프론트 엔드 및 풀 스택 개발을 위해 JavaScript를 선택하십시오. Python은 데이터 처리 및 자동화 분야에서 강력한 라이브러리에 선호되는 반면 JavaScript는 웹 상호 작용 및 전체 스택 개발의 장점에 없어서는 안될 필수입니다.

파이썬과 자바 스크립트는 각각 고유 한 장점이 있으며 선택은 프로젝트 요구와 개인 선호도에 따라 다릅니다. 1. Python은 간결한 구문으로 데이터 과학 및 백엔드 개발에 적합하지만 실행 속도가 느립니다. 2. JavaScript는 프론트 엔드 개발의 모든 곳에 있으며 강력한 비동기 프로그래밍 기능을 가지고 있습니다. node.js는 풀 스택 개발에 적합하지만 구문은 복잡하고 오류가 발생할 수 있습니다.

javaScriptisNotBuiltoncorc; it'SangretedLanguageThatrunsonOngineStenWrittenInc .1) javaScriptWasDesignEdasAlightweight, 해석 hanguageforwebbrowsers.2) Endinesevolvedfromsimpleplemporectreterstoccilpilers, 전기적으로 개선된다.

JavaScript는 프론트 엔드 및 백엔드 개발에 사용할 수 있습니다. 프론트 엔드는 DOM 작업을 통해 사용자 경험을 향상시키고 백엔드는 Node.js를 통해 서버 작업을 처리합니다. 1. 프론트 엔드 예 : 웹 페이지 텍스트의 내용을 변경하십시오. 2. 백엔드 예제 : node.js 서버를 만듭니다.

Python 또는 JavaScript는 경력 개발, 학습 곡선 및 생태계를 기반으로해야합니다. 1) 경력 개발 : Python은 데이터 과학 및 백엔드 개발에 적합한 반면 JavaScript는 프론트 엔드 및 풀 스택 개발에 적합합니다. 2) 학습 곡선 : Python 구문은 간결하며 초보자에게 적합합니다. JavaScript Syntax는 유연합니다. 3) 생태계 : Python에는 풍부한 과학 컴퓨팅 라이브러리가 있으며 JavaScript는 강력한 프론트 엔드 프레임 워크를 가지고 있습니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

SublimeText3 영어 버전
권장 사항: Win 버전, 코드 프롬프트 지원!

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

mPDF
mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.

Dreamweaver Mac版
시각적 웹 개발 도구