{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n"},"parsed":{"kind":"list like","value":[{"code":null,"e":1138,"s":1062,"text":"Use the .align-self-end class to align flex item at the end in Bootstrap 4."},{"code":null,"e":1164,"s":1138,"text":"The following is my div −"},{"code":null,"e":1214,"s":1164,"text":"
"},{"code":null,"e":1292,"s":1214,"text":"Now you need to set the flex items, wherein I am aligning the 3rd flex item −"},{"code":null,"e":1520,"s":1292,"text":"
\n
Item 1
\n
Item 2
\n
Item 3
\n
Item 4
\n
"},{"code":null,"e":1598,"s":1520,"text":"You can try to run the following code to implement the align-self-end class −"},{"code":null,"e":1608,"s":1598,"text":"Live Demo"},{"code":null,"e":2470,"s":1608,"text":"\n\n \n Bootstrap Example\n \n \n \n \n \n \n\n
\n

Align Specific Flex Item from the end

\n
\n
Item 1
\n
Item 2
\n
Item 3
\n
Item 4
\n
\n
\n \n"}],"string":"[\n {\n \"code\": null,\n \"e\": 1138,\n \"s\": 1062,\n \"text\": \"Use the .align-self-end class to align flex item at the end in Bootstrap 4.\"\n },\n {\n \"code\": null,\n \"e\": 1164,\n \"s\": 1138,\n \"text\": \"The following is my div −\"\n },\n {\n \"code\": null,\n \"e\": 1214,\n \"s\": 1164,\n \"text\": \"
\"\n },\n {\n \"code\": null,\n \"e\": 1292,\n \"s\": 1214,\n \"text\": \"Now you need to set the flex items, wherein I am aligning the 3rd flex item −\"\n },\n {\n \"code\": null,\n \"e\": 1520,\n \"s\": 1292,\n \"text\": \"
\\n
Item 1
\\n
Item 2
\\n
Item 3
\\n
Item 4
\\n
\"\n },\n {\n \"code\": null,\n \"e\": 1598,\n \"s\": 1520,\n \"text\": \"You can try to run the following code to implement the align-self-end class −\"\n },\n {\n \"code\": null,\n \"e\": 1608,\n \"s\": 1598,\n \"text\": \"Live Demo\"\n },\n {\n \"code\": null,\n \"e\": 2470,\n \"s\": 1608,\n \"text\": \"\\n\\n \\n Bootstrap Example\\n \\n \\n \\n \\n \\n \\n\\n
\\n

Align Specific Flex Item from the end

\\n
\\n
Item 1
\\n
Item 2
\\n
Item 3
\\n
Item 4
\\n
\\n
\\n \\n\"\n }\n]"}}},{"rowIdx":76511,"cells":{"title":{"kind":"string","value":"JavaScript String - substr() Method"},"text":{"kind":"string","value":"This method returns the characters in a string beginning at the specified location through the specified number of characters.\nThe syntax to use substr() is as follows −\nstring.substr(start[, length]);\n\nstart − Location at which to start extracting characters (an integer between 0 and one less than the length of the string).\nstart − Location at which to start extracting characters (an integer between 0 and one less than the length of the string).\nlength − The number of characters to extract.\nlength − The number of characters to extract.\nNote − If start is negative, substr uses it as a character index from the end of the string.\nThe substr() method returns the new sub-string based on given parameters.\nTry the following example.\n\n \n JavaScript String substr() Method\n \n \n \n \n \n\n(1,2): pp\n(-2,2): y.\n(1): pples are round, and apples are juicy.\n(-20, 2): nd\n(20, 2): d\n\n\n 25 Lectures \n 2.5 hours \n\n Anadi Sharma\n\n 74 Lectures \n 10 hours \n\n Lets Kode It\n\n 72 Lectures \n 4.5 hours \n\n Frahaan Hussain\n\n 70 Lectures \n 4.5 hours \n\n Frahaan Hussain\n\n 46 Lectures \n 6 hours \n\n Eduonix Learning Solutions\n\n 88 Lectures \n 14 hours \n\n Eduonix Learning Solutions\n Print\n Add Notes\n Bookmark this page"},"parsed":{"kind":"list like","value":[{"code":null,"e":2593,"s":2466,"text":"This method returns the characters in a string beginning at the specified location through the specified number of characters."},{"code":null,"e":2636,"s":2593,"text":"The syntax to use substr() is as follows −"},{"code":null,"e":2669,"s":2636,"text":"string.substr(start[, length]);\n"},{"code":null,"e":2793,"s":2669,"text":"start − Location at which to start extracting characters (an integer between 0 and one less than the length of the string)."},{"code":null,"e":2917,"s":2793,"text":"start − Location at which to start extracting characters (an integer between 0 and one less than the length of the string)."},{"code":null,"e":2963,"s":2917,"text":"length − The number of characters to extract."},{"code":null,"e":3009,"s":2963,"text":"length − The number of characters to extract."},{"code":null,"e":3102,"s":3009,"text":"Note − If start is negative, substr uses it as a character index from the end of the string."},{"code":null,"e":3176,"s":3102,"text":"The substr() method returns the new sub-string based on given parameters."},{"code":null,"e":3203,"s":3176,"text":"Try the following example."},{"code":null,"e":3766,"s":3203,"text":"\n \n JavaScript String substr() Method\n \n \n \n \n \n"},{"code":null,"e":3856,"s":3766,"text":"(1,2): pp\n(-2,2): y.\n(1): pples are round, and apples are juicy.\n(-20, 2): nd\n(20, 2): d\n"},{"code":null,"e":3891,"s":3856,"text":"\n 25 Lectures \n 2.5 hours \n"},{"code":null,"e":3905,"s":3891,"text":" Anadi Sharma"},{"code":null,"e":3939,"s":3905,"text":"\n 74 Lectures \n 10 hours \n"},{"code":null,"e":3953,"s":3939,"text":" Lets Kode It"},{"code":null,"e":3988,"s":3953,"text":"\n 72 Lectures \n 4.5 hours \n"},{"code":null,"e":4005,"s":3988,"text":" Frahaan Hussain"},{"code":null,"e":4040,"s":4005,"text":"\n 70 Lectures \n 4.5 hours \n"},{"code":null,"e":4057,"s":4040,"text":" Frahaan Hussain"},{"code":null,"e":4090,"s":4057,"text":"\n 46 Lectures \n 6 hours \n"},{"code":null,"e":4118,"s":4090,"text":" Eduonix Learning Solutions"},{"code":null,"e":4152,"s":4118,"text":"\n 88 Lectures \n 14 hours \n"},{"code":null,"e":4180,"s":4152,"text":" Eduonix Learning Solutions"},{"code":null,"e":4187,"s":4180,"text":" Print"},{"code":null,"e":4198,"s":4187,"text":" Add Notes"}],"string":"[\n {\n \"code\": null,\n \"e\": 2593,\n \"s\": 2466,\n \"text\": \"This method returns the characters in a string beginning at the specified location through the specified number of characters.\"\n },\n {\n \"code\": null,\n \"e\": 2636,\n \"s\": 2593,\n \"text\": \"The syntax to use substr() is as follows −\"\n },\n {\n \"code\": null,\n \"e\": 2669,\n \"s\": 2636,\n \"text\": \"string.substr(start[, length]);\\n\"\n },\n {\n \"code\": null,\n \"e\": 2793,\n \"s\": 2669,\n \"text\": \"start − Location at which to start extracting characters (an integer between 0 and one less than the length of the string).\"\n },\n {\n \"code\": null,\n \"e\": 2917,\n \"s\": 2793,\n \"text\": \"start − Location at which to start extracting characters (an integer between 0 and one less than the length of the string).\"\n },\n {\n \"code\": null,\n \"e\": 2963,\n \"s\": 2917,\n \"text\": \"length − The number of characters to extract.\"\n },\n {\n \"code\": null,\n \"e\": 3009,\n \"s\": 2963,\n \"text\": \"length − The number of characters to extract.\"\n },\n {\n \"code\": null,\n \"e\": 3102,\n \"s\": 3009,\n \"text\": \"Note − If start is negative, substr uses it as a character index from the end of the string.\"\n },\n {\n \"code\": null,\n \"e\": 3176,\n \"s\": 3102,\n \"text\": \"The substr() method returns the new sub-string based on given parameters.\"\n },\n {\n \"code\": null,\n \"e\": 3203,\n \"s\": 3176,\n \"text\": \"Try the following example.\"\n },\n {\n \"code\": null,\n \"e\": 3766,\n \"s\": 3203,\n \"text\": \"\\n \\n JavaScript String substr() Method\\n \\n \\n \\n \\n \\n\"\n },\n {\n \"code\": null,\n \"e\": 3856,\n \"s\": 3766,\n \"text\": \"(1,2): pp\\n(-2,2): y.\\n(1): pples are round, and apples are juicy.\\n(-20, 2): nd\\n(20, 2): d\\n\"\n },\n {\n \"code\": null,\n \"e\": 3891,\n \"s\": 3856,\n \"text\": \"\\n 25 Lectures \\n 2.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3905,\n \"s\": 3891,\n \"text\": \" Anadi Sharma\"\n },\n {\n \"code\": null,\n \"e\": 3939,\n \"s\": 3905,\n \"text\": \"\\n 74 Lectures \\n 10 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3953,\n \"s\": 3939,\n \"text\": \" Lets Kode It\"\n },\n {\n \"code\": null,\n \"e\": 3988,\n \"s\": 3953,\n \"text\": \"\\n 72 Lectures \\n 4.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 4005,\n \"s\": 3988,\n \"text\": \" Frahaan Hussain\"\n },\n {\n \"code\": null,\n \"e\": 4040,\n \"s\": 4005,\n \"text\": \"\\n 70 Lectures \\n 4.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 4057,\n \"s\": 4040,\n \"text\": \" Frahaan Hussain\"\n },\n {\n \"code\": null,\n \"e\": 4090,\n \"s\": 4057,\n \"text\": \"\\n 46 Lectures \\n 6 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 4118,\n \"s\": 4090,\n \"text\": \" Eduonix Learning Solutions\"\n },\n {\n \"code\": null,\n \"e\": 4152,\n \"s\": 4118,\n \"text\": \"\\n 88 Lectures \\n 14 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 4180,\n \"s\": 4152,\n \"text\": \" Eduonix Learning Solutions\"\n },\n {\n \"code\": null,\n \"e\": 4187,\n \"s\": 4180,\n \"text\": \" Print\"\n },\n {\n \"code\": null,\n \"e\": 4198,\n \"s\": 4187,\n \"text\": \" Add Notes\"\n }\n]"}}},{"rowIdx":76512,"cells":{"title":{"kind":"string","value":"Sort an array which contain 1 to n values - GeeksforGeeks"},"text":{"kind":"string","value":"CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore MoreSchool CoursesSchool GuidePython ProgrammingLearn To Make AppsAll Courses\nFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore More\nLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore More\nDSA Live Classes\nSystem Design\nJava Backend Development\nFull Stack LIVE\nExplore More\nSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore More\nDSA- Self Paced\nSDE Theory\nMust-Do Coding Questions\nExplore More\nFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore More\nLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore More\nCompetitive Programming\nData Structures with C++\nData Science\nExplore More\nSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore More\nDSA- Self Paced\nCIP\nJAVA / Python / C++\nExplore More\nSchool CoursesSchool GuidePython ProgrammingLearn To Make Apps\nSchool Guide\nPython Programming\nLearn To Make Apps\nAll Courses\nTutorialsPractice DS & Algo.Must Do QuestionsDSA Topic-wiseDSA Company-wiseAlgorithmsAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity QuestionSearching AlgorithmsSorting AlgorithmsGraph AlgorithmsPattern SearchingGeometric AlgorithmsMathematicalBitwise AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide and ConquerBacktrackingBranch and BoundAll AlgorithmsData StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvanced Data StructureMatrixStringsAll Data StructuresInterview CornerCompany PreparationTop TopicsPractice Company QuestionsInterview ExperiencesExperienced InterviewsInternship InterviewsCompetititve ProgrammingDesign PatternsSystem Design TutorialMultiple Choice QuizzesLanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGo LanguageHTMLCSSKotlinML & Data ScienceMachine LearningData ScienceCS SubjectsMathematicsOperating SystemDBMSComputer NetworksComputer Organization and ArchitectureTheory of ComputationCompiler DesignDigital LogicSoftware EngineeringGATEGATE Computer Science NotesLast Minute NotesGATE CS Solved PapersGATE CS Original Papers and Official KeysGATE 2021 DatesGATE CS 2021 SyllabusImportant Topics for GATE CSWeb TechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHPSoftware DesignsSoftware Design PatternsSystem Design TutorialSchool LearningSchool ProgrammingMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 NotesNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesCS Exams/PSUsISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer ExamUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved PapersStudentCampus Ambassador ProgramSchool Ambassador ProgramProjectGeek of the MonthCampus Geek of the MonthPlacement CourseCompetititve ProgrammingTestimonialsGeek on the TopCareersInternship\nPractice DS & Algo.Must Do QuestionsDSA Topic-wiseDSA Company-wise\nMust Do Questions\nDSA Topic-wise\nDSA Company-wise\nAlgorithmsAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity QuestionSearching AlgorithmsSorting AlgorithmsGraph AlgorithmsPattern SearchingGeometric AlgorithmsMathematicalBitwise AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide and ConquerBacktrackingBranch and BoundAll Algorithms\nAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity Question\nAsymptotic Analysis\nWorst, Average and Best Cases\nAsymptotic Notations\nLittle o and little omega notations\nLower and Upper Bound Theory\nAnalysis of Loops\nSolving Recurrences\nAmortized Analysis\nWhat does 'Space Complexity' mean ?\nPseudo-polynomial Algorithms\nPolynomial Time Approximation Scheme\nA Time Complexity Question\nSearching Algorithms\nSorting Algorithms\nGraph Algorithms\nPattern Searching\nGeometric Algorithms\nMathematical\nBitwise Algorithms\nRandomized Algorithms\nGreedy Algorithms\nDynamic Programming\nDivide and Conquer\nBacktracking\nBranch and Bound\nAll Algorithms\nData StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvanced Data StructureMatrixStringsAll Data Structures\nArrays\nLinked List\nStack\nQueue\nBinary Tree\nBinary Search Tree\nHeap\nHashing\nGraph\nAdvanced Data Structure\nMatrix\nStrings\nAll Data Structures\nInterview CornerCompany PreparationTop TopicsPractice Company QuestionsInterview ExperiencesExperienced InterviewsInternship InterviewsCompetititve ProgrammingDesign PatternsSystem Design TutorialMultiple Choice Quizzes\nCompany Preparation\nTop Topics\nPractice Company Questions\nInterview Experiences\nExperienced Interviews\nInternship Interviews\nCompetititve Programming\nDesign Patterns\nSystem Design Tutorial\nMultiple Choice Quizzes\nLanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGo LanguageHTMLCSSKotlin\nC\nC++\nJava\nPython\nC#\nJavaScript\njQuery\nSQL\nPHP\nScala\nPerl\nGo Language\nHTML\nCSS\nKotlin\nML & Data ScienceMachine LearningData Science\nMachine Learning\nData Science\nCS SubjectsMathematicsOperating SystemDBMSComputer NetworksComputer Organization and ArchitectureTheory of ComputationCompiler DesignDigital LogicSoftware Engineering\nMathematics\nOperating System\nDBMS\nComputer Networks\nComputer Organization and Architecture\nTheory of Computation\nCompiler Design\nDigital Logic\nSoftware Engineering\nGATEGATE Computer Science NotesLast Minute NotesGATE CS Solved PapersGATE CS Original Papers and Official KeysGATE 2021 DatesGATE CS 2021 SyllabusImportant Topics for GATE CS\nGATE Computer Science Notes\nLast Minute Notes\nGATE CS Solved Papers\nGATE CS Original Papers and Official Keys\nGATE 2021 Dates\nGATE CS 2021 Syllabus\nImportant Topics for GATE CS\nWeb TechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHP\nHTML\nCSS\nJavaScript\nAngularJS\nReactJS\nNodeJS\nBootstrap\njQuery\nPHP\nSoftware DesignsSoftware Design PatternsSystem Design Tutorial\nSoftware Design Patterns\nSystem Design Tutorial\nSchool LearningSchool ProgrammingMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 NotesNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 Notes\nSchool Programming\nMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculus\nNumber System\nAlgebra\nTrigonometry\nStatistics\nProbability\nGeometry\nMensuration\nCalculus\nMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 Notes\nClass 8 Notes\nClass 9 Notes\nClass 10 Notes\nClass 11 Notes\nClass 12 Notes\nNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths Solution\nClass 8 Maths Solution\nClass 9 Maths Solution\nClass 10 Maths Solution\nClass 11 Maths Solution\nClass 12 Maths Solution\nRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths Solution\nClass 8 Maths Solution\nClass 9 Maths Solution\nClass 10 Maths Solution\nClass 11 Maths Solution\nClass 12 Maths Solution\nPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 Notes\nClass 8 Notes\nClass 9 Notes\nClass 10 Notes\nClass 11 Notes\nCS Exams/PSUsISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer ExamUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved Papers\nISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer Exam\nISRO CS Original Papers and Official Keys\nISRO CS Solved Papers\nISRO CS Syllabus for Scientist/Engineer Exam\nUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved Papers\nUGC NET CS Notes Paper II\nUGC NET CS Notes Paper III\nUGC NET CS Solved Papers\nStudentCampus Ambassador ProgramSchool Ambassador ProgramProjectGeek of the MonthCampus Geek of the MonthPlacement CourseCompetititve ProgrammingTestimonialsGeek on the TopCareersInternship\nCampus Ambassador Program\nSchool Ambassador Program\nProject\nGeek of the Month\nCampus Geek of the Month\nPlacement Course\nCompetititve Programming\nTestimonials\nGeek on the Top\nCareers\nInternship\nJobsApply for JobsPost a JobJOB-A-THON\nApply for Jobs\nPost a Job\nJOB-A-THON\nEvents\n\n\n\n\nWriteCome write articles for us and get featuredPracticeLearn and code with the best industry expertsPremiumGet access to ad-free content, doubt assistance and more!JobsCome and find your dream job with usGeeks DigestQuizzesGeeks CampusGblog ArticlesIDECampus Mantri\nGeeks Digest\nQuizzes\nGeeks Campus\nGblog Articles\nIDE\nCampus Mantri\nSign In\nSign In\nHome\nSaved Videos\nCourses\n\n\nFor Working Professionals\n \n\n\n\nLIVE\n \n\n\nDSA Live Classes\n\nSystem Design\n\nJava Backend Development\n\nFull Stack LIVE\n\nExplore More\n\n\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nSDE Theory\n\nMust-Do Coding Questions\n\nExplore More\n\n\nFor Students\n \n\n\n\nLIVE\n \n\n\nCompetitive Programming\n\nData Structures with C++\n\nData Science\n\nExplore More\n\n\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nCIP\n\nJAVA / Python / C++\n\nExplore More\n\n\nSchool Courses\n \n\n\nSchool Guide\n\nPython Programming\n\nLearn To Make Apps\n\n\nPractice DS & Algo.\n \n\n\nMust Do Questions\n\nDSA Topic-wise\n\nDSA Company-wise\n\n\nAlgorithms\n \n\n\nSearching Algorithms\n\nSorting Algorithms\n\nGraph Algorithms\n\nPattern Searching\n\nGeometric Algorithms\n\nMathematical\n\nBitwise Algorithms\n\nRandomized Algorithms\n\nGreedy Algorithms\n\nDynamic Programming\n\nDivide and Conquer\n\nBacktracking\n\nBranch and Bound\n\nAll Algorithms\n\n\nAnalysis of Algorithms\n \n\n\nAsymptotic Analysis\n\nWorst, Average and Best Cases\n\nAsymptotic Notations\n\nLittle o and little omega notations\n\nLower and Upper Bound Theory\n\nAnalysis of Loops\n\nSolving Recurrences\n\nAmortized Analysis\n\nWhat does 'Space Complexity' mean ?\n\nPseudo-polynomial Algorithms\n\nPolynomial Time Approximation Scheme\n\nA Time Complexity Question\n\n\nData Structures\n \n\n\nArrays\n\nLinked List\n\nStack\n\nQueue\n\nBinary Tree\n\nBinary Search Tree\n\nHeap\n\nHashing\n\nGraph\n\nAdvanced Data Structure\n\nMatrix\n\nStrings\n\nAll Data Structures\n\n\nInterview Corner\n \n\n\nCompany Preparation\n\nTop Topics\n\nPractice Company Questions\n\nInterview Experiences\n\nExperienced Interviews\n\nInternship Interviews\n\nCompetititve Programming\n\nDesign Patterns\n\nSystem Design Tutorial\n\nMultiple Choice Quizzes\n\n\nLanguages\n \n\n\nC\n\nC++\n\nJava\n\nPython\n\nC#\n\nJavaScript\n\njQuery\n\nSQL\n\nPHP\n\nScala\n\nPerl\n\nGo Language\n\nHTML\n\nCSS\n\nKotlin\n\n\nML & Data Science\n \n\n\nMachine Learning\n\nData Science\n\n\nCS Subjects\n \n\n\nMathematics\n\nOperating System\n\nDBMS\n\nComputer Networks\n\nComputer Organization and Architecture\n\nTheory of Computation\n\nCompiler Design\n\nDigital Logic\n\nSoftware Engineering\n\n\nGATE\n \n\n\nGATE Computer Science Notes\n\nLast Minute Notes\n\nGATE CS Solved Papers\n\nGATE CS Original Papers and Official Keys\n\nGATE 2021 Dates\n\nGATE CS 2021 Syllabus\n\nImportant Topics for GATE CS\n\n\nWeb Technologies\n \n\n\nHTML\n\nCSS\n\nJavaScript\n\nAngularJS\n\nReactJS\n\nNodeJS\n\nBootstrap\n\njQuery\n\nPHP\n\n\nSoftware Designs\n \n\n\nSoftware Design Patterns\n\nSystem Design Tutorial\n\n\nSchool Learning\n \n\n\nSchool Programming\n\n\nMathematics\n \n\n\nNumber System\n\nAlgebra\n\nTrigonometry\n\nStatistics\n\nProbability\n\nGeometry\n\nMensuration\n\nCalculus\n\n\nMaths Notes (Class 8-12)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\nClass 12 Notes\n\n\nNCERT Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n\n\nRD Sharma Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n\n\nPhysics Notes (Class 8-11)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\n\nCS Exams/PSUs\n \n\n\n\nISRO\n \n\n\nISRO CS Original Papers and Official Keys\n\nISRO CS Solved Papers\n\nISRO CS Syllabus for Scientist/Engineer Exam\n\n\nUGC NET\n \n\n\nUGC NET CS Notes Paper II\n\nUGC NET CS Notes Paper III\n\nUGC NET CS Solved Papers\n\n\nStudent\n \n\n\nCampus Ambassador Program\n\nSchool Ambassador Program\n\nProject\n\nGeek of the Month\n\nCampus Geek of the Month\n\nPlacement Course\n\nCompetititve Programming\n\nTestimonials\n\nGeek on the Top\n\nCareers\n\nInternship\n\n\nTutorials\n \n\n\n\nJobs\n \n\n\nApply for Jobs\n\nPost a Job\n\nJOB-A-THON\n\n\nFor Working Professionals\n \n\n\n\nLIVE\n \n\n\nDSA Live Classes\n\nSystem Design\n\nJava Backend Development\n\nFull Stack LIVE\n\nExplore More\n\n\nDSA Live Classes\n\n\nSystem Design\n\n\nJava Backend Development\n\n\nFull Stack LIVE\n\n\nExplore More\n\n\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nSDE Theory\n\nMust-Do Coding Questions\n\nExplore More\n\n\nDSA- Self Paced\n\n\nSDE Theory\n\n\nMust-Do Coding Questions\n\n\nExplore More\n\n\nFor Students\n \n\n\n\nLIVE\n \n\n\nCompetitive Programming\n\nData Structures with C++\n\nData Science\n\nExplore More\n\n\nCompetitive Programming\n\n\nData Structures with C++\n\n\nData Science\n\n\nExplore More\n\n\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nCIP\n\nJAVA / Python / C++\n\nExplore More\n\n\nDSA- Self Paced\n\n\nCIP\n\n\nJAVA / Python / C++\n\n\nExplore More\n\n\nSchool Courses\n \n\n\nSchool Guide\n\nPython Programming\n\nLearn To Make Apps\n\n\nSchool Guide\n\n\nPython Programming\n\n\nLearn To Make Apps\n\n\nPractice DS & Algo.\n \n\n\nMust Do Questions\n\nDSA Topic-wise\n\nDSA Company-wise\n\n\nMust Do Questions\n\n\nDSA Topic-wise\n\n\nDSA Company-wise\n\n\nAlgorithms\n \n\n\nSearching Algorithms\n\nSorting Algorithms\n\nGraph Algorithms\n\nPattern Searching\n\nGeometric Algorithms\n\nMathematical\n\nBitwise Algorithms\n\nRandomized Algorithms\n\nGreedy Algorithms\n\nDynamic Programming\n\nDivide and Conquer\n\nBacktracking\n\nBranch and Bound\n\nAll Algorithms\n\n\nSearching Algorithms\n\n\nSorting Algorithms\n\n\nGraph Algorithms\n\n\nPattern Searching\n\n\nGeometric Algorithms\n\n\nMathematical\n\n\nBitwise Algorithms\n\n\nRandomized Algorithms\n\n\nGreedy Algorithms\n\n\nDynamic Programming\n\n\nDivide and Conquer\n\n\nBacktracking\n\n\nBranch and Bound\n\n\nAll Algorithms\n\n\nAnalysis of Algorithms\n \n\n\nAsymptotic Analysis\n\nWorst, Average and Best Cases\n\nAsymptotic Notations\n\nLittle o and little omega notations\n\nLower and Upper Bound Theory\n\nAnalysis of Loops\n\nSolving Recurrences\n\nAmortized Analysis\n\nWhat does 'Space Complexity' mean ?\n\nPseudo-polynomial Algorithms\n\nPolynomial Time Approximation Scheme\n\nA Time Complexity Question\n\n\nAsymptotic Analysis\n\n\nWorst, Average and Best Cases\n\n\nAsymptotic Notations\n\n\nLittle o and little omega notations\n\n\nLower and Upper Bound Theory\n\n\nAnalysis of Loops\n\n\nSolving Recurrences\n\n\nAmortized Analysis\n\n\nWhat does 'Space Complexity' mean ?\n\n\nPseudo-polynomial Algorithms\n\n\nPolynomial Time Approximation Scheme\n\n\nA Time Complexity Question\n\n\nData Structures\n \n\n\nArrays\n\nLinked List\n\nStack\n\nQueue\n\nBinary Tree\n\nBinary Search Tree\n\nHeap\n\nHashing\n\nGraph\n\nAdvanced Data Structure\n\nMatrix\n\nStrings\n\nAll Data Structures\n\n\nArrays\n\n\nLinked List\n\n\nStack\n\n\nQueue\n\n\nBinary Tree\n\n\nBinary Search Tree\n\n\nHeap\n\n\nHashing\n\n\nGraph\n\n\nAdvanced Data Structure\n\n\nMatrix\n\n\nStrings\n\n\nAll Data Structures\n\n\nInterview Corner\n \n\n\nCompany Preparation\n\nTop Topics\n\nPractice Company Questions\n\nInterview Experiences\n\nExperienced Interviews\n\nInternship Interviews\n\nCompetititve Programming\n\nDesign Patterns\n\nSystem Design Tutorial\n\nMultiple Choice Quizzes\n\n\nCompany Preparation\n\n\nTop Topics\n\n\nPractice Company Questions\n\n\nInterview Experiences\n\n\nExperienced Interviews\n\n\nInternship Interviews\n\n\nCompetititve Programming\n\n\nDesign Patterns\n\n\nSystem Design Tutorial\n\n\nMultiple Choice Quizzes\n\n\nLanguages\n \n\n\nC\n\nC++\n\nJava\n\nPython\n\nC#\n\nJavaScript\n\njQuery\n\nSQL\n\nPHP\n\nScala\n\nPerl\n\nGo Language\n\nHTML\n\nCSS\n\nKotlin\n\n\nC\n\n\nC++\n\n\nJava\n\n\nPython\n\n\nC#\n\n\nJavaScript\n\n\njQuery\n\n\nSQL\n\n\nPHP\n\n\nScala\n\n\nPerl\n\n\nGo Language\n\n\nHTML\n\n\nCSS\n\n\nKotlin\n\n\nML & Data Science\n \n\n\nMachine Learning\n\nData Science\n\n\nMachine Learning\n\n\nData Science\n\n\nCS Subjects\n \n\n\nMathematics\n\nOperating System\n\nDBMS\n\nComputer Networks\n\nComputer Organization and Architecture\n\nTheory of Computation\n\nCompiler Design\n\nDigital Logic\n\nSoftware Engineering\n\n\nMathematics\n\n\nOperating System\n\n\nDBMS\n\n\nComputer Networks\n\n\nComputer Organization and Architecture\n\n\nTheory of Computation\n\n\nCompiler Design\n\n\nDigital Logic\n\n\nSoftware Engineering\n\n\nGATE\n \n\n\nGATE Computer Science Notes\n\nLast Minute Notes\n\nGATE CS Solved Papers\n\nGATE CS Original Papers and Official Keys\n\nGATE 2021 Dates\n\nGATE CS 2021 Syllabus\n\nImportant Topics for GATE CS\n\n\nGATE Computer Science Notes\n\n\nLast Minute Notes\n\n\nGATE CS Solved Papers\n\n\nGATE CS Original Papers and Official Keys\n\n\nGATE 2021 Dates\n\n\nGATE CS 2021 Syllabus\n\n\nImportant Topics for GATE CS\n\n\nWeb Technologies\n \n\n\nHTML\n\nCSS\n\nJavaScript\n\nAngularJS\n\nReactJS\n\nNodeJS\n\nBootstrap\n\njQuery\n\nPHP\n\n\nHTML\n\n\nCSS\n\n\nJavaScript\n\n\nAngularJS\n\n\nReactJS\n\n\nNodeJS\n\n\nBootstrap\n\n\njQuery\n\n\nPHP\n\n\nSoftware Designs\n \n\n\nSoftware Design Patterns\n\nSystem Design Tutorial\n\n\nSoftware Design Patterns\n\n\nSystem Design Tutorial\n\n\nSchool Learning\n \n\n\nSchool Programming\n\n\nSchool Programming\n\n\nMathematics\n \n\n\nNumber System\n\nAlgebra\n\nTrigonometry\n\nStatistics\n\nProbability\n\nGeometry\n\nMensuration\n\nCalculus\n\n\nNumber System\n\n\nAlgebra\n\n\nTrigonometry\n\n\nStatistics\n\n\nProbability\n\n\nGeometry\n\n\nMensuration\n\n\nCalculus\n\n\nMaths Notes (Class 8-12)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\nClass 12 Notes\n\n\nClass 8 Notes\n\n\nClass 9 Notes\n\n\nClass 10 Notes\n\n\nClass 11 Notes\n\n\nClass 12 Notes\n\n\nNCERT Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n\n\nClass 8 Maths Solution\n\n\nClass 9 Maths Solution\n\n\nClass 10 Maths Solution\n\n\nClass 11 Maths Solution\n\n\nClass 12 Maths Solution\n\n\nRD Sharma Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n\n\nClass 8 Maths Solution\n\n\nClass 9 Maths Solution\n\n\nClass 10 Maths Solution\n\n\nClass 11 Maths Solution\n\n\nClass 12 Maths Solution\n\n\nPhysics Notes (Class 8-11)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\n\nClass 8 Notes\n\n\nClass 9 Notes\n\n\nClass 10 Notes\n\n\nClass 11 Notes\n\n\nCS Exams/PSUs\n \n\n\n\nISRO\n \n\n\nISRO CS Original Papers and Official Keys\n\nISRO CS Solved Papers\n\nISRO CS Syllabus for Scientist/Engineer Exam\n\n\nISRO CS Original Papers and Official Keys\n\n\nISRO CS Solved Papers\n\n\nISRO CS Syllabus for Scientist/Engineer Exam\n\n\nUGC NET\n \n\n\nUGC NET CS Notes Paper II\n\nUGC NET CS Notes Paper III\n\nUGC NET CS Solved Papers\n\n\nUGC NET CS Notes Paper II\n\n\nUGC NET CS Notes Paper III\n\n\nUGC NET CS Solved Papers\n\n\nStudent\n \n\n\nCampus Ambassador Program\n\nSchool Ambassador Program\n\nProject\n\nGeek of the Month\n\nCampus Geek of the Month\n\nPlacement Course\n\nCompetititve Programming\n\nTestimonials\n\nGeek on the Top\n\nCareers\n\nInternship\n\n\nCampus Ambassador Program\n\n\nSchool Ambassador Program\n\n\nProject\n\n\nGeek of the Month\n\n\nCampus Geek of the Month\n\n\nPlacement Course\n\n\nCompetititve Programming\n\n\nTestimonials\n\n\nGeek on the Top\n\n\nCareers\n\n\nInternship\n\n\nTutorials\n \n\n\n\nJobs\n \n\n\nApply for Jobs\n\nPost a Job\n\nJOB-A-THON\n\n\nApply for Jobs\n\n\nPost a Job\n\n\nJOB-A-THON\n\nGBlog\nPuzzles\nWhat's New ?\nArray\nMatrix\nStrings\nHashing\nLinked List\nStack\nQueue\nBinary Tree\nBinary Search Tree\nHeap\nGraph\nSearching\nSorting\nDivide & Conquer\nMathematical\nGeometric\nBitwise\nGreedy\nBacktracking\nBranch and Bound\nDynamic Programming\nPattern Searching\nRandomized\nSort an array which contain 1 to n values\nSort 1 to N by swapping adjacent elements\nSort an array containing two types of elements\nSort elements by frequency | Set 1\nSort elements by frequency | Set 2\nSort elements by frequency | Set 4 (Efficient approach using hash)\nSorting Array Elements By Frequency | Set 3 (Using STL)\nSort elements by frequency | Set 5 (using Java Map)\nSorting a Hashmap according to values\nSorting a HashMap according to keys in Java\nTreeMap in Java\nTreeSet in Java\nHashSet in Java\nHashMap in Java with Examples\nInternal Working of HashMap in Java\nInternal working of Set/HashSet in Java\nMerge Two Sets in Java\nSet in Java\nMap Interface in Java\nHow to iterate any Map in Java\nArrays in Java\nWrite a program to reverse an array or string\nLargest Sum Contiguous Subarray\nProgram for array rotation\nArrays in C/C++\nStack Data Structure (Introduction and Program)\nTop 50 Array Coding Problems for Interviews\nLinear Search\nGiven an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)\nMaximum and minimum of an array using minimum number of comparisons\nSort an array which contain 1 to n values\nSort 1 to N by swapping adjacent elements\nSort an array containing two types of elements\nSort elements by frequency | Set 1\nSort elements by frequency | Set 2\nSort elements by frequency | Set 4 (Efficient approach using hash)\nSorting Array Elements By Frequency | Set 3 (Using STL)\nSort elements by frequency | Set 5 (using Java Map)\nSorting a Hashmap according to values\nSorting a HashMap according to keys in Java\nTreeMap in Java\nTreeSet in Java\nHashSet in Java\nHashMap in Java with Examples\nInternal Working of HashMap in Java\nInternal working of Set/HashSet in Java\nMerge Two Sets in Java\nSet in Java\nMap Interface in Java\nHow to iterate any Map in Java\nArrays in Java\nWrite a program to reverse an array or string\nLargest Sum Contiguous Subarray\nProgram for array rotation\nArrays in C/C++\nStack Data Structure (Introduction and Program)\nTop 50 Array Coding Problems for Interviews\nLinear Search\nGiven an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)\nMaximum and minimum of an array using minimum number of comparisons\nDifficulty Level :\nEasy\nYou have given an array which contain 1 to n element, your task is to sort this array in an efficient way and without replace with 1 to n numbers.Examples : \nInput : arr[] = {10, 7, 9, 2, 8, \n 3, 5, 4, 6, 1};\nOutput : 1 2 3 4 5 6 7 8 9 10\n \nNative approach : Sort this array with the use of any type of sorting method. it takes O(nlogn) minimum time.Efficient approach : Replace every element with it’s position. it takes O(n) efficient time and give you the sorted array. Let’s understand this approach with the code below. \nC++\nJava\nPython3\nC#\nPHP\nJavascript\n// Efficient C++ program to sort an array of// numbers in range from 1 to n.#include using namespace std; // function for sort arrayvoid sortit(int arr[], int n){ for (int i = 0; i < n; i++) { arr[i]=i+1; }} // Driver codeint main(){ int arr[] = { 10, 7, 9, 2, 8, 3, 5, 4, 6, 1 }; int n = sizeof(arr) / sizeof(arr[0]); // for sort an array sortit(arr, n); // for print all the element in sorted way for (int i = 0; i < n; i++) cout << arr[i] << \" \"; }\n// Efficient Java program to sort an// array of numbers in range from 1// to n.import java.io.*;import java.util.*; public class GFG { // function for sort array static void sortit(int []arr, int n) { for (int i = 0; i < n; i++) { arr[i]=i+1; } } // Driver code public static void main(String args[]) { int []arr = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1}; int n = arr.length; // for sort an array sortit(arr, n); // for print all the // element in sorted way for (int i = 0; i < n; i++) System.out.print(arr[i] + \" \"); }} // This code is contributed by Manish Shaw// (manishshaw1)\n# Python3 program to sort an array of# numbers in range from 1 to n. # function for sort arraydef sortit(arr,n): for i in range(n): arr[i] = i+1 # Driver codeif __name__=='__main__': arr = [10, 7, 9, 2, 8, 3, 5, 4, 6, 1 ] n = len(arr) # for sort an array sortit(arr,n) # for print all the element # in sorted way for i in range(n): print(arr[i],end=\" \") # This code is contributed by# Shrikant13\n// Efficient C# program to sort an array of// numbers in range from 1 to n.using System;using System.Collections.Generic; class GFG { // function for sort array static void sortit(int []arr, int n) { for (int i = 0; i < n; i++) { arr[i]=i+1; } } // Driver code public static void Main() { int []arr = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1}; int n = arr.Length; // for sort an array sortit(arr, n); // for print all the // element in sorted way for (int i = 0; i < n; i++) Console.Write(arr[i] + \" \"); }} // This code is contributed by// Manish Shaw (manishshaw1)\n\n\n1 2 3 4 5 6 7 8 9 10\n \nTime Complexity: O(n)\nSpace Complexity: O(1)\nmanishshaw1\n_Keep_Silence_\nshrikanth13\nsurbhityagi15\nprasanna1995\nlimited-range-elements\nArrays\nSorting\nArrays\nSorting\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nComments\nOld Comments\nIntroduction to Arrays\nMultidimensional Arrays in Java\nLinked List vs Array\nQueue | Set 1 (Introduction and Array Implementation)\nSubset Sum Problem | DP-25"},"parsed":{"kind":"list like","value":[{"code":null,"e":407,"s":0,"text":"CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore MoreSchool CoursesSchool GuidePython ProgrammingLearn To Make AppsAll Courses"},{"code":null,"e":588,"s":407,"text":"For Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore More"},{"code":null,"e":673,"s":588,"text":"LIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore More"},{"code":null,"e":690,"s":673,"text":"DSA Live Classes"},{"code":null,"e":704,"s":690,"text":"System Design"},{"code":null,"e":729,"s":704,"text":"Java Backend Development"},{"code":null,"e":745,"s":729,"text":"Full Stack LIVE"},{"code":null,"e":758,"s":745,"text":"Explore More"},{"code":null,"e":830,"s":758,"text":"Self-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore More"},{"code":null,"e":846,"s":830,"text":"DSA- Self Paced"},{"code":null,"e":857,"s":846,"text":"SDE Theory"},{"code":null,"e":882,"s":857,"text":"Must-Do Coding Questions"},{"code":null,"e":895,"s":882,"text":"Explore More"},{"code":null,"e":1042,"s":895,"text":"For StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore More"},{"code":null,"e":1118,"s":1042,"text":"LIVECompetitive ProgrammingData Structures with C++Data ScienceExplore More"},{"code":null,"e":1142,"s":1118,"text":"Competitive Programming"},{"code":null,"e":1167,"s":1142,"text":"Data Structures with C++"},{"code":null,"e":1180,"s":1167,"text":"Data Science"},{"code":null,"e":1193,"s":1180,"text":"Explore More"},{"code":null,"e":1253,"s":1193,"text":"Self-PacedDSA- Self PacedCIPJAVA / Python / C++Explore More"},{"code":null,"e":1269,"s":1253,"text":"DSA- Self Paced"},{"code":null,"e":1273,"s":1269,"text":"CIP"},{"code":null,"e":1293,"s":1273,"text":"JAVA / Python / C++"},{"code":null,"e":1306,"s":1293,"text":"Explore More"},{"code":null,"e":1369,"s":1306,"text":"School CoursesSchool GuidePython ProgrammingLearn To Make Apps"},{"code":null,"e":1382,"s":1369,"text":"School Guide"},{"code":null,"e":1401,"s":1382,"text":"Python Programming"},{"code":null,"e":1420,"s":1401,"text":"Learn To Make Apps"},{"code":null,"e":1432,"s":1420,"text":"All Courses"},{"code":null,"e":3999,"s":1432,"text":"TutorialsPractice DS & Algo.Must Do QuestionsDSA Topic-wiseDSA Company-wiseAlgorithmsAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity QuestionSearching AlgorithmsSorting AlgorithmsGraph AlgorithmsPattern SearchingGeometric AlgorithmsMathematicalBitwise AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide and ConquerBacktrackingBranch and BoundAll AlgorithmsData StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvanced Data StructureMatrixStringsAll Data StructuresInterview CornerCompany PreparationTop TopicsPractice Company QuestionsInterview ExperiencesExperienced InterviewsInternship InterviewsCompetititve ProgrammingDesign PatternsSystem Design TutorialMultiple Choice QuizzesLanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGo LanguageHTMLCSSKotlinML & Data ScienceMachine LearningData ScienceCS SubjectsMathematicsOperating SystemDBMSComputer NetworksComputer Organization and ArchitectureTheory of ComputationCompiler DesignDigital LogicSoftware EngineeringGATEGATE Computer Science NotesLast Minute NotesGATE CS Solved PapersGATE CS Original Papers and Official KeysGATE 2021 DatesGATE CS 2021 SyllabusImportant Topics for GATE CSWeb TechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHPSoftware DesignsSoftware Design PatternsSystem Design TutorialSchool LearningSchool ProgrammingMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 NotesNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesCS Exams/PSUsISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer ExamUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved PapersStudentCampus Ambassador ProgramSchool Ambassador ProgramProjectGeek of the MonthCampus Geek of the MonthPlacement CourseCompetititve ProgrammingTestimonialsGeek on the TopCareersInternship"},{"code":null,"e":4066,"s":3999,"text":"Practice DS & Algo.Must Do QuestionsDSA Topic-wiseDSA Company-wise"},{"code":null,"e":4084,"s":4066,"text":"Must Do Questions"},{"code":null,"e":4099,"s":4084,"text":"DSA Topic-wise"},{"code":null,"e":4116,"s":4099,"text":"DSA Company-wise"},{"code":null,"e":4697,"s":4116,"text":"AlgorithmsAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity QuestionSearching AlgorithmsSorting AlgorithmsGraph AlgorithmsPattern SearchingGeometric AlgorithmsMathematicalBitwise AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide and ConquerBacktrackingBranch and BoundAll Algorithms"},{"code":null,"e":5030,"s":4697,"text":"Analysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity Question"},{"code":null,"e":5050,"s":5030,"text":"Asymptotic Analysis"},{"code":null,"e":5080,"s":5050,"text":"Worst, Average and Best Cases"},{"code":null,"e":5101,"s":5080,"text":"Asymptotic Notations"},{"code":null,"e":5137,"s":5101,"text":"Little o and little omega notations"},{"code":null,"e":5166,"s":5137,"text":"Lower and Upper Bound Theory"},{"code":null,"e":5184,"s":5166,"text":"Analysis of Loops"},{"code":null,"e":5204,"s":5184,"text":"Solving Recurrences"},{"code":null,"e":5223,"s":5204,"text":"Amortized Analysis"},{"code":null,"e":5259,"s":5223,"text":"What does 'Space Complexity' mean ?"},{"code":null,"e":5288,"s":5259,"text":"Pseudo-polynomial Algorithms"},{"code":null,"e":5325,"s":5288,"text":"Polynomial Time Approximation Scheme"},{"code":null,"e":5352,"s":5325,"text":"A Time Complexity Question"},{"code":null,"e":5373,"s":5352,"text":"Searching Algorithms"},{"code":null,"e":5392,"s":5373,"text":"Sorting Algorithms"},{"code":null,"e":5409,"s":5392,"text":"Graph Algorithms"},{"code":null,"e":5427,"s":5409,"text":"Pattern Searching"},{"code":null,"e":5448,"s":5427,"text":"Geometric Algorithms"},{"code":null,"e":5461,"s":5448,"text":"Mathematical"},{"code":null,"e":5480,"s":5461,"text":"Bitwise Algorithms"},{"code":null,"e":5502,"s":5480,"text":"Randomized Algorithms"},{"code":null,"e":5520,"s":5502,"text":"Greedy Algorithms"},{"code":null,"e":5540,"s":5520,"text":"Dynamic Programming"},{"code":null,"e":5559,"s":5540,"text":"Divide and Conquer"},{"code":null,"e":5572,"s":5559,"text":"Backtracking"},{"code":null,"e":5589,"s":5572,"text":"Branch and Bound"},{"code":null,"e":5604,"s":5589,"text":"All Algorithms"},{"code":null,"e":5747,"s":5604,"text":"Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvanced Data StructureMatrixStringsAll Data Structures"},{"code":null,"e":5754,"s":5747,"text":"Arrays"},{"code":null,"e":5766,"s":5754,"text":"Linked List"},{"code":null,"e":5772,"s":5766,"text":"Stack"},{"code":null,"e":5778,"s":5772,"text":"Queue"},{"code":null,"e":5790,"s":5778,"text":"Binary Tree"},{"code":null,"e":5809,"s":5790,"text":"Binary Search Tree"},{"code":null,"e":5814,"s":5809,"text":"Heap"},{"code":null,"e":5822,"s":5814,"text":"Hashing"},{"code":null,"e":5828,"s":5822,"text":"Graph"},{"code":null,"e":5852,"s":5828,"text":"Advanced Data Structure"},{"code":null,"e":5859,"s":5852,"text":"Matrix"},{"code":null,"e":5867,"s":5859,"text":"Strings"},{"code":null,"e":5887,"s":5867,"text":"All Data Structures"},{"code":null,"e":6107,"s":5887,"text":"Interview CornerCompany PreparationTop TopicsPractice Company QuestionsInterview ExperiencesExperienced InterviewsInternship InterviewsCompetititve ProgrammingDesign PatternsSystem Design TutorialMultiple Choice Quizzes"},{"code":null,"e":6127,"s":6107,"text":"Company Preparation"},{"code":null,"e":6138,"s":6127,"text":"Top Topics"},{"code":null,"e":6165,"s":6138,"text":"Practice Company Questions"},{"code":null,"e":6187,"s":6165,"text":"Interview Experiences"},{"code":null,"e":6210,"s":6187,"text":"Experienced Interviews"},{"code":null,"e":6232,"s":6210,"text":"Internship Interviews"},{"code":null,"e":6257,"s":6232,"text":"Competititve Programming"},{"code":null,"e":6273,"s":6257,"text":"Design Patterns"},{"code":null,"e":6296,"s":6273,"text":"System Design Tutorial"},{"code":null,"e":6320,"s":6296,"text":"Multiple Choice Quizzes"},{"code":null,"e":6401,"s":6320,"text":"LanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGo LanguageHTMLCSSKotlin"},{"code":null,"e":6403,"s":6401,"text":"C"},{"code":null,"e":6407,"s":6403,"text":"C++"},{"code":null,"e":6412,"s":6407,"text":"Java"},{"code":null,"e":6419,"s":6412,"text":"Python"},{"code":null,"e":6422,"s":6419,"text":"C#"},{"code":null,"e":6433,"s":6422,"text":"JavaScript"},{"code":null,"e":6440,"s":6433,"text":"jQuery"},{"code":null,"e":6444,"s":6440,"text":"SQL"},{"code":null,"e":6448,"s":6444,"text":"PHP"},{"code":null,"e":6454,"s":6448,"text":"Scala"},{"code":null,"e":6459,"s":6454,"text":"Perl"},{"code":null,"e":6471,"s":6459,"text":"Go Language"},{"code":null,"e":6476,"s":6471,"text":"HTML"},{"code":null,"e":6480,"s":6476,"text":"CSS"},{"code":null,"e":6487,"s":6480,"text":"Kotlin"},{"code":null,"e":6533,"s":6487,"text":"ML & Data ScienceMachine LearningData Science"},{"code":null,"e":6550,"s":6533,"text":"Machine Learning"},{"code":null,"e":6563,"s":6550,"text":"Data Science"},{"code":null,"e":6730,"s":6563,"text":"CS SubjectsMathematicsOperating SystemDBMSComputer NetworksComputer Organization and ArchitectureTheory of ComputationCompiler DesignDigital LogicSoftware Engineering"},{"code":null,"e":6742,"s":6730,"text":"Mathematics"},{"code":null,"e":6759,"s":6742,"text":"Operating System"},{"code":null,"e":6764,"s":6759,"text":"DBMS"},{"code":null,"e":6782,"s":6764,"text":"Computer Networks"},{"code":null,"e":6821,"s":6782,"text":"Computer Organization and Architecture"},{"code":null,"e":6843,"s":6821,"text":"Theory of Computation"},{"code":null,"e":6859,"s":6843,"text":"Compiler Design"},{"code":null,"e":6873,"s":6859,"text":"Digital Logic"},{"code":null,"e":6894,"s":6873,"text":"Software Engineering"},{"code":null,"e":7069,"s":6894,"text":"GATEGATE Computer Science NotesLast Minute NotesGATE CS Solved PapersGATE CS Original Papers and Official KeysGATE 2021 DatesGATE CS 2021 SyllabusImportant Topics for GATE CS"},{"code":null,"e":7097,"s":7069,"text":"GATE Computer Science Notes"},{"code":null,"e":7115,"s":7097,"text":"Last Minute Notes"},{"code":null,"e":7137,"s":7115,"text":"GATE CS Solved Papers"},{"code":null,"e":7179,"s":7137,"text":"GATE CS Original Papers and Official Keys"},{"code":null,"e":7195,"s":7179,"text":"GATE 2021 Dates"},{"code":null,"e":7217,"s":7195,"text":"GATE CS 2021 Syllabus"},{"code":null,"e":7246,"s":7217,"text":"Important Topics for GATE CS"},{"code":null,"e":7320,"s":7246,"text":"Web TechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHP"},{"code":null,"e":7325,"s":7320,"text":"HTML"},{"code":null,"e":7329,"s":7325,"text":"CSS"},{"code":null,"e":7340,"s":7329,"text":"JavaScript"},{"code":null,"e":7350,"s":7340,"text":"AngularJS"},{"code":null,"e":7358,"s":7350,"text":"ReactJS"},{"code":null,"e":7365,"s":7358,"text":"NodeJS"},{"code":null,"e":7375,"s":7365,"text":"Bootstrap"},{"code":null,"e":7382,"s":7375,"text":"jQuery"},{"code":null,"e":7386,"s":7382,"text":"PHP"},{"code":null,"e":7449,"s":7386,"text":"Software DesignsSoftware Design PatternsSystem Design Tutorial"},{"code":null,"e":7474,"s":7449,"text":"Software Design Patterns"},{"code":null,"e":7497,"s":7474,"text":"System Design Tutorial"},{"code":null,"e":8054,"s":7497,"text":"School LearningSchool ProgrammingMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 NotesNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 Notes"},{"code":null,"e":8073,"s":8054,"text":"School Programming"},{"code":null,"e":8165,"s":8073,"text":"MathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculus"},{"code":null,"e":8179,"s":8165,"text":"Number System"},{"code":null,"e":8187,"s":8179,"text":"Algebra"},{"code":null,"e":8200,"s":8187,"text":"Trigonometry"},{"code":null,"e":8211,"s":8200,"text":"Statistics"},{"code":null,"e":8223,"s":8211,"text":"Probability"},{"code":null,"e":8232,"s":8223,"text":"Geometry"},{"code":null,"e":8244,"s":8232,"text":"Mensuration"},{"code":null,"e":8253,"s":8244,"text":"Calculus"},{"code":null,"e":8346,"s":8253,"text":"Maths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 Notes"},{"code":null,"e":8360,"s":8346,"text":"Class 8 Notes"},{"code":null,"e":8374,"s":8360,"text":"Class 9 Notes"},{"code":null,"e":8389,"s":8374,"text":"Class 10 Notes"},{"code":null,"e":8404,"s":8389,"text":"Class 11 Notes"},{"code":null,"e":8419,"s":8404,"text":"Class 12 Notes"},{"code":null,"e":8548,"s":8419,"text":"NCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths Solution"},{"code":null,"e":8571,"s":8548,"text":"Class 8 Maths Solution"},{"code":null,"e":8594,"s":8571,"text":"Class 9 Maths Solution"},{"code":null,"e":8618,"s":8594,"text":"Class 10 Maths Solution"},{"code":null,"e":8642,"s":8618,"text":"Class 11 Maths Solution"},{"code":null,"e":8666,"s":8642,"text":"Class 12 Maths Solution"},{"code":null,"e":8799,"s":8666,"text":"RD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths Solution"},{"code":null,"e":8822,"s":8799,"text":"Class 8 Maths Solution"},{"code":null,"e":8845,"s":8822,"text":"Class 9 Maths Solution"},{"code":null,"e":8869,"s":8845,"text":"Class 10 Maths Solution"},{"code":null,"e":8893,"s":8869,"text":"Class 11 Maths Solution"},{"code":null,"e":8917,"s":8893,"text":"Class 12 Maths Solution"},{"code":null,"e":8998,"s":8917,"text":"Physics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 Notes"},{"code":null,"e":9012,"s":8998,"text":"Class 8 Notes"},{"code":null,"e":9026,"s":9012,"text":"Class 9 Notes"},{"code":null,"e":9041,"s":9026,"text":"Class 10 Notes"},{"code":null,"e":9056,"s":9041,"text":"Class 11 Notes"},{"code":null,"e":9262,"s":9056,"text":"CS Exams/PSUsISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer ExamUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved Papers"},{"code":null,"e":9373,"s":9262,"text":"ISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer Exam"},{"code":null,"e":9415,"s":9373,"text":"ISRO CS Original Papers and Official Keys"},{"code":null,"e":9437,"s":9415,"text":"ISRO CS Solved Papers"},{"code":null,"e":9482,"s":9437,"text":"ISRO CS Syllabus for Scientist/Engineer Exam"},{"code":null,"e":9565,"s":9482,"text":"UGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved Papers"},{"code":null,"e":9591,"s":9565,"text":"UGC NET CS Notes Paper II"},{"code":null,"e":9618,"s":9591,"text":"UGC NET CS Notes Paper III"},{"code":null,"e":9643,"s":9618,"text":"UGC NET CS Solved Papers"},{"code":null,"e":9833,"s":9643,"text":"StudentCampus Ambassador ProgramSchool Ambassador ProgramProjectGeek of the MonthCampus Geek of the MonthPlacement CourseCompetititve ProgrammingTestimonialsGeek on the TopCareersInternship"},{"code":null,"e":9859,"s":9833,"text":"Campus Ambassador Program"},{"code":null,"e":9885,"s":9859,"text":"School Ambassador Program"},{"code":null,"e":9893,"s":9885,"text":"Project"},{"code":null,"e":9911,"s":9893,"text":"Geek of the Month"},{"code":null,"e":9936,"s":9911,"text":"Campus Geek of the Month"},{"code":null,"e":9953,"s":9936,"text":"Placement Course"},{"code":null,"e":9978,"s":9953,"text":"Competititve Programming"},{"code":null,"e":9991,"s":9978,"text":"Testimonials"},{"code":null,"e":10007,"s":9991,"text":"Geek on the Top"},{"code":null,"e":10015,"s":10007,"text":"Careers"},{"code":null,"e":10026,"s":10015,"text":"Internship"},{"code":null,"e":10065,"s":10026,"text":"JobsApply for JobsPost a JobJOB-A-THON"},{"code":null,"e":10080,"s":10065,"text":"Apply for Jobs"},{"code":null,"e":10091,"s":10080,"text":"Post a Job"},{"code":null,"e":10102,"s":10091,"text":"JOB-A-THON"},{"code":null,"e":10109,"s":10102,"text":"Events"},{"code":null,"e":10380,"s":10113,"text":"WriteCome write articles for us and get featuredPracticeLearn and code with the best industry expertsPremiumGet access to ad-free content, doubt assistance and more!JobsCome and find your dream job with usGeeks DigestQuizzesGeeks CampusGblog ArticlesIDECampus Mantri"},{"code":null,"e":10393,"s":10380,"text":"Geeks Digest"},{"code":null,"e":10401,"s":10393,"text":"Quizzes"},{"code":null,"e":10414,"s":10401,"text":"Geeks Campus"},{"code":null,"e":10429,"s":10414,"text":"Gblog Articles"},{"code":null,"e":10433,"s":10429,"text":"IDE"},{"code":null,"e":10447,"s":10433,"text":"Campus Mantri"},{"code":null,"e":10455,"s":10447,"text":"Sign In"},{"code":null,"e":10463,"s":10455,"text":"Sign In"},{"code":null,"e":10468,"s":10463,"text":"Home"},{"code":null,"e":10481,"s":10468,"text":"Saved Videos"},{"code":null,"e":10489,"s":10481,"text":"Courses"},{"code":null,"e":14680,"s":10489,"text":"\n\nFor Working Professionals\n \n\n\n\nLIVE\n \n\n\nDSA Live Classes\n\nSystem Design\n\nJava Backend Development\n\nFull Stack LIVE\n\nExplore More\n\n\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nSDE Theory\n\nMust-Do Coding Questions\n\nExplore More\n\n\nFor Students\n \n\n\n\nLIVE\n \n\n\nCompetitive Programming\n\nData Structures with C++\n\nData Science\n\nExplore More\n\n\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nCIP\n\nJAVA / Python / C++\n\nExplore More\n\n\nSchool Courses\n \n\n\nSchool Guide\n\nPython Programming\n\nLearn To Make Apps\n\n\nPractice DS & Algo.\n \n\n\nMust Do Questions\n\nDSA Topic-wise\n\nDSA Company-wise\n\n\nAlgorithms\n \n\n\nSearching Algorithms\n\nSorting Algorithms\n\nGraph Algorithms\n\nPattern Searching\n\nGeometric Algorithms\n\nMathematical\n\nBitwise Algorithms\n\nRandomized Algorithms\n\nGreedy Algorithms\n\nDynamic Programming\n\nDivide and Conquer\n\nBacktracking\n\nBranch and Bound\n\nAll Algorithms\n\n\nAnalysis of Algorithms\n \n\n\nAsymptotic Analysis\n\nWorst, Average and Best Cases\n\nAsymptotic Notations\n\nLittle o and little omega notations\n\nLower and Upper Bound Theory\n\nAnalysis of Loops\n\nSolving Recurrences\n\nAmortized Analysis\n\nWhat does 'Space Complexity' mean ?\n\nPseudo-polynomial Algorithms\n\nPolynomial Time Approximation Scheme\n\nA Time Complexity Question\n\n\nData Structures\n \n\n\nArrays\n\nLinked List\n\nStack\n\nQueue\n\nBinary Tree\n\nBinary Search Tree\n\nHeap\n\nHashing\n\nGraph\n\nAdvanced Data Structure\n\nMatrix\n\nStrings\n\nAll Data Structures\n\n\nInterview Corner\n \n\n\nCompany Preparation\n\nTop Topics\n\nPractice Company Questions\n\nInterview Experiences\n\nExperienced Interviews\n\nInternship Interviews\n\nCompetititve Programming\n\nDesign Patterns\n\nSystem Design Tutorial\n\nMultiple Choice Quizzes\n\n\nLanguages\n \n\n\nC\n\nC++\n\nJava\n\nPython\n\nC#\n\nJavaScript\n\njQuery\n\nSQL\n\nPHP\n\nScala\n\nPerl\n\nGo Language\n\nHTML\n\nCSS\n\nKotlin\n\n\nML & Data Science\n \n\n\nMachine Learning\n\nData Science\n\n\nCS Subjects\n \n\n\nMathematics\n\nOperating System\n\nDBMS\n\nComputer Networks\n\nComputer Organization and Architecture\n\nTheory of Computation\n\nCompiler Design\n\nDigital Logic\n\nSoftware Engineering\n\n\nGATE\n \n\n\nGATE Computer Science Notes\n\nLast Minute Notes\n\nGATE CS Solved Papers\n\nGATE CS Original Papers and Official Keys\n\nGATE 2021 Dates\n\nGATE CS 2021 Syllabus\n\nImportant Topics for GATE CS\n\n\nWeb Technologies\n \n\n\nHTML\n\nCSS\n\nJavaScript\n\nAngularJS\n\nReactJS\n\nNodeJS\n\nBootstrap\n\njQuery\n\nPHP\n\n\nSoftware Designs\n \n\n\nSoftware Design Patterns\n\nSystem Design Tutorial\n\n\nSchool Learning\n \n\n\nSchool Programming\n\n\nMathematics\n \n\n\nNumber System\n\nAlgebra\n\nTrigonometry\n\nStatistics\n\nProbability\n\nGeometry\n\nMensuration\n\nCalculus\n\n\nMaths Notes (Class 8-12)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\nClass 12 Notes\n\n\nNCERT Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n\n\nRD Sharma Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n\n\nPhysics Notes (Class 8-11)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\n\nCS Exams/PSUs\n \n\n\n\nISRO\n \n\n\nISRO CS Original Papers and Official Keys\n\nISRO CS Solved Papers\n\nISRO CS Syllabus for Scientist/Engineer Exam\n\n\nUGC NET\n \n\n\nUGC NET CS Notes Paper II\n\nUGC NET CS Notes Paper III\n\nUGC NET CS Solved Papers\n\n\nStudent\n \n\n\nCampus Ambassador Program\n\nSchool Ambassador Program\n\nProject\n\nGeek of the Month\n\nCampus Geek of the Month\n\nPlacement Course\n\nCompetititve Programming\n\nTestimonials\n\nGeek on the Top\n\nCareers\n\nInternship\n\n\nTutorials\n \n\n\n\nJobs\n \n\n\nApply for Jobs\n\nPost a Job\n\nJOB-A-THON\n"},{"code":null,"e":14734,"s":14680,"text":"\nFor Working Professionals\n \n\n"},{"code":null,"e":14857,"s":14734,"text":"\nLIVE\n \n\n\nDSA Live Classes\n\nSystem Design\n\nJava Backend Development\n\nFull Stack LIVE\n\nExplore More\n"},{"code":null,"e":14876,"s":14857,"text":"\nDSA Live Classes\n"},{"code":null,"e":14892,"s":14876,"text":"\nSystem Design\n"},{"code":null,"e":14919,"s":14892,"text":"\nJava Backend Development\n"},{"code":null,"e":14937,"s":14919,"text":"\nFull Stack LIVE\n"},{"code":null,"e":14952,"s":14937,"text":"\nExplore More\n"},{"code":null,"e":15060,"s":14952,"text":"\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nSDE Theory\n\nMust-Do Coding Questions\n\nExplore More\n"},{"code":null,"e":15078,"s":15060,"text":"\nDSA- Self Paced\n"},{"code":null,"e":15091,"s":15078,"text":"\nSDE Theory\n"},{"code":null,"e":15118,"s":15091,"text":"\nMust-Do Coding Questions\n"},{"code":null,"e":15133,"s":15118,"text":"\nExplore More\n"},{"code":null,"e":15174,"s":15133,"text":"\nFor Students\n \n\n"},{"code":null,"e":15286,"s":15174,"text":"\nLIVE\n \n\n\nCompetitive Programming\n\nData Structures with C++\n\nData Science\n\nExplore More\n"},{"code":null,"e":15312,"s":15286,"text":"\nCompetitive Programming\n"},{"code":null,"e":15339,"s":15312,"text":"\nData Structures with C++\n"},{"code":null,"e":15354,"s":15339,"text":"\nData Science\n"},{"code":null,"e":15369,"s":15354,"text":"\nExplore More\n"},{"code":null,"e":15465,"s":15369,"text":"\nSelf-Paced\n \n\n\nDSA- Self Paced\n\nCIP\n\nJAVA / Python / C++\n\nExplore More\n"},{"code":null,"e":15483,"s":15465,"text":"\nDSA- Self Paced\n"},{"code":null,"e":15489,"s":15483,"text":"\nCIP\n"},{"code":null,"e":15511,"s":15489,"text":"\nJAVA / Python / C++\n"},{"code":null,"e":15526,"s":15511,"text":"\nExplore More\n"},{"code":null,"e":15623,"s":15526,"text":"\nSchool Courses\n \n\n\nSchool Guide\n\nPython Programming\n\nLearn To Make Apps\n"},{"code":null,"e":15638,"s":15623,"text":"\nSchool Guide\n"},{"code":null,"e":15659,"s":15638,"text":"\nPython Programming\n"},{"code":null,"e":15680,"s":15659,"text":"\nLearn To Make Apps\n"},{"code":null,"e":15781,"s":15680,"text":"\nPractice DS & Algo.\n \n\n\nMust Do Questions\n\nDSA Topic-wise\n\nDSA Company-wise\n"},{"code":null,"e":15801,"s":15781,"text":"\nMust Do Questions\n"},{"code":null,"e":15818,"s":15801,"text":"\nDSA Topic-wise\n"},{"code":null,"e":15837,"s":15818,"text":"\nDSA Company-wise\n"},{"code":null,"e":16142,"s":15837,"text":"\nAlgorithms\n \n\n\nSearching Algorithms\n\nSorting Algorithms\n\nGraph Algorithms\n\nPattern Searching\n\nGeometric Algorithms\n\nMathematical\n\nBitwise Algorithms\n\nRandomized Algorithms\n\nGreedy Algorithms\n\nDynamic Programming\n\nDivide and Conquer\n\nBacktracking\n\nBranch and Bound\n\nAll Algorithms\n"},{"code":null,"e":16165,"s":16142,"text":"\nSearching Algorithms\n"},{"code":null,"e":16186,"s":16165,"text":"\nSorting Algorithms\n"},{"code":null,"e":16205,"s":16186,"text":"\nGraph Algorithms\n"},{"code":null,"e":16225,"s":16205,"text":"\nPattern Searching\n"},{"code":null,"e":16248,"s":16225,"text":"\nGeometric Algorithms\n"},{"code":null,"e":16263,"s":16248,"text":"\nMathematical\n"},{"code":null,"e":16284,"s":16263,"text":"\nBitwise Algorithms\n"},{"code":null,"e":16308,"s":16284,"text":"\nRandomized Algorithms\n"},{"code":null,"e":16328,"s":16308,"text":"\nGreedy Algorithms\n"},{"code":null,"e":16350,"s":16328,"text":"\nDynamic Programming\n"},{"code":null,"e":16371,"s":16350,"text":"\nDivide and Conquer\n"},{"code":null,"e":16386,"s":16371,"text":"\nBacktracking\n"},{"code":null,"e":16405,"s":16386,"text":"\nBranch and Bound\n"},{"code":null,"e":16422,"s":16405,"text":"\nAll Algorithms\n"},{"code":null,"e":16807,"s":16422,"text":"\nAnalysis of Algorithms\n \n\n\nAsymptotic Analysis\n\nWorst, Average and Best Cases\n\nAsymptotic Notations\n\nLittle o and little omega notations\n\nLower and Upper Bound Theory\n\nAnalysis of Loops\n\nSolving Recurrences\n\nAmortized Analysis\n\nWhat does 'Space Complexity' mean ?\n\nPseudo-polynomial Algorithms\n\nPolynomial Time Approximation Scheme\n\nA Time Complexity Question\n"},{"code":null,"e":16829,"s":16807,"text":"\nAsymptotic Analysis\n"},{"code":null,"e":16861,"s":16829,"text":"\nWorst, Average and Best Cases\n"},{"code":null,"e":16884,"s":16861,"text":"\nAsymptotic Notations\n"},{"code":null,"e":16922,"s":16884,"text":"\nLittle o and little omega notations\n"},{"code":null,"e":16953,"s":16922,"text":"\nLower and Upper Bound Theory\n"},{"code":null,"e":16973,"s":16953,"text":"\nAnalysis of Loops\n"},{"code":null,"e":16995,"s":16973,"text":"\nSolving Recurrences\n"},{"code":null,"e":17016,"s":16995,"text":"\nAmortized Analysis\n"},{"code":null,"e":17054,"s":17016,"text":"\nWhat does 'Space Complexity' mean ?\n"},{"code":null,"e":17085,"s":17054,"text":"\nPseudo-polynomial Algorithms\n"},{"code":null,"e":17124,"s":17085,"text":"\nPolynomial Time Approximation Scheme\n"},{"code":null,"e":17153,"s":17124,"text":"\nA Time Complexity Question\n"},{"code":null,"e":17350,"s":17153,"text":"\nData Structures\n \n\n\nArrays\n\nLinked List\n\nStack\n\nQueue\n\nBinary Tree\n\nBinary Search Tree\n\nHeap\n\nHashing\n\nGraph\n\nAdvanced Data Structure\n\nMatrix\n\nStrings\n\nAll Data Structures\n"},{"code":null,"e":17359,"s":17350,"text":"\nArrays\n"},{"code":null,"e":17373,"s":17359,"text":"\nLinked List\n"},{"code":null,"e":17381,"s":17373,"text":"\nStack\n"},{"code":null,"e":17389,"s":17381,"text":"\nQueue\n"},{"code":null,"e":17403,"s":17389,"text":"\nBinary Tree\n"},{"code":null,"e":17424,"s":17403,"text":"\nBinary Search Tree\n"},{"code":null,"e":17431,"s":17424,"text":"\nHeap\n"},{"code":null,"e":17441,"s":17431,"text":"\nHashing\n"},{"code":null,"e":17449,"s":17441,"text":"\nGraph\n"},{"code":null,"e":17475,"s":17449,"text":"\nAdvanced Data Structure\n"},{"code":null,"e":17484,"s":17475,"text":"\nMatrix\n"},{"code":null,"e":17494,"s":17484,"text":"\nStrings\n"},{"code":null,"e":17516,"s":17494,"text":"\nAll Data Structures\n"},{"code":null,"e":17784,"s":17516,"text":"\nInterview Corner\n \n\n\nCompany Preparation\n\nTop Topics\n\nPractice Company Questions\n\nInterview Experiences\n\nExperienced Interviews\n\nInternship Interviews\n\nCompetititve Programming\n\nDesign Patterns\n\nSystem Design Tutorial\n\nMultiple Choice Quizzes\n"},{"code":null,"e":17806,"s":17784,"text":"\nCompany Preparation\n"},{"code":null,"e":17819,"s":17806,"text":"\nTop Topics\n"},{"code":null,"e":17848,"s":17819,"text":"\nPractice Company Questions\n"},{"code":null,"e":17872,"s":17848,"text":"\nInterview Experiences\n"},{"code":null,"e":17897,"s":17872,"text":"\nExperienced Interviews\n"},{"code":null,"e":17921,"s":17897,"text":"\nInternship Interviews\n"},{"code":null,"e":17948,"s":17921,"text":"\nCompetititve Programming\n"},{"code":null,"e":17966,"s":17948,"text":"\nDesign Patterns\n"},{"code":null,"e":17991,"s":17966,"text":"\nSystem Design Tutorial\n"},{"code":null,"e":18017,"s":17991,"text":"\nMultiple Choice Quizzes\n"},{"code":null,"e":18156,"s":18017,"text":"\nLanguages\n \n\n\nC\n\nC++\n\nJava\n\nPython\n\nC#\n\nJavaScript\n\njQuery\n\nSQL\n\nPHP\n\nScala\n\nPerl\n\nGo Language\n\nHTML\n\nCSS\n\nKotlin\n"},{"code":null,"e":18160,"s":18156,"text":"\nC\n"},{"code":null,"e":18166,"s":18160,"text":"\nC++\n"},{"code":null,"e":18173,"s":18166,"text":"\nJava\n"},{"code":null,"e":18182,"s":18173,"text":"\nPython\n"},{"code":null,"e":18187,"s":18182,"text":"\nC#\n"},{"code":null,"e":18200,"s":18187,"text":"\nJavaScript\n"},{"code":null,"e":18209,"s":18200,"text":"\njQuery\n"},{"code":null,"e":18215,"s":18209,"text":"\nSQL\n"},{"code":null,"e":18221,"s":18215,"text":"\nPHP\n"},{"code":null,"e":18229,"s":18221,"text":"\nScala\n"},{"code":null,"e":18236,"s":18229,"text":"\nPerl\n"},{"code":null,"e":18250,"s":18236,"text":"\nGo Language\n"},{"code":null,"e":18257,"s":18250,"text":"\nHTML\n"},{"code":null,"e":18263,"s":18257,"text":"\nCSS\n"},{"code":null,"e":18272,"s":18263,"text":"\nKotlin\n"},{"code":null,"e":18350,"s":18272,"text":"\nML & Data Science\n \n\n\nMachine Learning\n\nData Science\n"},{"code":null,"e":18369,"s":18350,"text":"\nMachine Learning\n"},{"code":null,"e":18384,"s":18369,"text":"\nData Science\n"},{"code":null,"e":18597,"s":18384,"text":"\nCS Subjects\n \n\n\nMathematics\n\nOperating System\n\nDBMS\n\nComputer Networks\n\nComputer Organization and Architecture\n\nTheory of Computation\n\nCompiler Design\n\nDigital Logic\n\nSoftware Engineering\n"},{"code":null,"e":18611,"s":18597,"text":"\nMathematics\n"},{"code":null,"e":18630,"s":18611,"text":"\nOperating System\n"},{"code":null,"e":18637,"s":18630,"text":"\nDBMS\n"},{"code":null,"e":18657,"s":18637,"text":"\nComputer Networks\n"},{"code":null,"e":18698,"s":18657,"text":"\nComputer Organization and Architecture\n"},{"code":null,"e":18722,"s":18698,"text":"\nTheory of Computation\n"},{"code":null,"e":18740,"s":18722,"text":"\nCompiler Design\n"},{"code":null,"e":18756,"s":18740,"text":"\nDigital Logic\n"},{"code":null,"e":18779,"s":18756,"text":"\nSoftware Engineering\n"},{"code":null,"e":18996,"s":18779,"text":"\nGATE\n \n\n\nGATE Computer Science Notes\n\nLast Minute Notes\n\nGATE CS Solved Papers\n\nGATE CS Original Papers and Official Keys\n\nGATE 2021 Dates\n\nGATE CS 2021 Syllabus\n\nImportant Topics for GATE CS\n"},{"code":null,"e":19026,"s":18996,"text":"\nGATE Computer Science Notes\n"},{"code":null,"e":19046,"s":19026,"text":"\nLast Minute Notes\n"},{"code":null,"e":19070,"s":19046,"text":"\nGATE CS Solved Papers\n"},{"code":null,"e":19114,"s":19070,"text":"\nGATE CS Original Papers and Official Keys\n"},{"code":null,"e":19132,"s":19114,"text":"\nGATE 2021 Dates\n"},{"code":null,"e":19156,"s":19132,"text":"\nGATE CS 2021 Syllabus\n"},{"code":null,"e":19187,"s":19156,"text":"\nImportant Topics for GATE CS\n"},{"code":null,"e":19307,"s":19187,"text":"\nWeb Technologies\n \n\n\nHTML\n\nCSS\n\nJavaScript\n\nAngularJS\n\nReactJS\n\nNodeJS\n\nBootstrap\n\njQuery\n\nPHP\n"},{"code":null,"e":19314,"s":19307,"text":"\nHTML\n"},{"code":null,"e":19320,"s":19314,"text":"\nCSS\n"},{"code":null,"e":19333,"s":19320,"text":"\nJavaScript\n"},{"code":null,"e":19345,"s":19333,"text":"\nAngularJS\n"},{"code":null,"e":19355,"s":19345,"text":"\nReactJS\n"},{"code":null,"e":19364,"s":19355,"text":"\nNodeJS\n"},{"code":null,"e":19376,"s":19364,"text":"\nBootstrap\n"},{"code":null,"e":19385,"s":19376,"text":"\njQuery\n"},{"code":null,"e":19391,"s":19385,"text":"\nPHP\n"},{"code":null,"e":19486,"s":19391,"text":"\nSoftware Designs\n \n\n\nSoftware Design Patterns\n\nSystem Design Tutorial\n"},{"code":null,"e":19513,"s":19486,"text":"\nSoftware Design Patterns\n"},{"code":null,"e":19538,"s":19513,"text":"\nSystem Design Tutorial\n"},{"code":null,"e":19602,"s":19538,"text":"\nSchool Learning\n \n\n\nSchool Programming\n"},{"code":null,"e":19623,"s":19602,"text":"\nSchool Programming\n"},{"code":null,"e":19759,"s":19623,"text":"\nMathematics\n \n\n\nNumber System\n\nAlgebra\n\nTrigonometry\n\nStatistics\n\nProbability\n\nGeometry\n\nMensuration\n\nCalculus\n"},{"code":null,"e":19775,"s":19759,"text":"\nNumber System\n"},{"code":null,"e":19785,"s":19775,"text":"\nAlgebra\n"},{"code":null,"e":19800,"s":19785,"text":"\nTrigonometry\n"},{"code":null,"e":19813,"s":19800,"text":"\nStatistics\n"},{"code":null,"e":19827,"s":19813,"text":"\nProbability\n"},{"code":null,"e":19838,"s":19827,"text":"\nGeometry\n"},{"code":null,"e":19852,"s":19838,"text":"\nMensuration\n"},{"code":null,"e":19863,"s":19852,"text":"\nCalculus\n"},{"code":null,"e":19994,"s":19863,"text":"\nMaths Notes (Class 8-12)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n\nClass 12 Notes\n"},{"code":null,"e":20010,"s":19994,"text":"\nClass 8 Notes\n"},{"code":null,"e":20026,"s":20010,"text":"\nClass 9 Notes\n"},{"code":null,"e":20043,"s":20026,"text":"\nClass 10 Notes\n"},{"code":null,"e":20060,"s":20043,"text":"\nClass 11 Notes\n"},{"code":null,"e":20077,"s":20060,"text":"\nClass 12 Notes\n"},{"code":null,"e":20244,"s":20077,"text":"\nNCERT Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n"},{"code":null,"e":20269,"s":20244,"text":"\nClass 8 Maths Solution\n"},{"code":null,"e":20294,"s":20269,"text":"\nClass 9 Maths Solution\n"},{"code":null,"e":20320,"s":20294,"text":"\nClass 10 Maths Solution\n"},{"code":null,"e":20346,"s":20320,"text":"\nClass 11 Maths Solution\n"},{"code":null,"e":20372,"s":20346,"text":"\nClass 12 Maths Solution\n"},{"code":null,"e":20543,"s":20372,"text":"\nRD Sharma Solutions\n \n\n\nClass 8 Maths Solution\n\nClass 9 Maths Solution\n\nClass 10 Maths Solution\n\nClass 11 Maths Solution\n\nClass 12 Maths Solution\n"},{"code":null,"e":20568,"s":20543,"text":"\nClass 8 Maths Solution\n"},{"code":null,"e":20593,"s":20568,"text":"\nClass 9 Maths Solution\n"},{"code":null,"e":20619,"s":20593,"text":"\nClass 10 Maths Solution\n"},{"code":null,"e":20645,"s":20619,"text":"\nClass 11 Maths Solution\n"},{"code":null,"e":20671,"s":20645,"text":"\nClass 12 Maths Solution\n"},{"code":null,"e":20788,"s":20671,"text":"\nPhysics Notes (Class 8-11)\n \n\n\nClass 8 Notes\n\nClass 9 Notes\n\nClass 10 Notes\n\nClass 11 Notes\n"},{"code":null,"e":20804,"s":20788,"text":"\nClass 8 Notes\n"},{"code":null,"e":20820,"s":20804,"text":"\nClass 9 Notes\n"},{"code":null,"e":20837,"s":20820,"text":"\nClass 10 Notes\n"},{"code":null,"e":20854,"s":20837,"text":"\nClass 11 Notes\n"},{"code":null,"e":20896,"s":20854,"text":"\nCS Exams/PSUs\n \n\n"},{"code":null,"e":21041,"s":20896,"text":"\nISRO\n \n\n\nISRO CS Original Papers and Official Keys\n\nISRO CS Solved Papers\n\nISRO CS Syllabus for Scientist/Engineer Exam\n"},{"code":null,"e":21085,"s":21041,"text":"\nISRO CS Original Papers and Official Keys\n"},{"code":null,"e":21109,"s":21085,"text":"\nISRO CS Solved Papers\n"},{"code":null,"e":21156,"s":21109,"text":"\nISRO CS Syllabus for Scientist/Engineer Exam\n"},{"code":null,"e":21273,"s":21156,"text":"\nUGC NET\n \n\n\nUGC NET CS Notes Paper II\n\nUGC NET CS Notes Paper III\n\nUGC NET CS Solved Papers\n"},{"code":null,"e":21301,"s":21273,"text":"\nUGC NET CS Notes Paper II\n"},{"code":null,"e":21330,"s":21301,"text":"\nUGC NET CS Notes Paper III\n"},{"code":null,"e":21357,"s":21330,"text":"\nUGC NET CS Solved Papers\n"},{"code":null,"e":21597,"s":21357,"text":"\nStudent\n \n\n\nCampus Ambassador Program\n\nSchool Ambassador Program\n\nProject\n\nGeek of the Month\n\nCampus Geek of the Month\n\nPlacement Course\n\nCompetititve Programming\n\nTestimonials\n\nGeek on the Top\n\nCareers\n\nInternship\n"},{"code":null,"e":21625,"s":21597,"text":"\nCampus Ambassador Program\n"},{"code":null,"e":21653,"s":21625,"text":"\nSchool Ambassador Program\n"},{"code":null,"e":21663,"s":21653,"text":"\nProject\n"},{"code":null,"e":21683,"s":21663,"text":"\nGeek of the Month\n"},{"code":null,"e":21710,"s":21683,"text":"\nCampus Geek of the Month\n"},{"code":null,"e":21729,"s":21710,"text":"\nPlacement Course\n"},{"code":null,"e":21756,"s":21729,"text":"\nCompetititve Programming\n"},{"code":null,"e":21771,"s":21756,"text":"\nTestimonials\n"},{"code":null,"e":21789,"s":21771,"text":"\nGeek on the Top\n"},{"code":null,"e":21799,"s":21789,"text":"\nCareers\n"},{"code":null,"e":21812,"s":21799,"text":"\nInternship\n"},{"code":null,"e":21850,"s":21812,"text":"\nTutorials\n \n\n"},{"code":null,"e":21923,"s":21850,"text":"\nJobs\n \n\n\nApply for Jobs\n\nPost a Job\n\nJOB-A-THON\n"},{"code":null,"e":21940,"s":21923,"text":"\nApply for Jobs\n"},{"code":null,"e":21953,"s":21940,"text":"\nPost a Job\n"},{"code":null,"e":21966,"s":21953,"text":"\nJOB-A-THON\n"},{"code":null,"e":21972,"s":21966,"text":"GBlog"},{"code":null,"e":21980,"s":21972,"text":"Puzzles"},{"code":null,"e":21993,"s":21980,"text":"What's New ?"},{"code":null,"e":21999,"s":21993,"text":"Array"},{"code":null,"e":22006,"s":21999,"text":"Matrix"},{"code":null,"e":22014,"s":22006,"text":"Strings"},{"code":null,"e":22022,"s":22014,"text":"Hashing"},{"code":null,"e":22034,"s":22022,"text":"Linked List"},{"code":null,"e":22040,"s":22034,"text":"Stack"},{"code":null,"e":22046,"s":22040,"text":"Queue"},{"code":null,"e":22058,"s":22046,"text":"Binary Tree"},{"code":null,"e":22077,"s":22058,"text":"Binary Search Tree"},{"code":null,"e":22082,"s":22077,"text":"Heap"},{"code":null,"e":22088,"s":22082,"text":"Graph"},{"code":null,"e":22098,"s":22088,"text":"Searching"},{"code":null,"e":22106,"s":22098,"text":"Sorting"},{"code":null,"e":22123,"s":22106,"text":"Divide & Conquer"},{"code":null,"e":22136,"s":22123,"text":"Mathematical"},{"code":null,"e":22146,"s":22136,"text":"Geometric"},{"code":null,"e":22154,"s":22146,"text":"Bitwise"},{"code":null,"e":22161,"s":22154,"text":"Greedy"},{"code":null,"e":22174,"s":22161,"text":"Backtracking"},{"code":null,"e":22191,"s":22174,"text":"Branch and Bound"},{"code":null,"e":22211,"s":22191,"text":"Dynamic Programming"},{"code":null,"e":22229,"s":22211,"text":"Pattern Searching"},{"code":null,"e":22240,"s":22229,"text":"Randomized"},{"code":null,"e":22282,"s":22240,"text":"Sort an array which contain 1 to n values"},{"code":null,"e":22324,"s":22282,"text":"Sort 1 to N by swapping adjacent elements"},{"code":null,"e":22371,"s":22324,"text":"Sort an array containing two types of elements"},{"code":null,"e":22406,"s":22371,"text":"Sort elements by frequency | Set 1"},{"code":null,"e":22441,"s":22406,"text":"Sort elements by frequency | Set 2"},{"code":null,"e":22508,"s":22441,"text":"Sort elements by frequency | Set 4 (Efficient approach using hash)"},{"code":null,"e":22564,"s":22508,"text":"Sorting Array Elements By Frequency | Set 3 (Using STL)"},{"code":null,"e":22616,"s":22564,"text":"Sort elements by frequency | Set 5 (using Java Map)"},{"code":null,"e":22654,"s":22616,"text":"Sorting a Hashmap according to values"},{"code":null,"e":22698,"s":22654,"text":"Sorting a HashMap according to keys in Java"},{"code":null,"e":22714,"s":22698,"text":"TreeMap in Java"},{"code":null,"e":22730,"s":22714,"text":"TreeSet in Java"},{"code":null,"e":22746,"s":22730,"text":"HashSet in Java"},{"code":null,"e":22776,"s":22746,"text":"HashMap in Java with Examples"},{"code":null,"e":22812,"s":22776,"text":"Internal Working of HashMap in Java"},{"code":null,"e":22852,"s":22812,"text":"Internal working of Set/HashSet in Java"},{"code":null,"e":22875,"s":22852,"text":"Merge Two Sets in Java"},{"code":null,"e":22887,"s":22875,"text":"Set in Java"},{"code":null,"e":22909,"s":22887,"text":"Map Interface in Java"},{"code":null,"e":22940,"s":22909,"text":"How to iterate any Map in Java"},{"code":null,"e":22955,"s":22940,"text":"Arrays in Java"},{"code":null,"e":23001,"s":22955,"text":"Write a program to reverse an array or string"},{"code":null,"e":23033,"s":23001,"text":"Largest Sum Contiguous Subarray"},{"code":null,"e":23060,"s":23033,"text":"Program for array rotation"},{"code":null,"e":23076,"s":23060,"text":"Arrays in C/C++"},{"code":null,"e":23124,"s":23076,"text":"Stack Data Structure (Introduction and Program)"},{"code":null,"e":23168,"s":23124,"text":"Top 50 Array Coding Problems for Interviews"},{"code":null,"e":23182,"s":23168,"text":"Linear Search"},{"code":null,"e":23267,"s":23182,"text":"Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)"},{"code":null,"e":23335,"s":23267,"text":"Maximum and minimum of an array using minimum number of comparisons"},{"code":null,"e":23377,"s":23335,"text":"Sort an array which contain 1 to n values"},{"code":null,"e":23419,"s":23377,"text":"Sort 1 to N by swapping adjacent elements"},{"code":null,"e":23466,"s":23419,"text":"Sort an array containing two types of elements"},{"code":null,"e":23501,"s":23466,"text":"Sort elements by frequency | Set 1"},{"code":null,"e":23536,"s":23501,"text":"Sort elements by frequency | Set 2"},{"code":null,"e":23603,"s":23536,"text":"Sort elements by frequency | Set 4 (Efficient approach using hash)"},{"code":null,"e":23659,"s":23603,"text":"Sorting Array Elements By Frequency | Set 3 (Using STL)"},{"code":null,"e":23711,"s":23659,"text":"Sort elements by frequency | Set 5 (using Java Map)"},{"code":null,"e":23749,"s":23711,"text":"Sorting a Hashmap according to values"},{"code":null,"e":23793,"s":23749,"text":"Sorting a HashMap according to keys in Java"},{"code":null,"e":23809,"s":23793,"text":"TreeMap in Java"},{"code":null,"e":23825,"s":23809,"text":"TreeSet in Java"},{"code":null,"e":23841,"s":23825,"text":"HashSet in Java"},{"code":null,"e":23871,"s":23841,"text":"HashMap in Java with Examples"},{"code":null,"e":23907,"s":23871,"text":"Internal Working of HashMap in Java"},{"code":null,"e":23947,"s":23907,"text":"Internal working of Set/HashSet in Java"},{"code":null,"e":23970,"s":23947,"text":"Merge Two Sets in Java"},{"code":null,"e":23982,"s":23970,"text":"Set in Java"},{"code":null,"e":24004,"s":23982,"text":"Map Interface in Java"},{"code":null,"e":24035,"s":24004,"text":"How to iterate any Map in Java"},{"code":null,"e":24050,"s":24035,"text":"Arrays in Java"},{"code":null,"e":24096,"s":24050,"text":"Write a program to reverse an array or string"},{"code":null,"e":24128,"s":24096,"text":"Largest Sum Contiguous Subarray"},{"code":null,"e":24155,"s":24128,"text":"Program for array rotation"},{"code":null,"e":24171,"s":24155,"text":"Arrays in C/C++"},{"code":null,"e":24219,"s":24171,"text":"Stack Data Structure (Introduction and Program)"},{"code":null,"e":24263,"s":24219,"text":"Top 50 Array Coding Problems for Interviews"},{"code":null,"e":24277,"s":24263,"text":"Linear Search"},{"code":null,"e":24362,"s":24277,"text":"Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)"},{"code":null,"e":24430,"s":24362,"text":"Maximum and minimum of an array using minimum number of comparisons"},{"code":null,"e":24454,"s":24430,"text":"Difficulty Level :\nEasy"},{"code":null,"e":24613,"s":24454,"text":"You have given an array which contain 1 to n element, your task is to sort this array in an efficient way and without replace with 1 to n numbers.Examples : "},{"code":null,"e":24710,"s":24613,"text":"Input : arr[] = {10, 7, 9, 2, 8, \n 3, 5, 4, 6, 1};\nOutput : 1 2 3 4 5 6 7 8 9 10"},{"code":null,"e":24998,"s":24712,"text":"Native approach : Sort this array with the use of any type of sorting method. it takes O(nlogn) minimum time.Efficient approach : Replace every element with it’s position. it takes O(n) efficient time and give you the sorted array. Let’s understand this approach with the code below. "},{"code":null,"e":25002,"s":24998,"text":"C++"},{"code":null,"e":25007,"s":25002,"text":"Java"},{"code":null,"e":25015,"s":25007,"text":"Python3"},{"code":null,"e":25018,"s":25015,"text":"C#"},{"code":null,"e":25022,"s":25018,"text":"PHP"},{"code":null,"e":25033,"s":25022,"text":"Javascript"},{"code":"// Efficient C++ program to sort an array of// numbers in range from 1 to n.#include using namespace std; // function for sort arrayvoid sortit(int arr[], int n){ for (int i = 0; i < n; i++) { arr[i]=i+1; }} // Driver codeint main(){ int arr[] = { 10, 7, 9, 2, 8, 3, 5, 4, 6, 1 }; int n = sizeof(arr) / sizeof(arr[0]); // for sort an array sortit(arr, n); // for print all the element in sorted way for (int i = 0; i < n; i++) cout << arr[i] << \" \"; }","e":25541,"s":25033,"text":null},{"code":"// Efficient Java program to sort an// array of numbers in range from 1// to n.import java.io.*;import java.util.*; public class GFG { // function for sort array static void sortit(int []arr, int n) { for (int i = 0; i < n; i++) { arr[i]=i+1; } } // Driver code public static void main(String args[]) { int []arr = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1}; int n = arr.length; // for sort an array sortit(arr, n); // for print all the // element in sorted way for (int i = 0; i < n; i++) System.out.print(arr[i] + \" \"); }} // This code is contributed by Manish Shaw// (manishshaw1)","e":26304,"s":25541,"text":null},{"code":"# Python3 program to sort an array of# numbers in range from 1 to n. # function for sort arraydef sortit(arr,n): for i in range(n): arr[i] = i+1 # Driver codeif __name__=='__main__': arr = [10, 7, 9, 2, 8, 3, 5, 4, 6, 1 ] n = len(arr) # for sort an array sortit(arr,n) # for print all the element # in sorted way for i in range(n): print(arr[i],end=\" \") # This code is contributed by# Shrikant13","e":26741,"s":26304,"text":null},{"code":"// Efficient C# program to sort an array of// numbers in range from 1 to n.using System;using System.Collections.Generic; class GFG { // function for sort array static void sortit(int []arr, int n) { for (int i = 0; i < n; i++) { arr[i]=i+1; } } // Driver code public static void Main() { int []arr = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1}; int n = arr.Length; // for sort an array sortit(arr, n); // for print all the // element in sorted way for (int i = 0; i < n; i++) Console.Write(arr[i] + \" \"); }} // This code is contributed by// Manish Shaw (manishshaw1)","e":27468,"s":26741,"text":null},{"code":"","e":27950,"s":27468,"text":null},{"code":"","e":28454,"s":27950,"text":null},{"code":null,"e":28475,"s":28454,"text":"1 2 3 4 5 6 7 8 9 10"},{"code":null,"e":28499,"s":28477,"text":"Time Complexity: O(n)"},{"code":null,"e":28522,"s":28499,"text":"Space Complexity: O(1)"},{"code":null,"e":28534,"s":28522,"text":"manishshaw1"},{"code":null,"e":28549,"s":28534,"text":"_Keep_Silence_"},{"code":null,"e":28561,"s":28549,"text":"shrikanth13"},{"code":null,"e":28575,"s":28561,"text":"surbhityagi15"},{"code":null,"e":28588,"s":28575,"text":"prasanna1995"},{"code":null,"e":28611,"s":28588,"text":"limited-range-elements"},{"code":null,"e":28618,"s":28611,"text":"Arrays"},{"code":null,"e":28626,"s":28618,"text":"Sorting"},{"code":null,"e":28633,"s":28626,"text":"Arrays"},{"code":null,"e":28641,"s":28633,"text":"Sorting"},{"code":null,"e":28739,"s":28641,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":28748,"s":28739,"text":"Comments"},{"code":null,"e":28761,"s":28748,"text":"Old Comments"},{"code":null,"e":28784,"s":28761,"text":"Introduction to Arrays"},{"code":null,"e":28816,"s":28784,"text":"Multidimensional Arrays in Java"},{"code":null,"e":28837,"s":28816,"text":"Linked List vs Array"},{"code":null,"e":28891,"s":28837,"text":"Queue | Set 1 (Introduction and Array Implementation)"}],"string":"[\n {\n \"code\": null,\n \"e\": 407,\n \"s\": 0,\n \"text\": \"CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore MoreSchool CoursesSchool GuidePython ProgrammingLearn To Make AppsAll Courses\"\n },\n {\n \"code\": null,\n \"e\": 588,\n \"s\": 407,\n \"text\": \"For Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore More\"\n },\n {\n \"code\": null,\n \"e\": 673,\n \"s\": 588,\n \"text\": \"LIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore More\"\n },\n {\n \"code\": null,\n \"e\": 690,\n \"s\": 673,\n \"text\": \"DSA Live Classes\"\n },\n {\n \"code\": null,\n \"e\": 704,\n \"s\": 690,\n \"text\": \"System Design\"\n },\n {\n \"code\": null,\n \"e\": 729,\n \"s\": 704,\n \"text\": \"Java Backend Development\"\n },\n {\n \"code\": null,\n \"e\": 745,\n \"s\": 729,\n \"text\": \"Full Stack LIVE\"\n },\n {\n \"code\": null,\n \"e\": 758,\n \"s\": 745,\n \"text\": \"Explore More\"\n },\n {\n \"code\": null,\n \"e\": 830,\n \"s\": 758,\n \"text\": \"Self-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore More\"\n },\n {\n \"code\": null,\n \"e\": 846,\n \"s\": 830,\n \"text\": \"DSA- Self Paced\"\n },\n {\n \"code\": null,\n \"e\": 857,\n \"s\": 846,\n \"text\": \"SDE Theory\"\n },\n {\n \"code\": null,\n \"e\": 882,\n \"s\": 857,\n \"text\": \"Must-Do Coding Questions\"\n },\n {\n \"code\": null,\n \"e\": 895,\n \"s\": 882,\n \"text\": \"Explore More\"\n },\n {\n \"code\": null,\n \"e\": 1042,\n \"s\": 895,\n \"text\": \"For StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C++Explore More\"\n },\n {\n \"code\": null,\n \"e\": 1118,\n \"s\": 1042,\n \"text\": \"LIVECompetitive ProgrammingData Structures with C++Data ScienceExplore More\"\n },\n {\n \"code\": null,\n \"e\": 1142,\n \"s\": 1118,\n \"text\": \"Competitive Programming\"\n },\n {\n \"code\": null,\n \"e\": 1167,\n \"s\": 1142,\n \"text\": \"Data Structures with C++\"\n },\n {\n \"code\": null,\n \"e\": 1180,\n \"s\": 1167,\n \"text\": \"Data Science\"\n },\n {\n \"code\": null,\n \"e\": 1193,\n \"s\": 1180,\n \"text\": \"Explore More\"\n },\n {\n \"code\": null,\n \"e\": 1253,\n \"s\": 1193,\n \"text\": \"Self-PacedDSA- Self PacedCIPJAVA / Python / C++Explore More\"\n },\n {\n \"code\": null,\n \"e\": 1269,\n \"s\": 1253,\n \"text\": \"DSA- Self Paced\"\n },\n {\n \"code\": null,\n \"e\": 1273,\n \"s\": 1269,\n \"text\": \"CIP\"\n },\n {\n \"code\": null,\n \"e\": 1293,\n \"s\": 1273,\n \"text\": \"JAVA / Python / C++\"\n },\n {\n \"code\": null,\n \"e\": 1306,\n \"s\": 1293,\n \"text\": \"Explore More\"\n },\n {\n \"code\": null,\n \"e\": 1369,\n \"s\": 1306,\n \"text\": \"School CoursesSchool GuidePython ProgrammingLearn To Make Apps\"\n },\n {\n \"code\": null,\n \"e\": 1382,\n \"s\": 1369,\n \"text\": \"School Guide\"\n },\n {\n \"code\": null,\n \"e\": 1401,\n \"s\": 1382,\n \"text\": \"Python Programming\"\n },\n {\n \"code\": null,\n \"e\": 1420,\n \"s\": 1401,\n \"text\": \"Learn To Make Apps\"\n },\n {\n \"code\": null,\n \"e\": 1432,\n \"s\": 1420,\n \"text\": \"All Courses\"\n },\n {\n \"code\": null,\n \"e\": 3999,\n \"s\": 1432,\n \"text\": \"TutorialsPractice DS & Algo.Must Do QuestionsDSA Topic-wiseDSA Company-wiseAlgorithmsAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity QuestionSearching AlgorithmsSorting AlgorithmsGraph AlgorithmsPattern SearchingGeometric AlgorithmsMathematicalBitwise AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide and ConquerBacktrackingBranch and BoundAll AlgorithmsData StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvanced Data StructureMatrixStringsAll Data StructuresInterview CornerCompany PreparationTop TopicsPractice Company QuestionsInterview ExperiencesExperienced InterviewsInternship InterviewsCompetititve ProgrammingDesign PatternsSystem Design TutorialMultiple Choice QuizzesLanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGo LanguageHTMLCSSKotlinML & Data ScienceMachine LearningData ScienceCS SubjectsMathematicsOperating SystemDBMSComputer NetworksComputer Organization and ArchitectureTheory of ComputationCompiler DesignDigital LogicSoftware EngineeringGATEGATE Computer Science NotesLast Minute NotesGATE CS Solved PapersGATE CS Original Papers and Official KeysGATE 2021 DatesGATE CS 2021 SyllabusImportant Topics for GATE CSWeb TechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHPSoftware DesignsSoftware Design PatternsSystem Design TutorialSchool LearningSchool ProgrammingMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 NotesNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesCS Exams/PSUsISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer ExamUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved PapersStudentCampus Ambassador ProgramSchool Ambassador ProgramProjectGeek of the MonthCampus Geek of the MonthPlacement CourseCompetititve ProgrammingTestimonialsGeek on the TopCareersInternship\"\n },\n {\n \"code\": null,\n \"e\": 4066,\n \"s\": 3999,\n \"text\": \"Practice DS & Algo.Must Do QuestionsDSA Topic-wiseDSA Company-wise\"\n },\n {\n \"code\": null,\n \"e\": 4084,\n \"s\": 4066,\n \"text\": \"Must Do Questions\"\n },\n {\n \"code\": null,\n \"e\": 4099,\n \"s\": 4084,\n \"text\": \"DSA Topic-wise\"\n },\n {\n \"code\": null,\n \"e\": 4116,\n \"s\": 4099,\n \"text\": \"DSA Company-wise\"\n },\n {\n \"code\": null,\n \"e\": 4697,\n \"s\": 4116,\n \"text\": \"AlgorithmsAnalysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity QuestionSearching AlgorithmsSorting AlgorithmsGraph AlgorithmsPattern SearchingGeometric AlgorithmsMathematicalBitwise AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide and ConquerBacktrackingBranch and BoundAll Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5030,\n \"s\": 4697,\n \"text\": \"Analysis of AlgorithmsAsymptotic AnalysisWorst, Average and Best CasesAsymptotic NotationsLittle o and little omega notationsLower and Upper Bound TheoryAnalysis of LoopsSolving RecurrencesAmortized AnalysisWhat does 'Space Complexity' mean ?Pseudo-polynomial AlgorithmsPolynomial Time Approximation SchemeA Time Complexity Question\"\n },\n {\n \"code\": null,\n \"e\": 5050,\n \"s\": 5030,\n \"text\": \"Asymptotic Analysis\"\n },\n {\n \"code\": null,\n \"e\": 5080,\n \"s\": 5050,\n \"text\": \"Worst, Average and Best Cases\"\n },\n {\n \"code\": null,\n \"e\": 5101,\n \"s\": 5080,\n \"text\": \"Asymptotic Notations\"\n },\n {\n \"code\": null,\n \"e\": 5137,\n \"s\": 5101,\n \"text\": \"Little o and little omega notations\"\n },\n {\n \"code\": null,\n \"e\": 5166,\n \"s\": 5137,\n \"text\": \"Lower and Upper Bound Theory\"\n },\n {\n \"code\": null,\n \"e\": 5184,\n \"s\": 5166,\n \"text\": \"Analysis of Loops\"\n },\n {\n \"code\": null,\n \"e\": 5204,\n \"s\": 5184,\n \"text\": \"Solving Recurrences\"\n },\n {\n \"code\": null,\n \"e\": 5223,\n \"s\": 5204,\n \"text\": \"Amortized Analysis\"\n },\n {\n \"code\": null,\n \"e\": 5259,\n \"s\": 5223,\n \"text\": \"What does 'Space Complexity' mean ?\"\n },\n {\n \"code\": null,\n \"e\": 5288,\n \"s\": 5259,\n \"text\": \"Pseudo-polynomial Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5325,\n \"s\": 5288,\n \"text\": \"Polynomial Time Approximation Scheme\"\n },\n {\n \"code\": null,\n \"e\": 5352,\n \"s\": 5325,\n \"text\": \"A Time Complexity Question\"\n },\n {\n \"code\": null,\n \"e\": 5373,\n \"s\": 5352,\n \"text\": \"Searching Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5392,\n \"s\": 5373,\n \"text\": \"Sorting Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5409,\n \"s\": 5392,\n \"text\": \"Graph Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5427,\n \"s\": 5409,\n \"text\": \"Pattern Searching\"\n },\n {\n \"code\": null,\n \"e\": 5448,\n \"s\": 5427,\n \"text\": \"Geometric Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5461,\n \"s\": 5448,\n \"text\": \"Mathematical\"\n },\n {\n \"code\": null,\n \"e\": 5480,\n \"s\": 5461,\n \"text\": \"Bitwise Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5502,\n \"s\": 5480,\n \"text\": \"Randomized Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5520,\n \"s\": 5502,\n \"text\": \"Greedy Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5540,\n \"s\": 5520,\n \"text\": \"Dynamic Programming\"\n },\n {\n \"code\": null,\n \"e\": 5559,\n \"s\": 5540,\n \"text\": \"Divide and Conquer\"\n },\n {\n \"code\": null,\n \"e\": 5572,\n \"s\": 5559,\n \"text\": \"Backtracking\"\n },\n {\n \"code\": null,\n \"e\": 5589,\n \"s\": 5572,\n \"text\": \"Branch and Bound\"\n },\n {\n \"code\": null,\n \"e\": 5604,\n \"s\": 5589,\n \"text\": \"All Algorithms\"\n },\n {\n \"code\": null,\n \"e\": 5747,\n \"s\": 5604,\n \"text\": \"Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvanced Data StructureMatrixStringsAll Data Structures\"\n },\n {\n \"code\": null,\n \"e\": 5754,\n \"s\": 5747,\n \"text\": \"Arrays\"\n },\n {\n \"code\": null,\n \"e\": 5766,\n \"s\": 5754,\n \"text\": \"Linked List\"\n },\n {\n \"code\": null,\n \"e\": 5772,\n \"s\": 5766,\n \"text\": \"Stack\"\n },\n {\n \"code\": null,\n \"e\": 5778,\n \"s\": 5772,\n \"text\": \"Queue\"\n },\n {\n \"code\": null,\n \"e\": 5790,\n \"s\": 5778,\n \"text\": \"Binary Tree\"\n },\n {\n \"code\": null,\n \"e\": 5809,\n \"s\": 5790,\n \"text\": \"Binary Search Tree\"\n },\n {\n \"code\": null,\n \"e\": 5814,\n \"s\": 5809,\n \"text\": \"Heap\"\n },\n {\n \"code\": null,\n \"e\": 5822,\n \"s\": 5814,\n \"text\": \"Hashing\"\n },\n {\n \"code\": null,\n \"e\": 5828,\n \"s\": 5822,\n \"text\": \"Graph\"\n },\n {\n \"code\": null,\n \"e\": 5852,\n \"s\": 5828,\n \"text\": \"Advanced Data Structure\"\n },\n {\n \"code\": null,\n \"e\": 5859,\n \"s\": 5852,\n \"text\": \"Matrix\"\n },\n {\n \"code\": null,\n \"e\": 5867,\n \"s\": 5859,\n \"text\": \"Strings\"\n },\n {\n \"code\": null,\n \"e\": 5887,\n \"s\": 5867,\n \"text\": \"All Data Structures\"\n },\n {\n \"code\": null,\n \"e\": 6107,\n \"s\": 5887,\n \"text\": \"Interview CornerCompany PreparationTop TopicsPractice Company QuestionsInterview ExperiencesExperienced InterviewsInternship InterviewsCompetititve ProgrammingDesign PatternsSystem Design TutorialMultiple Choice Quizzes\"\n },\n {\n \"code\": null,\n \"e\": 6127,\n \"s\": 6107,\n \"text\": \"Company Preparation\"\n },\n {\n \"code\": null,\n \"e\": 6138,\n \"s\": 6127,\n \"text\": \"Top Topics\"\n },\n {\n \"code\": null,\n \"e\": 6165,\n \"s\": 6138,\n \"text\": \"Practice Company Questions\"\n },\n {\n \"code\": null,\n \"e\": 6187,\n \"s\": 6165,\n \"text\": \"Interview Experiences\"\n },\n {\n \"code\": null,\n \"e\": 6210,\n \"s\": 6187,\n \"text\": \"Experienced Interviews\"\n },\n {\n \"code\": null,\n \"e\": 6232,\n \"s\": 6210,\n \"text\": \"Internship Interviews\"\n },\n {\n \"code\": null,\n \"e\": 6257,\n \"s\": 6232,\n \"text\": \"Competititve Programming\"\n },\n {\n \"code\": null,\n \"e\": 6273,\n \"s\": 6257,\n \"text\": \"Design Patterns\"\n },\n {\n \"code\": null,\n \"e\": 6296,\n \"s\": 6273,\n \"text\": \"System Design Tutorial\"\n },\n {\n \"code\": null,\n \"e\": 6320,\n \"s\": 6296,\n \"text\": \"Multiple Choice Quizzes\"\n },\n {\n \"code\": null,\n \"e\": 6401,\n \"s\": 6320,\n \"text\": \"LanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGo LanguageHTMLCSSKotlin\"\n },\n {\n \"code\": null,\n \"e\": 6403,\n \"s\": 6401,\n \"text\": \"C\"\n },\n {\n \"code\": null,\n \"e\": 6407,\n \"s\": 6403,\n \"text\": \"C++\"\n },\n {\n \"code\": null,\n \"e\": 6412,\n \"s\": 6407,\n \"text\": \"Java\"\n },\n {\n \"code\": null,\n \"e\": 6419,\n \"s\": 6412,\n \"text\": \"Python\"\n },\n {\n \"code\": null,\n \"e\": 6422,\n \"s\": 6419,\n \"text\": \"C#\"\n },\n {\n \"code\": null,\n \"e\": 6433,\n \"s\": 6422,\n \"text\": \"JavaScript\"\n },\n {\n \"code\": null,\n \"e\": 6440,\n \"s\": 6433,\n \"text\": \"jQuery\"\n },\n {\n \"code\": null,\n \"e\": 6444,\n \"s\": 6440,\n \"text\": \"SQL\"\n },\n {\n \"code\": null,\n \"e\": 6448,\n \"s\": 6444,\n \"text\": \"PHP\"\n },\n {\n \"code\": null,\n \"e\": 6454,\n \"s\": 6448,\n \"text\": \"Scala\"\n },\n {\n \"code\": null,\n \"e\": 6459,\n \"s\": 6454,\n \"text\": \"Perl\"\n },\n {\n \"code\": null,\n \"e\": 6471,\n \"s\": 6459,\n \"text\": \"Go Language\"\n },\n {\n \"code\": null,\n \"e\": 6476,\n \"s\": 6471,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 6480,\n \"s\": 6476,\n \"text\": \"CSS\"\n },\n {\n \"code\": null,\n \"e\": 6487,\n \"s\": 6480,\n \"text\": \"Kotlin\"\n },\n {\n \"code\": null,\n \"e\": 6533,\n \"s\": 6487,\n \"text\": \"ML & Data ScienceMachine LearningData Science\"\n },\n {\n \"code\": null,\n \"e\": 6550,\n \"s\": 6533,\n \"text\": \"Machine Learning\"\n },\n {\n \"code\": null,\n \"e\": 6563,\n \"s\": 6550,\n \"text\": \"Data Science\"\n },\n {\n \"code\": null,\n \"e\": 6730,\n \"s\": 6563,\n \"text\": \"CS SubjectsMathematicsOperating SystemDBMSComputer NetworksComputer Organization and ArchitectureTheory of ComputationCompiler DesignDigital LogicSoftware Engineering\"\n },\n {\n \"code\": null,\n \"e\": 6742,\n \"s\": 6730,\n \"text\": \"Mathematics\"\n },\n {\n \"code\": null,\n \"e\": 6759,\n \"s\": 6742,\n \"text\": \"Operating System\"\n },\n {\n \"code\": null,\n \"e\": 6764,\n \"s\": 6759,\n \"text\": \"DBMS\"\n },\n {\n \"code\": null,\n \"e\": 6782,\n \"s\": 6764,\n \"text\": \"Computer Networks\"\n },\n {\n \"code\": null,\n \"e\": 6821,\n \"s\": 6782,\n \"text\": \"Computer Organization and Architecture\"\n },\n {\n \"code\": null,\n \"e\": 6843,\n \"s\": 6821,\n \"text\": \"Theory of Computation\"\n },\n {\n \"code\": null,\n \"e\": 6859,\n \"s\": 6843,\n \"text\": \"Compiler Design\"\n },\n {\n \"code\": null,\n \"e\": 6873,\n \"s\": 6859,\n \"text\": \"Digital Logic\"\n },\n {\n \"code\": null,\n \"e\": 6894,\n \"s\": 6873,\n \"text\": \"Software Engineering\"\n },\n {\n \"code\": null,\n \"e\": 7069,\n \"s\": 6894,\n \"text\": \"GATEGATE Computer Science NotesLast Minute NotesGATE CS Solved PapersGATE CS Original Papers and Official KeysGATE 2021 DatesGATE CS 2021 SyllabusImportant Topics for GATE CS\"\n },\n {\n \"code\": null,\n \"e\": 7097,\n \"s\": 7069,\n \"text\": \"GATE Computer Science Notes\"\n },\n {\n \"code\": null,\n \"e\": 7115,\n \"s\": 7097,\n \"text\": \"Last Minute Notes\"\n },\n {\n \"code\": null,\n \"e\": 7137,\n \"s\": 7115,\n \"text\": \"GATE CS Solved Papers\"\n },\n {\n \"code\": null,\n \"e\": 7179,\n \"s\": 7137,\n \"text\": \"GATE CS Original Papers and Official Keys\"\n },\n {\n \"code\": null,\n \"e\": 7195,\n \"s\": 7179,\n \"text\": \"GATE 2021 Dates\"\n },\n {\n \"code\": null,\n \"e\": 7217,\n \"s\": 7195,\n \"text\": \"GATE CS 2021 Syllabus\"\n },\n {\n \"code\": null,\n \"e\": 7246,\n \"s\": 7217,\n \"text\": \"Important Topics for GATE CS\"\n },\n {\n \"code\": null,\n \"e\": 7320,\n \"s\": 7246,\n \"text\": \"Web TechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHP\"\n },\n {\n \"code\": null,\n \"e\": 7325,\n \"s\": 7320,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 7329,\n \"s\": 7325,\n \"text\": \"CSS\"\n },\n {\n \"code\": null,\n \"e\": 7340,\n \"s\": 7329,\n \"text\": \"JavaScript\"\n },\n {\n \"code\": null,\n \"e\": 7350,\n \"s\": 7340,\n \"text\": \"AngularJS\"\n },\n {\n \"code\": null,\n \"e\": 7358,\n \"s\": 7350,\n \"text\": \"ReactJS\"\n },\n {\n \"code\": null,\n \"e\": 7365,\n \"s\": 7358,\n \"text\": \"NodeJS\"\n },\n {\n \"code\": null,\n \"e\": 7375,\n \"s\": 7365,\n \"text\": \"Bootstrap\"\n },\n {\n \"code\": null,\n \"e\": 7382,\n \"s\": 7375,\n \"text\": \"jQuery\"\n },\n {\n \"code\": null,\n \"e\": 7386,\n \"s\": 7382,\n \"text\": \"PHP\"\n },\n {\n \"code\": null,\n \"e\": 7449,\n \"s\": 7386,\n \"text\": \"Software DesignsSoftware Design PatternsSystem Design Tutorial\"\n },\n {\n \"code\": null,\n \"e\": 7474,\n \"s\": 7449,\n \"text\": \"Software Design Patterns\"\n },\n {\n \"code\": null,\n \"e\": 7497,\n \"s\": 7474,\n \"text\": \"System Design Tutorial\"\n },\n {\n \"code\": null,\n \"e\": 8054,\n \"s\": 7497,\n \"text\": \"School LearningSchool ProgrammingMathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMaths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 NotesNCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionRD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths SolutionPhysics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8073,\n \"s\": 8054,\n \"text\": \"School Programming\"\n },\n {\n \"code\": null,\n \"e\": 8165,\n \"s\": 8073,\n \"text\": \"MathematicsNumber SystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculus\"\n },\n {\n \"code\": null,\n \"e\": 8179,\n \"s\": 8165,\n \"text\": \"Number System\"\n },\n {\n \"code\": null,\n \"e\": 8187,\n \"s\": 8179,\n \"text\": \"Algebra\"\n },\n {\n \"code\": null,\n \"e\": 8200,\n \"s\": 8187,\n \"text\": \"Trigonometry\"\n },\n {\n \"code\": null,\n \"e\": 8211,\n \"s\": 8200,\n \"text\": \"Statistics\"\n },\n {\n \"code\": null,\n \"e\": 8223,\n \"s\": 8211,\n \"text\": \"Probability\"\n },\n {\n \"code\": null,\n \"e\": 8232,\n \"s\": 8223,\n \"text\": \"Geometry\"\n },\n {\n \"code\": null,\n \"e\": 8244,\n \"s\": 8232,\n \"text\": \"Mensuration\"\n },\n {\n \"code\": null,\n \"e\": 8253,\n \"s\": 8244,\n \"text\": \"Calculus\"\n },\n {\n \"code\": null,\n \"e\": 8346,\n \"s\": 8253,\n \"text\": \"Maths Notes (Class 8-12)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 NotesClass 12 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8360,\n \"s\": 8346,\n \"text\": \"Class 8 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8374,\n \"s\": 8360,\n \"text\": \"Class 9 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8389,\n \"s\": 8374,\n \"text\": \"Class 10 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8404,\n \"s\": 8389,\n \"text\": \"Class 11 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8419,\n \"s\": 8404,\n \"text\": \"Class 12 Notes\"\n },\n {\n \"code\": null,\n \"e\": 8548,\n \"s\": 8419,\n \"text\": \"NCERT SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8571,\n \"s\": 8548,\n \"text\": \"Class 8 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8594,\n \"s\": 8571,\n \"text\": \"Class 9 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8618,\n \"s\": 8594,\n \"text\": \"Class 10 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8642,\n \"s\": 8618,\n \"text\": \"Class 11 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8666,\n \"s\": 8642,\n \"text\": \"Class 12 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8799,\n \"s\": 8666,\n \"text\": \"RD Sharma SolutionsClass 8 Maths SolutionClass 9 Maths SolutionClass 10 Maths SolutionClass 11 Maths SolutionClass 12 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8822,\n \"s\": 8799,\n \"text\": \"Class 8 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8845,\n \"s\": 8822,\n \"text\": \"Class 9 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8869,\n \"s\": 8845,\n \"text\": \"Class 10 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8893,\n \"s\": 8869,\n \"text\": \"Class 11 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8917,\n \"s\": 8893,\n \"text\": \"Class 12 Maths Solution\"\n },\n {\n \"code\": null,\n \"e\": 8998,\n \"s\": 8917,\n \"text\": \"Physics Notes (Class 8-11)Class 8 NotesClass 9 NotesClass 10 NotesClass 11 Notes\"\n },\n {\n \"code\": null,\n \"e\": 9012,\n \"s\": 8998,\n \"text\": \"Class 8 Notes\"\n },\n {\n \"code\": null,\n \"e\": 9026,\n \"s\": 9012,\n \"text\": \"Class 9 Notes\"\n },\n {\n \"code\": null,\n \"e\": 9041,\n \"s\": 9026,\n \"text\": \"Class 10 Notes\"\n },\n {\n \"code\": null,\n \"e\": 9056,\n \"s\": 9041,\n \"text\": \"Class 11 Notes\"\n },\n {\n \"code\": null,\n \"e\": 9262,\n \"s\": 9056,\n \"text\": \"CS Exams/PSUsISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer ExamUGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved Papers\"\n },\n {\n \"code\": null,\n \"e\": 9373,\n \"s\": 9262,\n \"text\": \"ISROISRO CS Original Papers and Official KeysISRO CS Solved PapersISRO CS Syllabus for Scientist/Engineer Exam\"\n },\n {\n \"code\": null,\n \"e\": 9415,\n \"s\": 9373,\n \"text\": \"ISRO CS Original Papers and Official Keys\"\n },\n {\n \"code\": null,\n \"e\": 9437,\n \"s\": 9415,\n \"text\": \"ISRO CS Solved Papers\"\n },\n {\n \"code\": null,\n \"e\": 9482,\n \"s\": 9437,\n \"text\": \"ISRO CS Syllabus for Scientist/Engineer Exam\"\n },\n {\n \"code\": null,\n \"e\": 9565,\n \"s\": 9482,\n \"text\": \"UGC NETUGC NET CS Notes Paper IIUGC NET CS Notes Paper IIIUGC NET CS Solved Papers\"\n },\n {\n \"code\": null,\n \"e\": 9591,\n \"s\": 9565,\n \"text\": \"UGC NET CS Notes Paper II\"\n },\n {\n \"code\": null,\n \"e\": 9618,\n \"s\": 9591,\n \"text\": \"UGC NET CS Notes Paper III\"\n },\n {\n \"code\": null,\n \"e\": 9643,\n \"s\": 9618,\n \"text\": \"UGC NET CS Solved Papers\"\n },\n {\n \"code\": null,\n \"e\": 9833,\n \"s\": 9643,\n \"text\": \"StudentCampus Ambassador ProgramSchool Ambassador ProgramProjectGeek of the MonthCampus Geek of the MonthPlacement CourseCompetititve ProgrammingTestimonialsGeek on the TopCareersInternship\"\n },\n {\n \"code\": null,\n \"e\": 9859,\n \"s\": 9833,\n \"text\": \"Campus Ambassador Program\"\n },\n {\n \"code\": null,\n \"e\": 9885,\n \"s\": 9859,\n \"text\": \"School Ambassador Program\"\n },\n {\n \"code\": null,\n \"e\": 9893,\n \"s\": 9885,\n \"text\": \"Project\"\n },\n {\n \"code\": null,\n \"e\": 9911,\n \"s\": 9893,\n \"text\": \"Geek of the Month\"\n },\n {\n \"code\": null,\n \"e\": 9936,\n \"s\": 9911,\n \"text\": \"Campus Geek of the Month\"\n },\n {\n \"code\": null,\n \"e\": 9953,\n \"s\": 9936,\n \"text\": \"Placement Course\"\n },\n {\n \"code\": null,\n \"e\": 9978,\n \"s\": 9953,\n \"text\": \"Competititve Programming\"\n },\n {\n \"code\": null,\n \"e\": 9991,\n \"s\": 9978,\n \"text\": \"Testimonials\"\n },\n {\n \"code\": null,\n \"e\": 10007,\n \"s\": 9991,\n \"text\": \"Geek on the Top\"\n },\n {\n \"code\": null,\n \"e\": 10015,\n \"s\": 10007,\n \"text\": \"Careers\"\n },\n {\n \"code\": null,\n \"e\": 10026,\n \"s\": 10015,\n \"text\": \"Internship\"\n },\n {\n \"code\": null,\n \"e\": 10065,\n \"s\": 10026,\n \"text\": \"JobsApply for JobsPost a JobJOB-A-THON\"\n },\n {\n \"code\": null,\n \"e\": 10080,\n \"s\": 10065,\n \"text\": \"Apply for Jobs\"\n },\n {\n \"code\": null,\n \"e\": 10091,\n \"s\": 10080,\n \"text\": \"Post a Job\"\n },\n {\n \"code\": null,\n \"e\": 10102,\n \"s\": 10091,\n \"text\": \"JOB-A-THON\"\n },\n {\n \"code\": null,\n \"e\": 10109,\n \"s\": 10102,\n \"text\": \"Events\"\n },\n {\n \"code\": null,\n \"e\": 10380,\n \"s\": 10113,\n \"text\": \"WriteCome write articles for us and get featuredPracticeLearn and code with the best industry expertsPremiumGet access to ad-free content, doubt assistance and more!JobsCome and find your dream job with usGeeks DigestQuizzesGeeks CampusGblog ArticlesIDECampus Mantri\"\n },\n {\n \"code\": null,\n \"e\": 10393,\n \"s\": 10380,\n \"text\": \"Geeks Digest\"\n },\n {\n \"code\": null,\n \"e\": 10401,\n \"s\": 10393,\n \"text\": \"Quizzes\"\n },\n {\n \"code\": null,\n \"e\": 10414,\n \"s\": 10401,\n \"text\": \"Geeks Campus\"\n },\n {\n \"code\": null,\n \"e\": 10429,\n \"s\": 10414,\n \"text\": \"Gblog Articles\"\n },\n {\n \"code\": null,\n \"e\": 10433,\n \"s\": 10429,\n \"text\": \"IDE\"\n },\n {\n \"code\": null,\n \"e\": 10447,\n \"s\": 10433,\n \"text\": \"Campus Mantri\"\n },\n {\n \"code\": null,\n \"e\": 10455,\n \"s\": 10447,\n \"text\": \"Sign In\"\n },\n {\n \"code\": null,\n \"e\": 10463,\n \"s\": 10455,\n \"text\": \"Sign In\"\n },\n {\n \"code\": null,\n \"e\": 10468,\n \"s\": 10463,\n \"text\": \"Home\"\n },\n {\n \"code\": null,\n \"e\": 10481,\n \"s\": 10468,\n \"text\": \"Saved Videos\"\n },\n {\n \"code\": null,\n \"e\": 10489,\n \"s\": 10481,\n \"text\": \"Courses\"\n },\n {\n \"code\": null,\n \"e\": 14680,\n \"s\": 10489,\n \"text\": \"\\n\\nFor Working Professionals\\n \\n\\n\\n\\nLIVE\\n \\n\\n\\nDSA Live Classes\\n\\nSystem Design\\n\\nJava Backend Development\\n\\nFull Stack LIVE\\n\\nExplore More\\n\\n\\nSelf-Paced\\n \\n\\n\\nDSA- Self Paced\\n\\nSDE Theory\\n\\nMust-Do Coding Questions\\n\\nExplore More\\n\\n\\nFor Students\\n \\n\\n\\n\\nLIVE\\n \\n\\n\\nCompetitive Programming\\n\\nData Structures with C++\\n\\nData Science\\n\\nExplore More\\n\\n\\nSelf-Paced\\n \\n\\n\\nDSA- Self Paced\\n\\nCIP\\n\\nJAVA / Python / C++\\n\\nExplore More\\n\\n\\nSchool Courses\\n \\n\\n\\nSchool Guide\\n\\nPython Programming\\n\\nLearn To Make Apps\\n\\n\\nPractice DS & Algo.\\n \\n\\n\\nMust Do Questions\\n\\nDSA Topic-wise\\n\\nDSA Company-wise\\n\\n\\nAlgorithms\\n \\n\\n\\nSearching Algorithms\\n\\nSorting Algorithms\\n\\nGraph Algorithms\\n\\nPattern Searching\\n\\nGeometric Algorithms\\n\\nMathematical\\n\\nBitwise Algorithms\\n\\nRandomized Algorithms\\n\\nGreedy Algorithms\\n\\nDynamic Programming\\n\\nDivide and Conquer\\n\\nBacktracking\\n\\nBranch and Bound\\n\\nAll Algorithms\\n\\n\\nAnalysis of Algorithms\\n \\n\\n\\nAsymptotic Analysis\\n\\nWorst, Average and Best Cases\\n\\nAsymptotic Notations\\n\\nLittle o and little omega notations\\n\\nLower and Upper Bound Theory\\n\\nAnalysis of Loops\\n\\nSolving Recurrences\\n\\nAmortized Analysis\\n\\nWhat does 'Space Complexity' mean ?\\n\\nPseudo-polynomial Algorithms\\n\\nPolynomial Time Approximation Scheme\\n\\nA Time Complexity Question\\n\\n\\nData Structures\\n \\n\\n\\nArrays\\n\\nLinked List\\n\\nStack\\n\\nQueue\\n\\nBinary Tree\\n\\nBinary Search Tree\\n\\nHeap\\n\\nHashing\\n\\nGraph\\n\\nAdvanced Data Structure\\n\\nMatrix\\n\\nStrings\\n\\nAll Data Structures\\n\\n\\nInterview Corner\\n \\n\\n\\nCompany Preparation\\n\\nTop Topics\\n\\nPractice Company Questions\\n\\nInterview Experiences\\n\\nExperienced Interviews\\n\\nInternship Interviews\\n\\nCompetititve Programming\\n\\nDesign Patterns\\n\\nSystem Design Tutorial\\n\\nMultiple Choice Quizzes\\n\\n\\nLanguages\\n \\n\\n\\nC\\n\\nC++\\n\\nJava\\n\\nPython\\n\\nC#\\n\\nJavaScript\\n\\njQuery\\n\\nSQL\\n\\nPHP\\n\\nScala\\n\\nPerl\\n\\nGo Language\\n\\nHTML\\n\\nCSS\\n\\nKotlin\\n\\n\\nML & Data Science\\n \\n\\n\\nMachine Learning\\n\\nData Science\\n\\n\\nCS Subjects\\n \\n\\n\\nMathematics\\n\\nOperating System\\n\\nDBMS\\n\\nComputer Networks\\n\\nComputer Organization and Architecture\\n\\nTheory of Computation\\n\\nCompiler Design\\n\\nDigital Logic\\n\\nSoftware Engineering\\n\\n\\nGATE\\n \\n\\n\\nGATE Computer Science Notes\\n\\nLast Minute Notes\\n\\nGATE CS Solved Papers\\n\\nGATE CS Original Papers and Official Keys\\n\\nGATE 2021 Dates\\n\\nGATE CS 2021 Syllabus\\n\\nImportant Topics for GATE CS\\n\\n\\nWeb Technologies\\n \\n\\n\\nHTML\\n\\nCSS\\n\\nJavaScript\\n\\nAngularJS\\n\\nReactJS\\n\\nNodeJS\\n\\nBootstrap\\n\\njQuery\\n\\nPHP\\n\\n\\nSoftware Designs\\n \\n\\n\\nSoftware Design Patterns\\n\\nSystem Design Tutorial\\n\\n\\nSchool Learning\\n \\n\\n\\nSchool Programming\\n\\n\\nMathematics\\n \\n\\n\\nNumber System\\n\\nAlgebra\\n\\nTrigonometry\\n\\nStatistics\\n\\nProbability\\n\\nGeometry\\n\\nMensuration\\n\\nCalculus\\n\\n\\nMaths Notes (Class 8-12)\\n \\n\\n\\nClass 8 Notes\\n\\nClass 9 Notes\\n\\nClass 10 Notes\\n\\nClass 11 Notes\\n\\nClass 12 Notes\\n\\n\\nNCERT Solutions\\n \\n\\n\\nClass 8 Maths Solution\\n\\nClass 9 Maths Solution\\n\\nClass 10 Maths Solution\\n\\nClass 11 Maths Solution\\n\\nClass 12 Maths Solution\\n\\n\\nRD Sharma Solutions\\n \\n\\n\\nClass 8 Maths Solution\\n\\nClass 9 Maths Solution\\n\\nClass 10 Maths Solution\\n\\nClass 11 Maths Solution\\n\\nClass 12 Maths Solution\\n\\n\\nPhysics Notes (Class 8-11)\\n \\n\\n\\nClass 8 Notes\\n\\nClass 9 Notes\\n\\nClass 10 Notes\\n\\nClass 11 Notes\\n\\n\\nCS Exams/PSUs\\n \\n\\n\\n\\nISRO\\n \\n\\n\\nISRO CS Original Papers and Official Keys\\n\\nISRO CS Solved Papers\\n\\nISRO CS Syllabus for Scientist/Engineer Exam\\n\\n\\nUGC NET\\n \\n\\n\\nUGC NET CS Notes Paper II\\n\\nUGC NET CS Notes Paper III\\n\\nUGC NET CS Solved Papers\\n\\n\\nStudent\\n \\n\\n\\nCampus Ambassador Program\\n\\nSchool Ambassador Program\\n\\nProject\\n\\nGeek of the Month\\n\\nCampus Geek of the Month\\n\\nPlacement Course\\n\\nCompetititve Programming\\n\\nTestimonials\\n\\nGeek on the Top\\n\\nCareers\\n\\nInternship\\n\\n\\nTutorials\\n \\n\\n\\n\\nJobs\\n \\n\\n\\nApply for Jobs\\n\\nPost a Job\\n\\nJOB-A-THON\\n\"\n },\n {\n \"code\": null,\n \"e\": 14734,\n \"s\": 14680,\n \"text\": \"\\nFor Working Professionals\\n \\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 14857,\n \"s\": 14734,\n \"text\": \"\\nLIVE\\n \\n\\n\\nDSA Live Classes\\n\\nSystem Design\\n\\nJava Backend Development\\n\\nFull Stack LIVE\\n\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 14876,\n \"s\": 14857,\n \"text\": \"\\nDSA Live Classes\\n\"\n },\n {\n \"code\": null,\n \"e\": 14892,\n \"s\": 14876,\n \"text\": \"\\nSystem Design\\n\"\n },\n {\n \"code\": null,\n \"e\": 14919,\n \"s\": 14892,\n \"text\": \"\\nJava Backend Development\\n\"\n },\n {\n \"code\": null,\n \"e\": 14937,\n \"s\": 14919,\n \"text\": \"\\nFull Stack LIVE\\n\"\n },\n {\n \"code\": null,\n \"e\": 14952,\n \"s\": 14937,\n \"text\": \"\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15060,\n \"s\": 14952,\n \"text\": \"\\nSelf-Paced\\n \\n\\n\\nDSA- Self Paced\\n\\nSDE Theory\\n\\nMust-Do Coding Questions\\n\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15078,\n \"s\": 15060,\n \"text\": \"\\nDSA- Self Paced\\n\"\n },\n {\n \"code\": null,\n \"e\": 15091,\n \"s\": 15078,\n \"text\": \"\\nSDE Theory\\n\"\n },\n {\n \"code\": null,\n \"e\": 15118,\n \"s\": 15091,\n \"text\": \"\\nMust-Do Coding Questions\\n\"\n },\n {\n \"code\": null,\n \"e\": 15133,\n \"s\": 15118,\n \"text\": \"\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15174,\n \"s\": 15133,\n \"text\": \"\\nFor Students\\n \\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 15286,\n \"s\": 15174,\n \"text\": \"\\nLIVE\\n \\n\\n\\nCompetitive Programming\\n\\nData Structures with C++\\n\\nData Science\\n\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15312,\n \"s\": 15286,\n \"text\": \"\\nCompetitive Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 15339,\n \"s\": 15312,\n \"text\": \"\\nData Structures with C++\\n\"\n },\n {\n \"code\": null,\n \"e\": 15354,\n \"s\": 15339,\n \"text\": \"\\nData Science\\n\"\n },\n {\n \"code\": null,\n \"e\": 15369,\n \"s\": 15354,\n \"text\": \"\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15465,\n \"s\": 15369,\n \"text\": \"\\nSelf-Paced\\n \\n\\n\\nDSA- Self Paced\\n\\nCIP\\n\\nJAVA / Python / C++\\n\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15483,\n \"s\": 15465,\n \"text\": \"\\nDSA- Self Paced\\n\"\n },\n {\n \"code\": null,\n \"e\": 15489,\n \"s\": 15483,\n \"text\": \"\\nCIP\\n\"\n },\n {\n \"code\": null,\n \"e\": 15511,\n \"s\": 15489,\n \"text\": \"\\nJAVA / Python / C++\\n\"\n },\n {\n \"code\": null,\n \"e\": 15526,\n \"s\": 15511,\n \"text\": \"\\nExplore More\\n\"\n },\n {\n \"code\": null,\n \"e\": 15623,\n \"s\": 15526,\n \"text\": \"\\nSchool Courses\\n \\n\\n\\nSchool Guide\\n\\nPython Programming\\n\\nLearn To Make Apps\\n\"\n },\n {\n \"code\": null,\n \"e\": 15638,\n \"s\": 15623,\n \"text\": \"\\nSchool Guide\\n\"\n },\n {\n \"code\": null,\n \"e\": 15659,\n \"s\": 15638,\n \"text\": \"\\nPython Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 15680,\n \"s\": 15659,\n \"text\": \"\\nLearn To Make Apps\\n\"\n },\n {\n \"code\": null,\n \"e\": 15781,\n \"s\": 15680,\n \"text\": \"\\nPractice DS & Algo.\\n \\n\\n\\nMust Do Questions\\n\\nDSA Topic-wise\\n\\nDSA Company-wise\\n\"\n },\n {\n \"code\": null,\n \"e\": 15801,\n \"s\": 15781,\n \"text\": \"\\nMust Do Questions\\n\"\n },\n {\n \"code\": null,\n \"e\": 15818,\n \"s\": 15801,\n \"text\": \"\\nDSA Topic-wise\\n\"\n },\n {\n \"code\": null,\n \"e\": 15837,\n \"s\": 15818,\n \"text\": \"\\nDSA Company-wise\\n\"\n },\n {\n \"code\": null,\n \"e\": 16142,\n \"s\": 15837,\n \"text\": \"\\nAlgorithms\\n \\n\\n\\nSearching Algorithms\\n\\nSorting Algorithms\\n\\nGraph Algorithms\\n\\nPattern Searching\\n\\nGeometric Algorithms\\n\\nMathematical\\n\\nBitwise Algorithms\\n\\nRandomized Algorithms\\n\\nGreedy Algorithms\\n\\nDynamic Programming\\n\\nDivide and Conquer\\n\\nBacktracking\\n\\nBranch and Bound\\n\\nAll Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16165,\n \"s\": 16142,\n \"text\": \"\\nSearching Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16186,\n \"s\": 16165,\n \"text\": \"\\nSorting Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16205,\n \"s\": 16186,\n \"text\": \"\\nGraph Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16225,\n \"s\": 16205,\n \"text\": \"\\nPattern Searching\\n\"\n },\n {\n \"code\": null,\n \"e\": 16248,\n \"s\": 16225,\n \"text\": \"\\nGeometric Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16263,\n \"s\": 16248,\n \"text\": \"\\nMathematical\\n\"\n },\n {\n \"code\": null,\n \"e\": 16284,\n \"s\": 16263,\n \"text\": \"\\nBitwise Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16308,\n \"s\": 16284,\n \"text\": \"\\nRandomized Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16328,\n \"s\": 16308,\n \"text\": \"\\nGreedy Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16350,\n \"s\": 16328,\n \"text\": \"\\nDynamic Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 16371,\n \"s\": 16350,\n \"text\": \"\\nDivide and Conquer\\n\"\n },\n {\n \"code\": null,\n \"e\": 16386,\n \"s\": 16371,\n \"text\": \"\\nBacktracking\\n\"\n },\n {\n \"code\": null,\n \"e\": 16405,\n \"s\": 16386,\n \"text\": \"\\nBranch and Bound\\n\"\n },\n {\n \"code\": null,\n \"e\": 16422,\n \"s\": 16405,\n \"text\": \"\\nAll Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 16807,\n \"s\": 16422,\n \"text\": \"\\nAnalysis of Algorithms\\n \\n\\n\\nAsymptotic Analysis\\n\\nWorst, Average and Best Cases\\n\\nAsymptotic Notations\\n\\nLittle o and little omega notations\\n\\nLower and Upper Bound Theory\\n\\nAnalysis of Loops\\n\\nSolving Recurrences\\n\\nAmortized Analysis\\n\\nWhat does 'Space Complexity' mean ?\\n\\nPseudo-polynomial Algorithms\\n\\nPolynomial Time Approximation Scheme\\n\\nA Time Complexity Question\\n\"\n },\n {\n \"code\": null,\n \"e\": 16829,\n \"s\": 16807,\n \"text\": \"\\nAsymptotic Analysis\\n\"\n },\n {\n \"code\": null,\n \"e\": 16861,\n \"s\": 16829,\n \"text\": \"\\nWorst, Average and Best Cases\\n\"\n },\n {\n \"code\": null,\n \"e\": 16884,\n \"s\": 16861,\n \"text\": \"\\nAsymptotic Notations\\n\"\n },\n {\n \"code\": null,\n \"e\": 16922,\n \"s\": 16884,\n \"text\": \"\\nLittle o and little omega notations\\n\"\n },\n {\n \"code\": null,\n \"e\": 16953,\n \"s\": 16922,\n \"text\": \"\\nLower and Upper Bound Theory\\n\"\n },\n {\n \"code\": null,\n \"e\": 16973,\n \"s\": 16953,\n \"text\": \"\\nAnalysis of Loops\\n\"\n },\n {\n \"code\": null,\n \"e\": 16995,\n \"s\": 16973,\n \"text\": \"\\nSolving Recurrences\\n\"\n },\n {\n \"code\": null,\n \"e\": 17016,\n \"s\": 16995,\n \"text\": \"\\nAmortized Analysis\\n\"\n },\n {\n \"code\": null,\n \"e\": 17054,\n \"s\": 17016,\n \"text\": \"\\nWhat does 'Space Complexity' mean ?\\n\"\n },\n {\n \"code\": null,\n \"e\": 17085,\n \"s\": 17054,\n \"text\": \"\\nPseudo-polynomial Algorithms\\n\"\n },\n {\n \"code\": null,\n \"e\": 17124,\n \"s\": 17085,\n \"text\": \"\\nPolynomial Time Approximation Scheme\\n\"\n },\n {\n \"code\": null,\n \"e\": 17153,\n \"s\": 17124,\n \"text\": \"\\nA Time Complexity Question\\n\"\n },\n {\n \"code\": null,\n \"e\": 17350,\n \"s\": 17153,\n \"text\": \"\\nData Structures\\n \\n\\n\\nArrays\\n\\nLinked List\\n\\nStack\\n\\nQueue\\n\\nBinary Tree\\n\\nBinary Search Tree\\n\\nHeap\\n\\nHashing\\n\\nGraph\\n\\nAdvanced Data Structure\\n\\nMatrix\\n\\nStrings\\n\\nAll Data Structures\\n\"\n },\n {\n \"code\": null,\n \"e\": 17359,\n \"s\": 17350,\n \"text\": \"\\nArrays\\n\"\n },\n {\n \"code\": null,\n \"e\": 17373,\n \"s\": 17359,\n \"text\": \"\\nLinked List\\n\"\n },\n {\n \"code\": null,\n \"e\": 17381,\n \"s\": 17373,\n \"text\": \"\\nStack\\n\"\n },\n {\n \"code\": null,\n \"e\": 17389,\n \"s\": 17381,\n \"text\": \"\\nQueue\\n\"\n },\n {\n \"code\": null,\n \"e\": 17403,\n \"s\": 17389,\n \"text\": \"\\nBinary Tree\\n\"\n },\n {\n \"code\": null,\n \"e\": 17424,\n \"s\": 17403,\n \"text\": \"\\nBinary Search Tree\\n\"\n },\n {\n \"code\": null,\n \"e\": 17431,\n \"s\": 17424,\n \"text\": \"\\nHeap\\n\"\n },\n {\n \"code\": null,\n \"e\": 17441,\n \"s\": 17431,\n \"text\": \"\\nHashing\\n\"\n },\n {\n \"code\": null,\n \"e\": 17449,\n \"s\": 17441,\n \"text\": \"\\nGraph\\n\"\n },\n {\n \"code\": null,\n \"e\": 17475,\n \"s\": 17449,\n \"text\": \"\\nAdvanced Data Structure\\n\"\n },\n {\n \"code\": null,\n \"e\": 17484,\n \"s\": 17475,\n \"text\": \"\\nMatrix\\n\"\n },\n {\n \"code\": null,\n \"e\": 17494,\n \"s\": 17484,\n \"text\": \"\\nStrings\\n\"\n },\n {\n \"code\": null,\n \"e\": 17516,\n \"s\": 17494,\n \"text\": \"\\nAll Data Structures\\n\"\n },\n {\n \"code\": null,\n \"e\": 17784,\n \"s\": 17516,\n \"text\": \"\\nInterview Corner\\n \\n\\n\\nCompany Preparation\\n\\nTop Topics\\n\\nPractice Company Questions\\n\\nInterview Experiences\\n\\nExperienced Interviews\\n\\nInternship Interviews\\n\\nCompetititve Programming\\n\\nDesign Patterns\\n\\nSystem Design Tutorial\\n\\nMultiple Choice Quizzes\\n\"\n },\n {\n \"code\": null,\n \"e\": 17806,\n \"s\": 17784,\n \"text\": \"\\nCompany Preparation\\n\"\n },\n {\n \"code\": null,\n \"e\": 17819,\n \"s\": 17806,\n \"text\": \"\\nTop Topics\\n\"\n },\n {\n \"code\": null,\n \"e\": 17848,\n \"s\": 17819,\n \"text\": \"\\nPractice Company Questions\\n\"\n },\n {\n \"code\": null,\n \"e\": 17872,\n \"s\": 17848,\n \"text\": \"\\nInterview Experiences\\n\"\n },\n {\n \"code\": null,\n \"e\": 17897,\n \"s\": 17872,\n \"text\": \"\\nExperienced Interviews\\n\"\n },\n {\n \"code\": null,\n \"e\": 17921,\n \"s\": 17897,\n \"text\": \"\\nInternship Interviews\\n\"\n },\n {\n \"code\": null,\n \"e\": 17948,\n \"s\": 17921,\n \"text\": \"\\nCompetititve Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 17966,\n \"s\": 17948,\n \"text\": \"\\nDesign Patterns\\n\"\n },\n {\n \"code\": null,\n \"e\": 17991,\n \"s\": 17966,\n \"text\": \"\\nSystem Design Tutorial\\n\"\n },\n {\n \"code\": null,\n \"e\": 18017,\n \"s\": 17991,\n \"text\": \"\\nMultiple Choice Quizzes\\n\"\n },\n {\n \"code\": null,\n \"e\": 18156,\n \"s\": 18017,\n \"text\": \"\\nLanguages\\n \\n\\n\\nC\\n\\nC++\\n\\nJava\\n\\nPython\\n\\nC#\\n\\nJavaScript\\n\\njQuery\\n\\nSQL\\n\\nPHP\\n\\nScala\\n\\nPerl\\n\\nGo Language\\n\\nHTML\\n\\nCSS\\n\\nKotlin\\n\"\n },\n {\n \"code\": null,\n \"e\": 18160,\n \"s\": 18156,\n \"text\": \"\\nC\\n\"\n },\n {\n \"code\": null,\n \"e\": 18166,\n \"s\": 18160,\n \"text\": \"\\nC++\\n\"\n },\n {\n \"code\": null,\n \"e\": 18173,\n \"s\": 18166,\n \"text\": \"\\nJava\\n\"\n },\n {\n \"code\": null,\n \"e\": 18182,\n \"s\": 18173,\n \"text\": \"\\nPython\\n\"\n },\n {\n \"code\": null,\n \"e\": 18187,\n \"s\": 18182,\n \"text\": \"\\nC#\\n\"\n },\n {\n \"code\": null,\n \"e\": 18200,\n \"s\": 18187,\n \"text\": \"\\nJavaScript\\n\"\n },\n {\n \"code\": null,\n \"e\": 18209,\n \"s\": 18200,\n \"text\": \"\\njQuery\\n\"\n },\n {\n \"code\": null,\n \"e\": 18215,\n \"s\": 18209,\n \"text\": \"\\nSQL\\n\"\n },\n {\n \"code\": null,\n \"e\": 18221,\n \"s\": 18215,\n \"text\": \"\\nPHP\\n\"\n },\n {\n \"code\": null,\n \"e\": 18229,\n \"s\": 18221,\n \"text\": \"\\nScala\\n\"\n },\n {\n \"code\": null,\n \"e\": 18236,\n \"s\": 18229,\n \"text\": \"\\nPerl\\n\"\n },\n {\n \"code\": null,\n \"e\": 18250,\n \"s\": 18236,\n \"text\": \"\\nGo Language\\n\"\n },\n {\n \"code\": null,\n \"e\": 18257,\n \"s\": 18250,\n \"text\": \"\\nHTML\\n\"\n },\n {\n \"code\": null,\n \"e\": 18263,\n \"s\": 18257,\n \"text\": \"\\nCSS\\n\"\n },\n {\n \"code\": null,\n \"e\": 18272,\n \"s\": 18263,\n \"text\": \"\\nKotlin\\n\"\n },\n {\n \"code\": null,\n \"e\": 18350,\n \"s\": 18272,\n \"text\": \"\\nML & Data Science\\n \\n\\n\\nMachine Learning\\n\\nData Science\\n\"\n },\n {\n \"code\": null,\n \"e\": 18369,\n \"s\": 18350,\n \"text\": \"\\nMachine Learning\\n\"\n },\n {\n \"code\": null,\n \"e\": 18384,\n \"s\": 18369,\n \"text\": \"\\nData Science\\n\"\n },\n {\n \"code\": null,\n \"e\": 18597,\n \"s\": 18384,\n \"text\": \"\\nCS Subjects\\n \\n\\n\\nMathematics\\n\\nOperating System\\n\\nDBMS\\n\\nComputer Networks\\n\\nComputer Organization and Architecture\\n\\nTheory of Computation\\n\\nCompiler Design\\n\\nDigital Logic\\n\\nSoftware Engineering\\n\"\n },\n {\n \"code\": null,\n \"e\": 18611,\n \"s\": 18597,\n \"text\": \"\\nMathematics\\n\"\n },\n {\n \"code\": null,\n \"e\": 18630,\n \"s\": 18611,\n \"text\": \"\\nOperating System\\n\"\n },\n {\n \"code\": null,\n \"e\": 18637,\n \"s\": 18630,\n \"text\": \"\\nDBMS\\n\"\n },\n {\n \"code\": null,\n \"e\": 18657,\n \"s\": 18637,\n \"text\": \"\\nComputer Networks\\n\"\n },\n {\n \"code\": null,\n \"e\": 18698,\n \"s\": 18657,\n \"text\": \"\\nComputer Organization and Architecture\\n\"\n },\n {\n \"code\": null,\n \"e\": 18722,\n \"s\": 18698,\n \"text\": \"\\nTheory of Computation\\n\"\n },\n {\n \"code\": null,\n \"e\": 18740,\n \"s\": 18722,\n \"text\": \"\\nCompiler Design\\n\"\n },\n {\n \"code\": null,\n \"e\": 18756,\n \"s\": 18740,\n \"text\": \"\\nDigital Logic\\n\"\n },\n {\n \"code\": null,\n \"e\": 18779,\n \"s\": 18756,\n \"text\": \"\\nSoftware Engineering\\n\"\n },\n {\n \"code\": null,\n \"e\": 18996,\n \"s\": 18779,\n \"text\": \"\\nGATE\\n \\n\\n\\nGATE Computer Science Notes\\n\\nLast Minute Notes\\n\\nGATE CS Solved Papers\\n\\nGATE CS Original Papers and Official Keys\\n\\nGATE 2021 Dates\\n\\nGATE CS 2021 Syllabus\\n\\nImportant Topics for GATE CS\\n\"\n },\n {\n \"code\": null,\n \"e\": 19026,\n \"s\": 18996,\n \"text\": \"\\nGATE Computer Science Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 19046,\n \"s\": 19026,\n \"text\": \"\\nLast Minute Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 19070,\n \"s\": 19046,\n \"text\": \"\\nGATE CS Solved Papers\\n\"\n },\n {\n \"code\": null,\n \"e\": 19114,\n \"s\": 19070,\n \"text\": \"\\nGATE CS Original Papers and Official Keys\\n\"\n },\n {\n \"code\": null,\n \"e\": 19132,\n \"s\": 19114,\n \"text\": \"\\nGATE 2021 Dates\\n\"\n },\n {\n \"code\": null,\n \"e\": 19156,\n \"s\": 19132,\n \"text\": \"\\nGATE CS 2021 Syllabus\\n\"\n },\n {\n \"code\": null,\n \"e\": 19187,\n \"s\": 19156,\n \"text\": \"\\nImportant Topics for GATE CS\\n\"\n },\n {\n \"code\": null,\n \"e\": 19307,\n \"s\": 19187,\n \"text\": \"\\nWeb Technologies\\n \\n\\n\\nHTML\\n\\nCSS\\n\\nJavaScript\\n\\nAngularJS\\n\\nReactJS\\n\\nNodeJS\\n\\nBootstrap\\n\\njQuery\\n\\nPHP\\n\"\n },\n {\n \"code\": null,\n \"e\": 19314,\n \"s\": 19307,\n \"text\": \"\\nHTML\\n\"\n },\n {\n \"code\": null,\n \"e\": 19320,\n \"s\": 19314,\n \"text\": \"\\nCSS\\n\"\n },\n {\n \"code\": null,\n \"e\": 19333,\n \"s\": 19320,\n \"text\": \"\\nJavaScript\\n\"\n },\n {\n \"code\": null,\n \"e\": 19345,\n \"s\": 19333,\n \"text\": \"\\nAngularJS\\n\"\n },\n {\n \"code\": null,\n \"e\": 19355,\n \"s\": 19345,\n \"text\": \"\\nReactJS\\n\"\n },\n {\n \"code\": null,\n \"e\": 19364,\n \"s\": 19355,\n \"text\": \"\\nNodeJS\\n\"\n },\n {\n \"code\": null,\n \"e\": 19376,\n \"s\": 19364,\n \"text\": \"\\nBootstrap\\n\"\n },\n {\n \"code\": null,\n \"e\": 19385,\n \"s\": 19376,\n \"text\": \"\\njQuery\\n\"\n },\n {\n \"code\": null,\n \"e\": 19391,\n \"s\": 19385,\n \"text\": \"\\nPHP\\n\"\n },\n {\n \"code\": null,\n \"e\": 19486,\n \"s\": 19391,\n \"text\": \"\\nSoftware Designs\\n \\n\\n\\nSoftware Design Patterns\\n\\nSystem Design Tutorial\\n\"\n },\n {\n \"code\": null,\n \"e\": 19513,\n \"s\": 19486,\n \"text\": \"\\nSoftware Design Patterns\\n\"\n },\n {\n \"code\": null,\n \"e\": 19538,\n \"s\": 19513,\n \"text\": \"\\nSystem Design Tutorial\\n\"\n },\n {\n \"code\": null,\n \"e\": 19602,\n \"s\": 19538,\n \"text\": \"\\nSchool Learning\\n \\n\\n\\nSchool Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 19623,\n \"s\": 19602,\n \"text\": \"\\nSchool Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 19759,\n \"s\": 19623,\n \"text\": \"\\nMathematics\\n \\n\\n\\nNumber System\\n\\nAlgebra\\n\\nTrigonometry\\n\\nStatistics\\n\\nProbability\\n\\nGeometry\\n\\nMensuration\\n\\nCalculus\\n\"\n },\n {\n \"code\": null,\n \"e\": 19775,\n \"s\": 19759,\n \"text\": \"\\nNumber System\\n\"\n },\n {\n \"code\": null,\n \"e\": 19785,\n \"s\": 19775,\n \"text\": \"\\nAlgebra\\n\"\n },\n {\n \"code\": null,\n \"e\": 19800,\n \"s\": 19785,\n \"text\": \"\\nTrigonometry\\n\"\n },\n {\n \"code\": null,\n \"e\": 19813,\n \"s\": 19800,\n \"text\": \"\\nStatistics\\n\"\n },\n {\n \"code\": null,\n \"e\": 19827,\n \"s\": 19813,\n \"text\": \"\\nProbability\\n\"\n },\n {\n \"code\": null,\n \"e\": 19838,\n \"s\": 19827,\n \"text\": \"\\nGeometry\\n\"\n },\n {\n \"code\": null,\n \"e\": 19852,\n \"s\": 19838,\n \"text\": \"\\nMensuration\\n\"\n },\n {\n \"code\": null,\n \"e\": 19863,\n \"s\": 19852,\n \"text\": \"\\nCalculus\\n\"\n },\n {\n \"code\": null,\n \"e\": 19994,\n \"s\": 19863,\n \"text\": \"\\nMaths Notes (Class 8-12)\\n \\n\\n\\nClass 8 Notes\\n\\nClass 9 Notes\\n\\nClass 10 Notes\\n\\nClass 11 Notes\\n\\nClass 12 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20010,\n \"s\": 19994,\n \"text\": \"\\nClass 8 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20026,\n \"s\": 20010,\n \"text\": \"\\nClass 9 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20043,\n \"s\": 20026,\n \"text\": \"\\nClass 10 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20060,\n \"s\": 20043,\n \"text\": \"\\nClass 11 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20077,\n \"s\": 20060,\n \"text\": \"\\nClass 12 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20244,\n \"s\": 20077,\n \"text\": \"\\nNCERT Solutions\\n \\n\\n\\nClass 8 Maths Solution\\n\\nClass 9 Maths Solution\\n\\nClass 10 Maths Solution\\n\\nClass 11 Maths Solution\\n\\nClass 12 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20269,\n \"s\": 20244,\n \"text\": \"\\nClass 8 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20294,\n \"s\": 20269,\n \"text\": \"\\nClass 9 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20320,\n \"s\": 20294,\n \"text\": \"\\nClass 10 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20346,\n \"s\": 20320,\n \"text\": \"\\nClass 11 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20372,\n \"s\": 20346,\n \"text\": \"\\nClass 12 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20543,\n \"s\": 20372,\n \"text\": \"\\nRD Sharma Solutions\\n \\n\\n\\nClass 8 Maths Solution\\n\\nClass 9 Maths Solution\\n\\nClass 10 Maths Solution\\n\\nClass 11 Maths Solution\\n\\nClass 12 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20568,\n \"s\": 20543,\n \"text\": \"\\nClass 8 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20593,\n \"s\": 20568,\n \"text\": \"\\nClass 9 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20619,\n \"s\": 20593,\n \"text\": \"\\nClass 10 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20645,\n \"s\": 20619,\n \"text\": \"\\nClass 11 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20671,\n \"s\": 20645,\n \"text\": \"\\nClass 12 Maths Solution\\n\"\n },\n {\n \"code\": null,\n \"e\": 20788,\n \"s\": 20671,\n \"text\": \"\\nPhysics Notes (Class 8-11)\\n \\n\\n\\nClass 8 Notes\\n\\nClass 9 Notes\\n\\nClass 10 Notes\\n\\nClass 11 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20804,\n \"s\": 20788,\n \"text\": \"\\nClass 8 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20820,\n \"s\": 20804,\n \"text\": \"\\nClass 9 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20837,\n \"s\": 20820,\n \"text\": \"\\nClass 10 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20854,\n \"s\": 20837,\n \"text\": \"\\nClass 11 Notes\\n\"\n },\n {\n \"code\": null,\n \"e\": 20896,\n \"s\": 20854,\n \"text\": \"\\nCS Exams/PSUs\\n \\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 21041,\n \"s\": 20896,\n \"text\": \"\\nISRO\\n \\n\\n\\nISRO CS Original Papers and Official Keys\\n\\nISRO CS Solved Papers\\n\\nISRO CS Syllabus for Scientist/Engineer Exam\\n\"\n },\n {\n \"code\": null,\n \"e\": 21085,\n \"s\": 21041,\n \"text\": \"\\nISRO CS Original Papers and Official Keys\\n\"\n },\n {\n \"code\": null,\n \"e\": 21109,\n \"s\": 21085,\n \"text\": \"\\nISRO CS Solved Papers\\n\"\n },\n {\n \"code\": null,\n \"e\": 21156,\n \"s\": 21109,\n \"text\": \"\\nISRO CS Syllabus for Scientist/Engineer Exam\\n\"\n },\n {\n \"code\": null,\n \"e\": 21273,\n \"s\": 21156,\n \"text\": \"\\nUGC NET\\n \\n\\n\\nUGC NET CS Notes Paper II\\n\\nUGC NET CS Notes Paper III\\n\\nUGC NET CS Solved Papers\\n\"\n },\n {\n \"code\": null,\n \"e\": 21301,\n \"s\": 21273,\n \"text\": \"\\nUGC NET CS Notes Paper II\\n\"\n },\n {\n \"code\": null,\n \"e\": 21330,\n \"s\": 21301,\n \"text\": \"\\nUGC NET CS Notes Paper III\\n\"\n },\n {\n \"code\": null,\n \"e\": 21357,\n \"s\": 21330,\n \"text\": \"\\nUGC NET CS Solved Papers\\n\"\n },\n {\n \"code\": null,\n \"e\": 21597,\n \"s\": 21357,\n \"text\": \"\\nStudent\\n \\n\\n\\nCampus Ambassador Program\\n\\nSchool Ambassador Program\\n\\nProject\\n\\nGeek of the Month\\n\\nCampus Geek of the Month\\n\\nPlacement Course\\n\\nCompetititve Programming\\n\\nTestimonials\\n\\nGeek on the Top\\n\\nCareers\\n\\nInternship\\n\"\n },\n {\n \"code\": null,\n \"e\": 21625,\n \"s\": 21597,\n \"text\": \"\\nCampus Ambassador Program\\n\"\n },\n {\n \"code\": null,\n \"e\": 21653,\n \"s\": 21625,\n \"text\": \"\\nSchool Ambassador Program\\n\"\n },\n {\n \"code\": null,\n \"e\": 21663,\n \"s\": 21653,\n \"text\": \"\\nProject\\n\"\n },\n {\n \"code\": null,\n \"e\": 21683,\n \"s\": 21663,\n \"text\": \"\\nGeek of the Month\\n\"\n },\n {\n \"code\": null,\n \"e\": 21710,\n \"s\": 21683,\n \"text\": \"\\nCampus Geek of the Month\\n\"\n },\n {\n \"code\": null,\n \"e\": 21729,\n \"s\": 21710,\n \"text\": \"\\nPlacement Course\\n\"\n },\n {\n \"code\": null,\n \"e\": 21756,\n \"s\": 21729,\n \"text\": \"\\nCompetititve Programming\\n\"\n },\n {\n \"code\": null,\n \"e\": 21771,\n \"s\": 21756,\n \"text\": \"\\nTestimonials\\n\"\n },\n {\n \"code\": null,\n \"e\": 21789,\n \"s\": 21771,\n \"text\": \"\\nGeek on the Top\\n\"\n },\n {\n \"code\": null,\n \"e\": 21799,\n \"s\": 21789,\n \"text\": \"\\nCareers\\n\"\n },\n {\n \"code\": null,\n \"e\": 21812,\n \"s\": 21799,\n \"text\": \"\\nInternship\\n\"\n },\n {\n \"code\": null,\n \"e\": 21850,\n \"s\": 21812,\n \"text\": \"\\nTutorials\\n \\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 21923,\n \"s\": 21850,\n \"text\": \"\\nJobs\\n \\n\\n\\nApply for Jobs\\n\\nPost a Job\\n\\nJOB-A-THON\\n\"\n },\n {\n \"code\": null,\n \"e\": 21940,\n \"s\": 21923,\n \"text\": \"\\nApply for Jobs\\n\"\n },\n {\n \"code\": null,\n \"e\": 21953,\n \"s\": 21940,\n \"text\": \"\\nPost a Job\\n\"\n },\n {\n \"code\": null,\n \"e\": 21966,\n \"s\": 21953,\n \"text\": \"\\nJOB-A-THON\\n\"\n },\n {\n \"code\": null,\n \"e\": 21972,\n \"s\": 21966,\n \"text\": \"GBlog\"\n },\n {\n \"code\": null,\n \"e\": 21980,\n \"s\": 21972,\n \"text\": \"Puzzles\"\n },\n {\n \"code\": null,\n \"e\": 21993,\n \"s\": 21980,\n \"text\": \"What's New ?\"\n },\n {\n \"code\": null,\n \"e\": 21999,\n \"s\": 21993,\n \"text\": \"Array\"\n },\n {\n \"code\": null,\n \"e\": 22006,\n \"s\": 21999,\n \"text\": \"Matrix\"\n },\n {\n \"code\": null,\n \"e\": 22014,\n \"s\": 22006,\n \"text\": \"Strings\"\n },\n {\n \"code\": null,\n \"e\": 22022,\n \"s\": 22014,\n \"text\": \"Hashing\"\n },\n {\n \"code\": null,\n \"e\": 22034,\n \"s\": 22022,\n \"text\": \"Linked List\"\n },\n {\n \"code\": null,\n \"e\": 22040,\n \"s\": 22034,\n \"text\": \"Stack\"\n },\n {\n \"code\": null,\n \"e\": 22046,\n \"s\": 22040,\n \"text\": \"Queue\"\n },\n {\n \"code\": null,\n \"e\": 22058,\n \"s\": 22046,\n \"text\": \"Binary Tree\"\n },\n {\n \"code\": null,\n \"e\": 22077,\n \"s\": 22058,\n \"text\": \"Binary Search Tree\"\n },\n {\n \"code\": null,\n \"e\": 22082,\n \"s\": 22077,\n \"text\": \"Heap\"\n },\n {\n \"code\": null,\n \"e\": 22088,\n \"s\": 22082,\n \"text\": \"Graph\"\n },\n {\n \"code\": null,\n \"e\": 22098,\n \"s\": 22088,\n \"text\": \"Searching\"\n },\n {\n \"code\": null,\n \"e\": 22106,\n \"s\": 22098,\n \"text\": \"Sorting\"\n },\n {\n \"code\": null,\n \"e\": 22123,\n \"s\": 22106,\n \"text\": \"Divide & Conquer\"\n },\n {\n \"code\": null,\n \"e\": 22136,\n \"s\": 22123,\n \"text\": \"Mathematical\"\n },\n {\n \"code\": null,\n \"e\": 22146,\n \"s\": 22136,\n \"text\": \"Geometric\"\n },\n {\n \"code\": null,\n \"e\": 22154,\n \"s\": 22146,\n \"text\": \"Bitwise\"\n },\n {\n \"code\": null,\n \"e\": 22161,\n \"s\": 22154,\n \"text\": \"Greedy\"\n },\n {\n \"code\": null,\n \"e\": 22174,\n \"s\": 22161,\n \"text\": \"Backtracking\"\n },\n {\n \"code\": null,\n \"e\": 22191,\n \"s\": 22174,\n \"text\": \"Branch and Bound\"\n },\n {\n \"code\": null,\n \"e\": 22211,\n \"s\": 22191,\n \"text\": \"Dynamic Programming\"\n },\n {\n \"code\": null,\n \"e\": 22229,\n \"s\": 22211,\n \"text\": \"Pattern Searching\"\n },\n {\n \"code\": null,\n \"e\": 22240,\n \"s\": 22229,\n \"text\": \"Randomized\"\n },\n {\n \"code\": null,\n \"e\": 22282,\n \"s\": 22240,\n \"text\": \"Sort an array which contain 1 to n values\"\n },\n {\n \"code\": null,\n \"e\": 22324,\n \"s\": 22282,\n \"text\": \"Sort 1 to N by swapping adjacent elements\"\n },\n {\n \"code\": null,\n \"e\": 22371,\n \"s\": 22324,\n \"text\": \"Sort an array containing two types of elements\"\n },\n {\n \"code\": null,\n \"e\": 22406,\n \"s\": 22371,\n \"text\": \"Sort elements by frequency | Set 1\"\n },\n {\n \"code\": null,\n \"e\": 22441,\n \"s\": 22406,\n \"text\": \"Sort elements by frequency | Set 2\"\n },\n {\n \"code\": null,\n \"e\": 22508,\n \"s\": 22441,\n \"text\": \"Sort elements by frequency | Set 4 (Efficient approach using hash)\"\n },\n {\n \"code\": null,\n \"e\": 22564,\n \"s\": 22508,\n \"text\": \"Sorting Array Elements By Frequency | Set 3 (Using STL)\"\n },\n {\n \"code\": null,\n \"e\": 22616,\n \"s\": 22564,\n \"text\": \"Sort elements by frequency | Set 5 (using Java Map)\"\n },\n {\n \"code\": null,\n \"e\": 22654,\n \"s\": 22616,\n \"text\": \"Sorting a Hashmap according to values\"\n },\n {\n \"code\": null,\n \"e\": 22698,\n \"s\": 22654,\n \"text\": \"Sorting a HashMap according to keys in Java\"\n },\n {\n \"code\": null,\n \"e\": 22714,\n \"s\": 22698,\n \"text\": \"TreeMap in Java\"\n },\n {\n \"code\": null,\n \"e\": 22730,\n \"s\": 22714,\n \"text\": \"TreeSet in Java\"\n },\n {\n \"code\": null,\n \"e\": 22746,\n \"s\": 22730,\n \"text\": \"HashSet in Java\"\n },\n {\n \"code\": null,\n \"e\": 22776,\n \"s\": 22746,\n \"text\": \"HashMap in Java with Examples\"\n },\n {\n \"code\": null,\n \"e\": 22812,\n \"s\": 22776,\n \"text\": \"Internal Working of HashMap in Java\"\n },\n {\n \"code\": null,\n \"e\": 22852,\n \"s\": 22812,\n \"text\": \"Internal working of Set/HashSet in Java\"\n },\n {\n \"code\": null,\n \"e\": 22875,\n \"s\": 22852,\n \"text\": \"Merge Two Sets in Java\"\n },\n {\n \"code\": null,\n \"e\": 22887,\n \"s\": 22875,\n \"text\": \"Set in Java\"\n },\n {\n \"code\": null,\n \"e\": 22909,\n \"s\": 22887,\n \"text\": \"Map Interface in Java\"\n },\n {\n \"code\": null,\n \"e\": 22940,\n \"s\": 22909,\n \"text\": \"How to iterate any Map in Java\"\n },\n {\n \"code\": null,\n \"e\": 22955,\n \"s\": 22940,\n \"text\": \"Arrays in Java\"\n },\n {\n \"code\": null,\n \"e\": 23001,\n \"s\": 22955,\n \"text\": \"Write a program to reverse an array or string\"\n },\n {\n \"code\": null,\n \"e\": 23033,\n \"s\": 23001,\n \"text\": \"Largest Sum Contiguous Subarray\"\n },\n {\n \"code\": null,\n \"e\": 23060,\n \"s\": 23033,\n \"text\": \"Program for array rotation\"\n },\n {\n \"code\": null,\n \"e\": 23076,\n \"s\": 23060,\n \"text\": \"Arrays in C/C++\"\n },\n {\n \"code\": null,\n \"e\": 23124,\n \"s\": 23076,\n \"text\": \"Stack Data Structure (Introduction and Program)\"\n },\n {\n \"code\": null,\n \"e\": 23168,\n \"s\": 23124,\n \"text\": \"Top 50 Array Coding Problems for Interviews\"\n },\n {\n \"code\": null,\n \"e\": 23182,\n \"s\": 23168,\n \"text\": \"Linear Search\"\n },\n {\n \"code\": null,\n \"e\": 23267,\n \"s\": 23182,\n \"text\": \"Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)\"\n },\n {\n \"code\": null,\n \"e\": 23335,\n \"s\": 23267,\n \"text\": \"Maximum and minimum of an array using minimum number of comparisons\"\n },\n {\n \"code\": null,\n \"e\": 23377,\n \"s\": 23335,\n \"text\": \"Sort an array which contain 1 to n values\"\n },\n {\n \"code\": null,\n \"e\": 23419,\n \"s\": 23377,\n \"text\": \"Sort 1 to N by swapping adjacent elements\"\n },\n {\n \"code\": null,\n \"e\": 23466,\n \"s\": 23419,\n \"text\": \"Sort an array containing two types of elements\"\n },\n {\n \"code\": null,\n \"e\": 23501,\n \"s\": 23466,\n \"text\": \"Sort elements by frequency | Set 1\"\n },\n {\n \"code\": null,\n \"e\": 23536,\n \"s\": 23501,\n \"text\": \"Sort elements by frequency | Set 2\"\n },\n {\n \"code\": null,\n \"e\": 23603,\n \"s\": 23536,\n \"text\": \"Sort elements by frequency | Set 4 (Efficient approach using hash)\"\n },\n {\n \"code\": null,\n \"e\": 23659,\n \"s\": 23603,\n \"text\": \"Sorting Array Elements By Frequency | Set 3 (Using STL)\"\n },\n {\n \"code\": null,\n \"e\": 23711,\n \"s\": 23659,\n \"text\": \"Sort elements by frequency | Set 5 (using Java Map)\"\n },\n {\n \"code\": null,\n \"e\": 23749,\n \"s\": 23711,\n \"text\": \"Sorting a Hashmap according to values\"\n },\n {\n \"code\": null,\n \"e\": 23793,\n \"s\": 23749,\n \"text\": \"Sorting a HashMap according to keys in Java\"\n },\n {\n \"code\": null,\n \"e\": 23809,\n \"s\": 23793,\n \"text\": \"TreeMap in Java\"\n },\n {\n \"code\": null,\n \"e\": 23825,\n \"s\": 23809,\n \"text\": \"TreeSet in Java\"\n },\n {\n \"code\": null,\n \"e\": 23841,\n \"s\": 23825,\n \"text\": \"HashSet in Java\"\n },\n {\n \"code\": null,\n \"e\": 23871,\n \"s\": 23841,\n \"text\": \"HashMap in Java with Examples\"\n },\n {\n \"code\": null,\n \"e\": 23907,\n \"s\": 23871,\n \"text\": \"Internal Working of HashMap in Java\"\n },\n {\n \"code\": null,\n \"e\": 23947,\n \"s\": 23907,\n \"text\": \"Internal working of Set/HashSet in Java\"\n },\n {\n \"code\": null,\n \"e\": 23970,\n \"s\": 23947,\n \"text\": \"Merge Two Sets in Java\"\n },\n {\n \"code\": null,\n \"e\": 23982,\n \"s\": 23970,\n \"text\": \"Set in Java\"\n },\n {\n \"code\": null,\n \"e\": 24004,\n \"s\": 23982,\n \"text\": \"Map Interface in Java\"\n },\n {\n \"code\": null,\n \"e\": 24035,\n \"s\": 24004,\n \"text\": \"How to iterate any Map in Java\"\n },\n {\n \"code\": null,\n \"e\": 24050,\n \"s\": 24035,\n \"text\": \"Arrays in Java\"\n },\n {\n \"code\": null,\n \"e\": 24096,\n \"s\": 24050,\n \"text\": \"Write a program to reverse an array or string\"\n },\n {\n \"code\": null,\n \"e\": 24128,\n \"s\": 24096,\n \"text\": \"Largest Sum Contiguous Subarray\"\n },\n {\n \"code\": null,\n \"e\": 24155,\n \"s\": 24128,\n \"text\": \"Program for array rotation\"\n },\n {\n \"code\": null,\n \"e\": 24171,\n \"s\": 24155,\n \"text\": \"Arrays in C/C++\"\n },\n {\n \"code\": null,\n \"e\": 24219,\n \"s\": 24171,\n \"text\": \"Stack Data Structure (Introduction and Program)\"\n },\n {\n \"code\": null,\n \"e\": 24263,\n \"s\": 24219,\n \"text\": \"Top 50 Array Coding Problems for Interviews\"\n },\n {\n \"code\": null,\n \"e\": 24277,\n \"s\": 24263,\n \"text\": \"Linear Search\"\n },\n {\n \"code\": null,\n \"e\": 24362,\n \"s\": 24277,\n \"text\": \"Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)\"\n },\n {\n \"code\": null,\n \"e\": 24430,\n \"s\": 24362,\n \"text\": \"Maximum and minimum of an array using minimum number of comparisons\"\n },\n {\n \"code\": null,\n \"e\": 24454,\n \"s\": 24430,\n \"text\": \"Difficulty Level :\\nEasy\"\n },\n {\n \"code\": null,\n \"e\": 24613,\n \"s\": 24454,\n \"text\": \"You have given an array which contain 1 to n element, your task is to sort this array in an efficient way and without replace with 1 to n numbers.Examples : \"\n },\n {\n \"code\": null,\n \"e\": 24710,\n \"s\": 24613,\n \"text\": \"Input : arr[] = {10, 7, 9, 2, 8, \\n 3, 5, 4, 6, 1};\\nOutput : 1 2 3 4 5 6 7 8 9 10\"\n },\n {\n \"code\": null,\n \"e\": 24998,\n \"s\": 24712,\n \"text\": \"Native approach : Sort this array with the use of any type of sorting method. it takes O(nlogn) minimum time.Efficient approach : Replace every element with it’s position. it takes O(n) efficient time and give you the sorted array. Let’s understand this approach with the code below. \"\n },\n {\n \"code\": null,\n \"e\": 25002,\n \"s\": 24998,\n \"text\": \"C++\"\n },\n {\n \"code\": null,\n \"e\": 25007,\n \"s\": 25002,\n \"text\": \"Java\"\n },\n {\n \"code\": null,\n \"e\": 25015,\n \"s\": 25007,\n \"text\": \"Python3\"\n },\n {\n \"code\": null,\n \"e\": 25018,\n \"s\": 25015,\n \"text\": \"C#\"\n },\n {\n \"code\": null,\n \"e\": 25022,\n \"s\": 25018,\n \"text\": \"PHP\"\n },\n {\n \"code\": null,\n \"e\": 25033,\n \"s\": 25022,\n \"text\": \"Javascript\"\n },\n {\n \"code\": \"// Efficient C++ program to sort an array of// numbers in range from 1 to n.#include using namespace std; // function for sort arrayvoid sortit(int arr[], int n){ for (int i = 0; i < n; i++) { arr[i]=i+1; }} // Driver codeint main(){ int arr[] = { 10, 7, 9, 2, 8, 3, 5, 4, 6, 1 }; int n = sizeof(arr) / sizeof(arr[0]); // for sort an array sortit(arr, n); // for print all the element in sorted way for (int i = 0; i < n; i++) cout << arr[i] << \\\" \\\"; }\",\n \"e\": 25541,\n \"s\": 25033,\n \"text\": null\n },\n {\n \"code\": \"// Efficient Java program to sort an// array of numbers in range from 1// to n.import java.io.*;import java.util.*; public class GFG { // function for sort array static void sortit(int []arr, int n) { for (int i = 0; i < n; i++) { arr[i]=i+1; } } // Driver code public static void main(String args[]) { int []arr = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1}; int n = arr.length; // for sort an array sortit(arr, n); // for print all the // element in sorted way for (int i = 0; i < n; i++) System.out.print(arr[i] + \\\" \\\"); }} // This code is contributed by Manish Shaw// (manishshaw1)\",\n \"e\": 26304,\n \"s\": 25541,\n \"text\": null\n },\n {\n \"code\": \"# Python3 program to sort an array of# numbers in range from 1 to n. # function for sort arraydef sortit(arr,n): for i in range(n): arr[i] = i+1 # Driver codeif __name__=='__main__': arr = [10, 7, 9, 2, 8, 3, 5, 4, 6, 1 ] n = len(arr) # for sort an array sortit(arr,n) # for print all the element # in sorted way for i in range(n): print(arr[i],end=\\\" \\\") # This code is contributed by# Shrikant13\",\n \"e\": 26741,\n \"s\": 26304,\n \"text\": null\n },\n {\n \"code\": \"// Efficient C# program to sort an array of// numbers in range from 1 to n.using System;using System.Collections.Generic; class GFG { // function for sort array static void sortit(int []arr, int n) { for (int i = 0; i < n; i++) { arr[i]=i+1; } } // Driver code public static void Main() { int []arr = {10, 7, 9, 2, 8, 3, 5, 4, 6, 1}; int n = arr.Length; // for sort an array sortit(arr, n); // for print all the // element in sorted way for (int i = 0; i < n; i++) Console.Write(arr[i] + \\\" \\\"); }} // This code is contributed by// Manish Shaw (manishshaw1)\",\n \"e\": 27468,\n \"s\": 26741,\n \"text\": null\n },\n {\n \"code\": \"\",\n \"e\": 27950,\n \"s\": 27468,\n \"text\": null\n },\n {\n \"code\": \"\",\n \"e\": 28454,\n \"s\": 27950,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 28475,\n \"s\": 28454,\n \"text\": \"1 2 3 4 5 6 7 8 9 10\"\n },\n {\n \"code\": null,\n \"e\": 28499,\n \"s\": 28477,\n \"text\": \"Time Complexity: O(n)\"\n },\n {\n \"code\": null,\n \"e\": 28522,\n \"s\": 28499,\n \"text\": \"Space Complexity: O(1)\"\n },\n {\n \"code\": null,\n \"e\": 28534,\n \"s\": 28522,\n \"text\": \"manishshaw1\"\n },\n {\n \"code\": null,\n \"e\": 28549,\n \"s\": 28534,\n \"text\": \"_Keep_Silence_\"\n },\n {\n \"code\": null,\n \"e\": 28561,\n \"s\": 28549,\n \"text\": \"shrikanth13\"\n },\n {\n \"code\": null,\n \"e\": 28575,\n \"s\": 28561,\n \"text\": \"surbhityagi15\"\n },\n {\n \"code\": null,\n \"e\": 28588,\n \"s\": 28575,\n \"text\": \"prasanna1995\"\n },\n {\n \"code\": null,\n \"e\": 28611,\n \"s\": 28588,\n \"text\": \"limited-range-elements\"\n },\n {\n \"code\": null,\n \"e\": 28618,\n \"s\": 28611,\n \"text\": \"Arrays\"\n },\n {\n \"code\": null,\n \"e\": 28626,\n \"s\": 28618,\n \"text\": \"Sorting\"\n },\n {\n \"code\": null,\n \"e\": 28633,\n \"s\": 28626,\n \"text\": \"Arrays\"\n },\n {\n \"code\": null,\n \"e\": 28641,\n \"s\": 28633,\n \"text\": \"Sorting\"\n },\n {\n \"code\": null,\n \"e\": 28739,\n \"s\": 28641,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 28748,\n \"s\": 28739,\n \"text\": \"Comments\"\n },\n {\n \"code\": null,\n \"e\": 28761,\n \"s\": 28748,\n \"text\": \"Old Comments\"\n },\n {\n \"code\": null,\n \"e\": 28784,\n \"s\": 28761,\n \"text\": \"Introduction to Arrays\"\n },\n {\n \"code\": null,\n \"e\": 28816,\n \"s\": 28784,\n \"text\": \"Multidimensional Arrays in Java\"\n },\n {\n \"code\": null,\n \"e\": 28837,\n \"s\": 28816,\n \"text\": \"Linked List vs Array\"\n },\n {\n \"code\": null,\n \"e\": 28891,\n \"s\": 28837,\n \"text\": \"Queue | Set 1 (Introduction and Array Implementation)\"\n }\n]"}}},{"rowIdx":76513,"cells":{"title":{"kind":"string","value":"Java String codePointBefore() Method"},"text":{"kind":"string","value":"❮ String Methods\n\nReturn the Unicode of the first character in a string (the Unicode value \n of \"H\" is 72):\nString myStr = \"Hello\";\nint result = myStr.codePointBefore(1);\nSystem.out.println(result);\n\nTry it Yourself »\n\nThe codePointBefore() method returns the Unicode \nvalue of the character before the specified index in a string.\nThe index of the first character is 1, the second character is 2, and so on.\nNote: The value 0 will generate an error, as this is a negative number (out \nof reach).\npublic int codePointBefore(int index)\n\nWe just launchedW3Schools videos\nGet certifiedby completinga course today!\nIf you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:\nhelp@w3schools.com\nYour message has been sent to W3Schools."},"parsed":{"kind":"list like","value":[{"code":null,"e":19,"s":0,"text":"\n❮ String Methods\n"},{"code":null,"e":110,"s":19,"text":"Return the Unicode of the first character in a string (the Unicode value \n of \"H\" is 72):"},{"code":null,"e":201,"s":110,"text":"String myStr = \"Hello\";\nint result = myStr.codePointBefore(1);\nSystem.out.println(result);"},{"code":null,"e":221,"s":201,"text":"\nTry it Yourself »\n"},{"code":null,"e":334,"s":221,"text":"The codePointBefore() method returns the Unicode \nvalue of the character before the specified index in a string."},{"code":null,"e":411,"s":334,"text":"The index of the first character is 1, the second character is 2, and so on."},{"code":null,"e":499,"s":411,"text":"Note: The value 0 will generate an error, as this is a negative number (out \nof reach)."},{"code":null,"e":538,"s":499,"text":"public int codePointBefore(int index)\n"},{"code":null,"e":571,"s":538,"text":"We just launchedW3Schools videos"},{"code":null,"e":613,"s":571,"text":"Get certifiedby completinga course today!"},{"code":null,"e":720,"s":613,"text":"If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:"},{"code":null,"e":739,"s":720,"text":"help@w3schools.com"}],"string":"[\n {\n \"code\": null,\n \"e\": 19,\n \"s\": 0,\n \"text\": \"\\n❮ String Methods\\n\"\n },\n {\n \"code\": null,\n \"e\": 110,\n \"s\": 19,\n \"text\": \"Return the Unicode of the first character in a string (the Unicode value \\n of \\\"H\\\" is 72):\"\n },\n {\n \"code\": null,\n \"e\": 201,\n \"s\": 110,\n \"text\": \"String myStr = \\\"Hello\\\";\\nint result = myStr.codePointBefore(1);\\nSystem.out.println(result);\"\n },\n {\n \"code\": null,\n \"e\": 221,\n \"s\": 201,\n \"text\": \"\\nTry it Yourself »\\n\"\n },\n {\n \"code\": null,\n \"e\": 334,\n \"s\": 221,\n \"text\": \"The codePointBefore() method returns the Unicode \\nvalue of the character before the specified index in a string.\"\n },\n {\n \"code\": null,\n \"e\": 411,\n \"s\": 334,\n \"text\": \"The index of the first character is 1, the second character is 2, and so on.\"\n },\n {\n \"code\": null,\n \"e\": 499,\n \"s\": 411,\n \"text\": \"Note: The value 0 will generate an error, as this is a negative number (out \\nof reach).\"\n },\n {\n \"code\": null,\n \"e\": 538,\n \"s\": 499,\n \"text\": \"public int codePointBefore(int index)\\n\"\n },\n {\n \"code\": null,\n \"e\": 571,\n \"s\": 538,\n \"text\": \"We just launchedW3Schools videos\"\n },\n {\n \"code\": null,\n \"e\": 613,\n \"s\": 571,\n \"text\": \"Get certifiedby completinga course today!\"\n },\n {\n \"code\": null,\n \"e\": 720,\n \"s\": 613,\n \"text\": \"If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:\"\n },\n {\n \"code\": null,\n \"e\": 739,\n \"s\": 720,\n \"text\": \"help@w3schools.com\"\n }\n]"}}},{"rowIdx":76514,"cells":{"title":{"kind":"string","value":"JSTL - fn:replace() Function"},"text":{"kind":"string","value":"The fn:replace() function replaces all occurrences of a string with another string.\nThe fn:replace () function has the following syntax −\nboolean replace(java.lang.String, java.lang.String, java.lang.String)\n\nFollowing is the example to explain the functionality of the fn:replace() function −\n<%@ taglib uri = \"http://java.sun.com/jsp/jstl/core\" prefix = \"c\" %>\n<%@ taglib uri = \"http://java.sun.com/jsp/jstl/functions\" prefix = \"fn\" %>\n\n\n \n Using JSTL Functions\n \n\n \n \n \n

Final String : ${string2}

\n \n\nYou will receive the following result −\nFinal String : This is second String.\n\n\n 108 Lectures \n 11 hours \n\n Chaand Sheikh\n\n 517 Lectures \n 57 hours \n\n Chaand Sheikh\n\n 41 Lectures \n 4.5 hours \n\n Karthikeya T\n\n 42 Lectures \n 5.5 hours \n\n TELCOMA Global\n\n 15 Lectures \n 3 hours \n\n TELCOMA Global\n\n 44 Lectures \n 15 hours \n\n Uplatz\n Print\n Add Notes\n Bookmark this page"},"parsed":{"kind":"list like","value":[{"code":null,"e":2323,"s":2239,"text":"The fn:replace() function replaces all occurrences of a string with another string."},{"code":null,"e":2377,"s":2323,"text":"The fn:replace () function has the following syntax −"},{"code":null,"e":2448,"s":2377,"text":"boolean replace(java.lang.String, java.lang.String, java.lang.String)\n"},{"code":null,"e":2533,"s":2448,"text":"Following is the example to explain the functionality of the fn:replace() function −"},{"code":null,"e":2964,"s":2533,"text":"<%@ taglib uri = \"http://java.sun.com/jsp/jstl/core\" prefix = \"c\" %>\n<%@ taglib uri = \"http://java.sun.com/jsp/jstl/functions\" prefix = \"fn\" %>\n\n\n \n Using JSTL Functions\n \n\n \n \n \n

Final String : ${string2}

\n \n"},{"code":null,"e":3004,"s":2964,"text":"You will receive the following result −"},{"code":null,"e":3043,"s":3004,"text":"Final String : This is second String.\n"},{"code":null,"e":3078,"s":3043,"text":"\n 108 Lectures \n 11 hours \n"},{"code":null,"e":3093,"s":3078,"text":" Chaand Sheikh"},{"code":null,"e":3128,"s":3093,"text":"\n 517 Lectures \n 57 hours \n"},{"code":null,"e":3143,"s":3128,"text":" Chaand Sheikh"},{"code":null,"e":3178,"s":3143,"text":"\n 41 Lectures \n 4.5 hours \n"},{"code":null,"e":3192,"s":3178,"text":" Karthikeya T"},{"code":null,"e":3227,"s":3192,"text":"\n 42 Lectures \n 5.5 hours \n"},{"code":null,"e":3243,"s":3227,"text":" TELCOMA Global"},{"code":null,"e":3276,"s":3243,"text":"\n 15 Lectures \n 3 hours \n"},{"code":null,"e":3292,"s":3276,"text":" TELCOMA Global"},{"code":null,"e":3326,"s":3292,"text":"\n 44 Lectures \n 15 hours \n"},{"code":null,"e":3334,"s":3326,"text":" Uplatz"},{"code":null,"e":3341,"s":3334,"text":" Print"},{"code":null,"e":3352,"s":3341,"text":" Add Notes"}],"string":"[\n {\n \"code\": null,\n \"e\": 2323,\n \"s\": 2239,\n \"text\": \"The fn:replace() function replaces all occurrences of a string with another string.\"\n },\n {\n \"code\": null,\n \"e\": 2377,\n \"s\": 2323,\n \"text\": \"The fn:replace () function has the following syntax −\"\n },\n {\n \"code\": null,\n \"e\": 2448,\n \"s\": 2377,\n \"text\": \"boolean replace(java.lang.String, java.lang.String, java.lang.String)\\n\"\n },\n {\n \"code\": null,\n \"e\": 2533,\n \"s\": 2448,\n \"text\": \"Following is the example to explain the functionality of the fn:replace() function −\"\n },\n {\n \"code\": null,\n \"e\": 2964,\n \"s\": 2533,\n \"text\": \"<%@ taglib uri = \\\"http://java.sun.com/jsp/jstl/core\\\" prefix = \\\"c\\\" %>\\n<%@ taglib uri = \\\"http://java.sun.com/jsp/jstl/functions\\\" prefix = \\\"fn\\\" %>\\n\\n\\n \\n Using JSTL Functions\\n \\n\\n \\n \\n \\n

Final String : ${string2}

\\n \\n\"\n },\n {\n \"code\": null,\n \"e\": 3004,\n \"s\": 2964,\n \"text\": \"You will receive the following result −\"\n },\n {\n \"code\": null,\n \"e\": 3043,\n \"s\": 3004,\n \"text\": \"Final String : This is second String.\\n\"\n },\n {\n \"code\": null,\n \"e\": 3078,\n \"s\": 3043,\n \"text\": \"\\n 108 Lectures \\n 11 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3093,\n \"s\": 3078,\n \"text\": \" Chaand Sheikh\"\n },\n {\n \"code\": null,\n \"e\": 3128,\n \"s\": 3093,\n \"text\": \"\\n 517 Lectures \\n 57 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3143,\n \"s\": 3128,\n \"text\": \" Chaand Sheikh\"\n },\n {\n \"code\": null,\n \"e\": 3178,\n \"s\": 3143,\n \"text\": \"\\n 41 Lectures \\n 4.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3192,\n \"s\": 3178,\n \"text\": \" Karthikeya T\"\n },\n {\n \"code\": null,\n \"e\": 3227,\n \"s\": 3192,\n \"text\": \"\\n 42 Lectures \\n 5.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3243,\n \"s\": 3227,\n \"text\": \" TELCOMA Global\"\n },\n {\n \"code\": null,\n \"e\": 3276,\n \"s\": 3243,\n \"text\": \"\\n 15 Lectures \\n 3 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3292,\n \"s\": 3276,\n \"text\": \" TELCOMA Global\"\n },\n {\n \"code\": null,\n \"e\": 3326,\n \"s\": 3292,\n \"text\": \"\\n 44 Lectures \\n 15 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3334,\n \"s\": 3326,\n \"text\": \" Uplatz\"\n },\n {\n \"code\": null,\n \"e\": 3341,\n \"s\": 3334,\n \"text\": \" Print\"\n },\n {\n \"code\": null,\n \"e\": 3352,\n \"s\": 3341,\n \"text\": \" Add Notes\"\n }\n]"}}},{"rowIdx":76515,"cells":{"title":{"kind":"string","value":"Notify with Python. Make life easier with Python built... | by James Briggs | Towards Data Science"},"text":{"kind":"string","value":"Working in Python, I often run data processing, transfer, and model training scripts. Now, with any reasonable degree of complexity and/or big data, this can take some time.\nAlthough often enough we all have some other work to be done whilst waiting for these processing to complete, occasionally, we don’t.\nFor this purpose, I put together a set of Python scripts built for this exact problem. I use these scripts to send process updates, visualizations and completion notifications to my phone.\nSo, when we do occasionally have those moments of freedom. We can enjoy them without being worried about model progress.\nOkay so the first thing we need to ask is — what do we need to know?\nNow of-course, this really depends on the work you are doing. For me I have three main processing tasks that have the potential to take up time:\nModel training\nData processing and/or transfer\nFinancial modelling\nFor each of these, there are of-course different pieces of information that we need to stay informed about. Let’s take a look at an example of each.\nUpdate every n epochs, must include key metrics. For example, loss and accuracy for training and validation sets.\nNotification of completion (of-course). For this I like to include:\nprediction outputs, for text generation, the generated text (or a sample of it) — for image generation, a (hopefully) cool visualization.\nvisualization of key metrics during training (again, loss and accuracy for both training and validation sets)\nother, less essential but still useful information such as local model directories, training time, model architecture etc\nLet’s take the example of training a neural network to reproduce a given artistic style.\nFor this, we want to see; generated images from the model, loss and accuracy plots, and current training time, and a model name.\nIn this scenario, every 100 epochs, an email containing all of the above will be sent. Here is one of those emails:\nThis one is slightly less glamorous, but in terms of time consumed, is number one by a long-shot.\nWe will use the example of bulk data upload to SQL Server using Python (for those of us without BULK INSERT).\nAt the end of the upload script, we include a simple message notifying us of upload completion.\nIf errors are occasionally thrown, we could also add a try-except clause to catch the error, and add it to a list to include in our update and/or completion email.\nIn the case of financial modelling, everything I run is actually pretty quick, so I can only provide you with an ‘example’ use-case here.\nWe will use the example of a cash-flow modelling tool. In-reality, this process take no more than a 10–20 seconds, but for now let’s assume we’re hot-shot Wall Street quants processing a few million (rather than hundred) loans.\nWith this email, we may want to include a high-level summary of the analysed portfolio. We can randomly select a few loans and visualize key values over the given time period — giving us a small sample to cross-check model performance is as expected.\nAll of the functionality above filters from a single script called notify.py.\nWe will use Outlook in our example code. However, translating this to other providers is incredibly easy, which we will also cover quickly at the end.\nThere are two Python libraries we need here, email and smtplib.\nemail — For managing email messages. With this we will setup the email message itself, including subject, body, and attachments.\nsmtplib — Handles the SMTP connection. The simple mail transfer protocol (SMTP) is the protocol used by the majority of email systems, allowing mail to be sent over the internet.’\nThe message itself is built using a MIMEMultipart object from the email module. We also use three MIME sub-classes, which we attach to the MIMEMultipart object:\nMIMEText — This will contain the email ‘payload’, meaning the text within the email body.\nMIMEImage — Reasonably easy to guess, this is used to contain images within our email.\nMIMEApplication — Used for MIME message application objects. For us, these are file attachments.\nIn addition to these sub-classes, there are also other parameters, such as the Subject value in MimeMultipart. All of these together gives us the following structure.\nLet’s take a look at putting these all together.\nThis script, for the most part, is reasonably straightforward. At the top, we have our imports — which are the MIME parts we covered before, and Python’s os library.\nFollowing this define a function called message. This allows us to call the function with different parameters and build an email message object with ease. For example, we can write an email with multiple images and attachments like so:\nemail_msg = message( text=\"Model processing complete, please see attached data.\", img=['accuracy.png', 'loss.png'], attachments=['data_in.csv', 'data_out.csv'])\nFirst we initialize the MIMEMultipart object, assigning it to msg.\nWe then set the email subject using the 'Subject' key.\nThe attach method allows us to add different MIME sub-classes to our MIMEMultipart object. With this we can add the email body, using the MIMEText sub-class.\nFor both images img and attachments attachment, we can pass either nothing, a single file-path, or a list of file-paths.\nThis is handled by first checking if the parameters are None, if they are, we pass. Otherwise, we check the data-type given, is it is not a list, we make it one — this allows us to use the following for loop to iterate through our items.\nAt this point we use the MIMEImage and MIMEApplication sub-classes to attach our images and files respectively. For both we use os.basename to retrieve the filename from the given file-path, which we include as the attachment name.\nNow that we have built our email message object, we need to send it.\nThis is where the smtplib module comes in. The code is again, pretty straight-forward, with one exception.\nAs we are dealing directly with different email provider’s, and their respective servers, we need different SMTP addresses for each. Fortunately, this is really easy to find.\nType “outlook smtp” into Google. Without even clicking on a page, we are given the server address smtp-mail.outlook.com, and port number 587.\nWe use both of these when initalizing the SMTP object with smtplib.SMTP — near the beginning of the send function.\nsmtp.ehlo() and smtp.starttls() are both SMTP commands. ehlo (Extended Hello) essentially greets the server. starttls informs the server we will be communicating using an encrypted transport level security (TLS) connection. You can learn more about SMTP commands here.\nAfter this we simply read in our email and password from file, storing both in email and pwd respectively.\nWe then login to the SMTP server with smtp.login, and send the email with smtp.sendmail.\nI always send the notifications to myself, but in the case of automated reporting (or for any other reason), you may want to send the email elsewhere. To do this, change the destination_address: smtp.sendmail(email, destination_address, msg.as_string).\nFinally, we terminate the session and close the connection with smtp.quit.\nAll of this is placed within a try-except statement. In the case of momentary network connection loss, we will be unable to connect to the server. Resulting in a socket.gaierror.\nImplementing this try-except statement prevents the program from breaking in the case of a lapse in network connection. How you deal with this may differ, depending on how important it is for the email to be sent.\nFor me, I use this for ML model training updates and data transfer completion. If an email does not get sent, it doesn’t really matter. So this simple, passive handling of connection loss is suitable.\nNow we have written both parts of our code, we can send emails with just:\n# build a message objectmsg = message(text=\"See attached!\", img='important.png', attachment='data.csv')send(msg) # send the email (defaults to Outlook)\nJason Farlette pointed out that those of you using Gmail may need to ‘allow access for less secure apps’. Steps for doing so can be found in this Stack Overflow question.\nThat is all for email notification and/or automation using Python. Thanks to the email and smptlib libraries this is an incredibly easy process to setup.\nFor any processing or training tasks that consume a lot of time, progress updates and notification on completion, is often truly liberating.\nI hope this article has been useful to a few of you out there, as always, let me know if you have any questions or suggestions!\nThanks for reading!\nI’ve also written other ‘quick fix’ articles for making our lives easier with Python, check out this one for Excel and Python integration:"},"parsed":{"kind":"list like","value":[{"code":null,"e":221,"s":47,"text":"Working in Python, I often run data processing, transfer, and model training scripts. Now, with any reasonable degree of complexity and/or big data, this can take some time."},{"code":null,"e":355,"s":221,"text":"Although often enough we all have some other work to be done whilst waiting for these processing to complete, occasionally, we don’t."},{"code":null,"e":544,"s":355,"text":"For this purpose, I put together a set of Python scripts built for this exact problem. I use these scripts to send process updates, visualizations and completion notifications to my phone."},{"code":null,"e":665,"s":544,"text":"So, when we do occasionally have those moments of freedom. We can enjoy them without being worried about model progress."},{"code":null,"e":734,"s":665,"text":"Okay so the first thing we need to ask is — what do we need to know?"},{"code":null,"e":879,"s":734,"text":"Now of-course, this really depends on the work you are doing. For me I have three main processing tasks that have the potential to take up time:"},{"code":null,"e":894,"s":879,"text":"Model training"},{"code":null,"e":926,"s":894,"text":"Data processing and/or transfer"},{"code":null,"e":946,"s":926,"text":"Financial modelling"},{"code":null,"e":1095,"s":946,"text":"For each of these, there are of-course different pieces of information that we need to stay informed about. Let’s take a look at an example of each."},{"code":null,"e":1209,"s":1095,"text":"Update every n epochs, must include key metrics. For example, loss and accuracy for training and validation sets."},{"code":null,"e":1277,"s":1209,"text":"Notification of completion (of-course). For this I like to include:"},{"code":null,"e":1415,"s":1277,"text":"prediction outputs, for text generation, the generated text (or a sample of it) — for image generation, a (hopefully) cool visualization."},{"code":null,"e":1525,"s":1415,"text":"visualization of key metrics during training (again, loss and accuracy for both training and validation sets)"},{"code":null,"e":1647,"s":1525,"text":"other, less essential but still useful information such as local model directories, training time, model architecture etc"},{"code":null,"e":1736,"s":1647,"text":"Let’s take the example of training a neural network to reproduce a given artistic style."},{"code":null,"e":1865,"s":1736,"text":"For this, we want to see; generated images from the model, loss and accuracy plots, and current training time, and a model name."},{"code":null,"e":1981,"s":1865,"text":"In this scenario, every 100 epochs, an email containing all of the above will be sent. Here is one of those emails:"},{"code":null,"e":2079,"s":1981,"text":"This one is slightly less glamorous, but in terms of time consumed, is number one by a long-shot."},{"code":null,"e":2189,"s":2079,"text":"We will use the example of bulk data upload to SQL Server using Python (for those of us without BULK INSERT)."},{"code":null,"e":2285,"s":2189,"text":"At the end of the upload script, we include a simple message notifying us of upload completion."},{"code":null,"e":2449,"s":2285,"text":"If errors are occasionally thrown, we could also add a try-except clause to catch the error, and add it to a list to include in our update and/or completion email."},{"code":null,"e":2587,"s":2449,"text":"In the case of financial modelling, everything I run is actually pretty quick, so I can only provide you with an ‘example’ use-case here."},{"code":null,"e":2815,"s":2587,"text":"We will use the example of a cash-flow modelling tool. In-reality, this process take no more than a 10–20 seconds, but for now let’s assume we’re hot-shot Wall Street quants processing a few million (rather than hundred) loans."},{"code":null,"e":3066,"s":2815,"text":"With this email, we may want to include a high-level summary of the analysed portfolio. We can randomly select a few loans and visualize key values over the given time period — giving us a small sample to cross-check model performance is as expected."},{"code":null,"e":3144,"s":3066,"text":"All of the functionality above filters from a single script called notify.py."},{"code":null,"e":3295,"s":3144,"text":"We will use Outlook in our example code. However, translating this to other providers is incredibly easy, which we will also cover quickly at the end."},{"code":null,"e":3359,"s":3295,"text":"There are two Python libraries we need here, email and smtplib."},{"code":null,"e":3488,"s":3359,"text":"email — For managing email messages. With this we will setup the email message itself, including subject, body, and attachments."},{"code":null,"e":3668,"s":3488,"text":"smtplib — Handles the SMTP connection. The simple mail transfer protocol (SMTP) is the protocol used by the majority of email systems, allowing mail to be sent over the internet.’"},{"code":null,"e":3829,"s":3668,"text":"The message itself is built using a MIMEMultipart object from the email module. We also use three MIME sub-classes, which we attach to the MIMEMultipart object:"},{"code":null,"e":3919,"s":3829,"text":"MIMEText — This will contain the email ‘payload’, meaning the text within the email body."},{"code":null,"e":4006,"s":3919,"text":"MIMEImage — Reasonably easy to guess, this is used to contain images within our email."},{"code":null,"e":4103,"s":4006,"text":"MIMEApplication — Used for MIME message application objects. For us, these are file attachments."},{"code":null,"e":4270,"s":4103,"text":"In addition to these sub-classes, there are also other parameters, such as the Subject value in MimeMultipart. All of these together gives us the following structure."},{"code":null,"e":4319,"s":4270,"text":"Let’s take a look at putting these all together."},{"code":null,"e":4485,"s":4319,"text":"This script, for the most part, is reasonably straightforward. At the top, we have our imports — which are the MIME parts we covered before, and Python’s os library."},{"code":null,"e":4722,"s":4485,"text":"Following this define a function called message. This allows us to call the function with different parameters and build an email message object with ease. For example, we can write an email with multiple images and attachments like so:"},{"code":null,"e":4892,"s":4722,"text":"email_msg = message( text=\"Model processing complete, please see attached data.\", img=['accuracy.png', 'loss.png'], attachments=['data_in.csv', 'data_out.csv'])"},{"code":null,"e":4959,"s":4892,"text":"First we initialize the MIMEMultipart object, assigning it to msg."},{"code":null,"e":5014,"s":4959,"text":"We then set the email subject using the 'Subject' key."},{"code":null,"e":5172,"s":5014,"text":"The attach method allows us to add different MIME sub-classes to our MIMEMultipart object. With this we can add the email body, using the MIMEText sub-class."},{"code":null,"e":5293,"s":5172,"text":"For both images img and attachments attachment, we can pass either nothing, a single file-path, or a list of file-paths."},{"code":null,"e":5531,"s":5293,"text":"This is handled by first checking if the parameters are None, if they are, we pass. Otherwise, we check the data-type given, is it is not a list, we make it one — this allows us to use the following for loop to iterate through our items."},{"code":null,"e":5763,"s":5531,"text":"At this point we use the MIMEImage and MIMEApplication sub-classes to attach our images and files respectively. For both we use os.basename to retrieve the filename from the given file-path, which we include as the attachment name."},{"code":null,"e":5832,"s":5763,"text":"Now that we have built our email message object, we need to send it."},{"code":null,"e":5939,"s":5832,"text":"This is where the smtplib module comes in. The code is again, pretty straight-forward, with one exception."},{"code":null,"e":6114,"s":5939,"text":"As we are dealing directly with different email provider’s, and their respective servers, we need different SMTP addresses for each. Fortunately, this is really easy to find."},{"code":null,"e":6256,"s":6114,"text":"Type “outlook smtp” into Google. Without even clicking on a page, we are given the server address smtp-mail.outlook.com, and port number 587."},{"code":null,"e":6371,"s":6256,"text":"We use both of these when initalizing the SMTP object with smtplib.SMTP — near the beginning of the send function."},{"code":null,"e":6640,"s":6371,"text":"smtp.ehlo() and smtp.starttls() are both SMTP commands. ehlo (Extended Hello) essentially greets the server. starttls informs the server we will be communicating using an encrypted transport level security (TLS) connection. You can learn more about SMTP commands here."},{"code":null,"e":6747,"s":6640,"text":"After this we simply read in our email and password from file, storing both in email and pwd respectively."},{"code":null,"e":6836,"s":6747,"text":"We then login to the SMTP server with smtp.login, and send the email with smtp.sendmail."},{"code":null,"e":7089,"s":6836,"text":"I always send the notifications to myself, but in the case of automated reporting (or for any other reason), you may want to send the email elsewhere. To do this, change the destination_address: smtp.sendmail(email, destination_address, msg.as_string)."},{"code":null,"e":7164,"s":7089,"text":"Finally, we terminate the session and close the connection with smtp.quit."},{"code":null,"e":7343,"s":7164,"text":"All of this is placed within a try-except statement. In the case of momentary network connection loss, we will be unable to connect to the server. Resulting in a socket.gaierror."},{"code":null,"e":7557,"s":7343,"text":"Implementing this try-except statement prevents the program from breaking in the case of a lapse in network connection. How you deal with this may differ, depending on how important it is for the email to be sent."},{"code":null,"e":7758,"s":7557,"text":"For me, I use this for ML model training updates and data transfer completion. If an email does not get sent, it doesn’t really matter. So this simple, passive handling of connection loss is suitable."},{"code":null,"e":7832,"s":7758,"text":"Now we have written both parts of our code, we can send emails with just:"},{"code":null,"e":7998,"s":7832,"text":"# build a message objectmsg = message(text=\"See attached!\", img='important.png', attachment='data.csv')send(msg) # send the email (defaults to Outlook)"},{"code":null,"e":8169,"s":7998,"text":"Jason Farlette pointed out that those of you using Gmail may need to ‘allow access for less secure apps’. Steps for doing so can be found in this Stack Overflow question."},{"code":null,"e":8323,"s":8169,"text":"That is all for email notification and/or automation using Python. Thanks to the email and smptlib libraries this is an incredibly easy process to setup."},{"code":null,"e":8464,"s":8323,"text":"For any processing or training tasks that consume a lot of time, progress updates and notification on completion, is often truly liberating."},{"code":null,"e":8592,"s":8464,"text":"I hope this article has been useful to a few of you out there, as always, let me know if you have any questions or suggestions!"},{"code":null,"e":8612,"s":8592,"text":"Thanks for reading!"}],"string":"[\n {\n \"code\": null,\n \"e\": 221,\n \"s\": 47,\n \"text\": \"Working in Python, I often run data processing, transfer, and model training scripts. Now, with any reasonable degree of complexity and/or big data, this can take some time.\"\n },\n {\n \"code\": null,\n \"e\": 355,\n \"s\": 221,\n \"text\": \"Although often enough we all have some other work to be done whilst waiting for these processing to complete, occasionally, we don’t.\"\n },\n {\n \"code\": null,\n \"e\": 544,\n \"s\": 355,\n \"text\": \"For this purpose, I put together a set of Python scripts built for this exact problem. I use these scripts to send process updates, visualizations and completion notifications to my phone.\"\n },\n {\n \"code\": null,\n \"e\": 665,\n \"s\": 544,\n \"text\": \"So, when we do occasionally have those moments of freedom. We can enjoy them without being worried about model progress.\"\n },\n {\n \"code\": null,\n \"e\": 734,\n \"s\": 665,\n \"text\": \"Okay so the first thing we need to ask is — what do we need to know?\"\n },\n {\n \"code\": null,\n \"e\": 879,\n \"s\": 734,\n \"text\": \"Now of-course, this really depends on the work you are doing. For me I have three main processing tasks that have the potential to take up time:\"\n },\n {\n \"code\": null,\n \"e\": 894,\n \"s\": 879,\n \"text\": \"Model training\"\n },\n {\n \"code\": null,\n \"e\": 926,\n \"s\": 894,\n \"text\": \"Data processing and/or transfer\"\n },\n {\n \"code\": null,\n \"e\": 946,\n \"s\": 926,\n \"text\": \"Financial modelling\"\n },\n {\n \"code\": null,\n \"e\": 1095,\n \"s\": 946,\n \"text\": \"For each of these, there are of-course different pieces of information that we need to stay informed about. Let’s take a look at an example of each.\"\n },\n {\n \"code\": null,\n \"e\": 1209,\n \"s\": 1095,\n \"text\": \"Update every n epochs, must include key metrics. For example, loss and accuracy for training and validation sets.\"\n },\n {\n \"code\": null,\n \"e\": 1277,\n \"s\": 1209,\n \"text\": \"Notification of completion (of-course). For this I like to include:\"\n },\n {\n \"code\": null,\n \"e\": 1415,\n \"s\": 1277,\n \"text\": \"prediction outputs, for text generation, the generated text (or a sample of it) — for image generation, a (hopefully) cool visualization.\"\n },\n {\n \"code\": null,\n \"e\": 1525,\n \"s\": 1415,\n \"text\": \"visualization of key metrics during training (again, loss and accuracy for both training and validation sets)\"\n },\n {\n \"code\": null,\n \"e\": 1647,\n \"s\": 1525,\n \"text\": \"other, less essential but still useful information such as local model directories, training time, model architecture etc\"\n },\n {\n \"code\": null,\n \"e\": 1736,\n \"s\": 1647,\n \"text\": \"Let’s take the example of training a neural network to reproduce a given artistic style.\"\n },\n {\n \"code\": null,\n \"e\": 1865,\n \"s\": 1736,\n \"text\": \"For this, we want to see; generated images from the model, loss and accuracy plots, and current training time, and a model name.\"\n },\n {\n \"code\": null,\n \"e\": 1981,\n \"s\": 1865,\n \"text\": \"In this scenario, every 100 epochs, an email containing all of the above will be sent. Here is one of those emails:\"\n },\n {\n \"code\": null,\n \"e\": 2079,\n \"s\": 1981,\n \"text\": \"This one is slightly less glamorous, but in terms of time consumed, is number one by a long-shot.\"\n },\n {\n \"code\": null,\n \"e\": 2189,\n \"s\": 2079,\n \"text\": \"We will use the example of bulk data upload to SQL Server using Python (for those of us without BULK INSERT).\"\n },\n {\n \"code\": null,\n \"e\": 2285,\n \"s\": 2189,\n \"text\": \"At the end of the upload script, we include a simple message notifying us of upload completion.\"\n },\n {\n \"code\": null,\n \"e\": 2449,\n \"s\": 2285,\n \"text\": \"If errors are occasionally thrown, we could also add a try-except clause to catch the error, and add it to a list to include in our update and/or completion email.\"\n },\n {\n \"code\": null,\n \"e\": 2587,\n \"s\": 2449,\n \"text\": \"In the case of financial modelling, everything I run is actually pretty quick, so I can only provide you with an ‘example’ use-case here.\"\n },\n {\n \"code\": null,\n \"e\": 2815,\n \"s\": 2587,\n \"text\": \"We will use the example of a cash-flow modelling tool. In-reality, this process take no more than a 10–20 seconds, but for now let’s assume we’re hot-shot Wall Street quants processing a few million (rather than hundred) loans.\"\n },\n {\n \"code\": null,\n \"e\": 3066,\n \"s\": 2815,\n \"text\": \"With this email, we may want to include a high-level summary of the analysed portfolio. We can randomly select a few loans and visualize key values over the given time period — giving us a small sample to cross-check model performance is as expected.\"\n },\n {\n \"code\": null,\n \"e\": 3144,\n \"s\": 3066,\n \"text\": \"All of the functionality above filters from a single script called notify.py.\"\n },\n {\n \"code\": null,\n \"e\": 3295,\n \"s\": 3144,\n \"text\": \"We will use Outlook in our example code. However, translating this to other providers is incredibly easy, which we will also cover quickly at the end.\"\n },\n {\n \"code\": null,\n \"e\": 3359,\n \"s\": 3295,\n \"text\": \"There are two Python libraries we need here, email and smtplib.\"\n },\n {\n \"code\": null,\n \"e\": 3488,\n \"s\": 3359,\n \"text\": \"email — For managing email messages. With this we will setup the email message itself, including subject, body, and attachments.\"\n },\n {\n \"code\": null,\n \"e\": 3668,\n \"s\": 3488,\n \"text\": \"smtplib — Handles the SMTP connection. The simple mail transfer protocol (SMTP) is the protocol used by the majority of email systems, allowing mail to be sent over the internet.’\"\n },\n {\n \"code\": null,\n \"e\": 3829,\n \"s\": 3668,\n \"text\": \"The message itself is built using a MIMEMultipart object from the email module. We also use three MIME sub-classes, which we attach to the MIMEMultipart object:\"\n },\n {\n \"code\": null,\n \"e\": 3919,\n \"s\": 3829,\n \"text\": \"MIMEText — This will contain the email ‘payload’, meaning the text within the email body.\"\n },\n {\n \"code\": null,\n \"e\": 4006,\n \"s\": 3919,\n \"text\": \"MIMEImage — Reasonably easy to guess, this is used to contain images within our email.\"\n },\n {\n \"code\": null,\n \"e\": 4103,\n \"s\": 4006,\n \"text\": \"MIMEApplication — Used for MIME message application objects. For us, these are file attachments.\"\n },\n {\n \"code\": null,\n \"e\": 4270,\n \"s\": 4103,\n \"text\": \"In addition to these sub-classes, there are also other parameters, such as the Subject value in MimeMultipart. All of these together gives us the following structure.\"\n },\n {\n \"code\": null,\n \"e\": 4319,\n \"s\": 4270,\n \"text\": \"Let’s take a look at putting these all together.\"\n },\n {\n \"code\": null,\n \"e\": 4485,\n \"s\": 4319,\n \"text\": \"This script, for the most part, is reasonably straightforward. At the top, we have our imports — which are the MIME parts we covered before, and Python’s os library.\"\n },\n {\n \"code\": null,\n \"e\": 4722,\n \"s\": 4485,\n \"text\": \"Following this define a function called message. This allows us to call the function with different parameters and build an email message object with ease. For example, we can write an email with multiple images and attachments like so:\"\n },\n {\n \"code\": null,\n \"e\": 4892,\n \"s\": 4722,\n \"text\": \"email_msg = message( text=\\\"Model processing complete, please see attached data.\\\", img=['accuracy.png', 'loss.png'], attachments=['data_in.csv', 'data_out.csv'])\"\n },\n {\n \"code\": null,\n \"e\": 4959,\n \"s\": 4892,\n \"text\": \"First we initialize the MIMEMultipart object, assigning it to msg.\"\n },\n {\n \"code\": null,\n \"e\": 5014,\n \"s\": 4959,\n \"text\": \"We then set the email subject using the 'Subject' key.\"\n },\n {\n \"code\": null,\n \"e\": 5172,\n \"s\": 5014,\n \"text\": \"The attach method allows us to add different MIME sub-classes to our MIMEMultipart object. With this we can add the email body, using the MIMEText sub-class.\"\n },\n {\n \"code\": null,\n \"e\": 5293,\n \"s\": 5172,\n \"text\": \"For both images img and attachments attachment, we can pass either nothing, a single file-path, or a list of file-paths.\"\n },\n {\n \"code\": null,\n \"e\": 5531,\n \"s\": 5293,\n \"text\": \"This is handled by first checking if the parameters are None, if they are, we pass. Otherwise, we check the data-type given, is it is not a list, we make it one — this allows us to use the following for loop to iterate through our items.\"\n },\n {\n \"code\": null,\n \"e\": 5763,\n \"s\": 5531,\n \"text\": \"At this point we use the MIMEImage and MIMEApplication sub-classes to attach our images and files respectively. For both we use os.basename to retrieve the filename from the given file-path, which we include as the attachment name.\"\n },\n {\n \"code\": null,\n \"e\": 5832,\n \"s\": 5763,\n \"text\": \"Now that we have built our email message object, we need to send it.\"\n },\n {\n \"code\": null,\n \"e\": 5939,\n \"s\": 5832,\n \"text\": \"This is where the smtplib module comes in. The code is again, pretty straight-forward, with one exception.\"\n },\n {\n \"code\": null,\n \"e\": 6114,\n \"s\": 5939,\n \"text\": \"As we are dealing directly with different email provider’s, and their respective servers, we need different SMTP addresses for each. Fortunately, this is really easy to find.\"\n },\n {\n \"code\": null,\n \"e\": 6256,\n \"s\": 6114,\n \"text\": \"Type “outlook smtp” into Google. Without even clicking on a page, we are given the server address smtp-mail.outlook.com, and port number 587.\"\n },\n {\n \"code\": null,\n \"e\": 6371,\n \"s\": 6256,\n \"text\": \"We use both of these when initalizing the SMTP object with smtplib.SMTP — near the beginning of the send function.\"\n },\n {\n \"code\": null,\n \"e\": 6640,\n \"s\": 6371,\n \"text\": \"smtp.ehlo() and smtp.starttls() are both SMTP commands. ehlo (Extended Hello) essentially greets the server. starttls informs the server we will be communicating using an encrypted transport level security (TLS) connection. You can learn more about SMTP commands here.\"\n },\n {\n \"code\": null,\n \"e\": 6747,\n \"s\": 6640,\n \"text\": \"After this we simply read in our email and password from file, storing both in email and pwd respectively.\"\n },\n {\n \"code\": null,\n \"e\": 6836,\n \"s\": 6747,\n \"text\": \"We then login to the SMTP server with smtp.login, and send the email with smtp.sendmail.\"\n },\n {\n \"code\": null,\n \"e\": 7089,\n \"s\": 6836,\n \"text\": \"I always send the notifications to myself, but in the case of automated reporting (or for any other reason), you may want to send the email elsewhere. To do this, change the destination_address: smtp.sendmail(email, destination_address, msg.as_string).\"\n },\n {\n \"code\": null,\n \"e\": 7164,\n \"s\": 7089,\n \"text\": \"Finally, we terminate the session and close the connection with smtp.quit.\"\n },\n {\n \"code\": null,\n \"e\": 7343,\n \"s\": 7164,\n \"text\": \"All of this is placed within a try-except statement. In the case of momentary network connection loss, we will be unable to connect to the server. Resulting in a socket.gaierror.\"\n },\n {\n \"code\": null,\n \"e\": 7557,\n \"s\": 7343,\n \"text\": \"Implementing this try-except statement prevents the program from breaking in the case of a lapse in network connection. How you deal with this may differ, depending on how important it is for the email to be sent.\"\n },\n {\n \"code\": null,\n \"e\": 7758,\n \"s\": 7557,\n \"text\": \"For me, I use this for ML model training updates and data transfer completion. If an email does not get sent, it doesn’t really matter. So this simple, passive handling of connection loss is suitable.\"\n },\n {\n \"code\": null,\n \"e\": 7832,\n \"s\": 7758,\n \"text\": \"Now we have written both parts of our code, we can send emails with just:\"\n },\n {\n \"code\": null,\n \"e\": 7998,\n \"s\": 7832,\n \"text\": \"# build a message objectmsg = message(text=\\\"See attached!\\\", img='important.png', attachment='data.csv')send(msg) # send the email (defaults to Outlook)\"\n },\n {\n \"code\": null,\n \"e\": 8169,\n \"s\": 7998,\n \"text\": \"Jason Farlette pointed out that those of you using Gmail may need to ‘allow access for less secure apps’. Steps for doing so can be found in this Stack Overflow question.\"\n },\n {\n \"code\": null,\n \"e\": 8323,\n \"s\": 8169,\n \"text\": \"That is all for email notification and/or automation using Python. Thanks to the email and smptlib libraries this is an incredibly easy process to setup.\"\n },\n {\n \"code\": null,\n \"e\": 8464,\n \"s\": 8323,\n \"text\": \"For any processing or training tasks that consume a lot of time, progress updates and notification on completion, is often truly liberating.\"\n },\n {\n \"code\": null,\n \"e\": 8592,\n \"s\": 8464,\n \"text\": \"I hope this article has been useful to a few of you out there, as always, let me know if you have any questions or suggestions!\"\n },\n {\n \"code\": null,\n \"e\": 8612,\n \"s\": 8592,\n \"text\": \"Thanks for reading!\"\n }\n]"}}},{"rowIdx":76516,"cells":{"title":{"kind":"string","value":"Bitwise Hacks for Competitive Programming - GeeksforGeeks"},"text":{"kind":"string","value":"23 Feb, 2022\nIt is recommended to refer Interesting facts about Bitwise Operators as a prerequisite.1. How to set a bit in the number ‘num’ :If we want to set a bit at nth position in number ‘num’ ,it can be done using ‘OR’ operator( | ). \nFirst we left shift ‘1’ to n position via (1<using namespace std;// num is the number and pos is the position// at which we want to set the bit.void set(int & num,int pos){ // First step is shift '1', second // step is bitwise OR num |= (1 << pos);}int main(){ int num = 4, pos = 1; set(num, pos); cout << (int)(num) << endl; return 0;}\nOutput: \n6\nWe have passed the parameter by ‘call by reference’ to make permanent changes in the number.2. How to unset/clear a bit at n’th position in the number ‘num’ : \nSuppose we want to unset a bit at nth position in number ‘num’ then we have to do this with the help of ‘AND’ (&) operator.\n \nFirst we left shift ‘1’ to n position via (1<using namespace std;// First step is to get a number that has all 1's except the given position.void unset(int &num,int pos){ //Second step is to bitwise and this number with given number num &= (~(1 << pos));}int main(){ int num = 7; int pos = 1; unset(num, pos); cout << num << endl; return 0;}\nOutput: \n5\n3. Toggling a bit at nth position :Toggling means to turn bit ‘on'(1) if it was ‘off'(0) and to turn ‘off'(0) if it was ‘on'(1) previously.We will be using ‘XOR’ operator here which is this ‘^’. The reason behind ‘XOR’ operator is because of its properties. \nProperties of ‘XOR’ operator. 1^1 = 00^0 = 01^0 = 10^1 = 1\n1^1 = 0\n0^0 = 0\n1^0 = 1\n0^1 = 1\nIf two bits are different then ‘XOR’ operator returns a set bit(1) else it returns an unset bit(0).\n \nC\n#include using namespace std;// First step is to shift 1,Second step is to XOR with given numbervoid toggle(int &num,int pos){ num ^= (1 << pos);}int main(){ int num = 4; int pos = 1; toggle(num, pos); cout << num << endl; return 0;}\nOutput: \n6\n4. Checking if bit at nth position is set or unset: \nIt is quite easily doable using ‘AND’ operator.\n \nLeft shift ‘1’ to given position and then ‘AND'(‘&’).\n \nC\n#include using namespace std; bool at_position(int num,int pos){ bool bit = num & (1<using namespace std;int main(){ int num = 4; // Inverting every bit of number num cout << (~num); return 0;}\nOutput:\n -5\nTwo’s complement of the number: 2’s complement of a number is 1’s complement + 1.\nSo formally we can have 2’s complement by finding 1s complement and adding 1 to the result i.e (~num+1) or what else we can do is using ‘-‘ operator.\nC\n#include using namespace std;int main(){ int num = 4; int twos_complement = -num; cout << \"This is two's complement \" << twos_complement << endl; cout << \"This is also two's complement \" << (~num+1) << endl; return 0;}\nOutput: \nThis is two's complement -4\nThis is also two's complement -4\n \nStripping off the lowest set bit :\n \nIn many situations we want to strip off the lowest set bit for example in Binary Indexed tree data structure, counting number of set bit in a number.\nWe do something like this: \nX = X & (X-1)\nBut how does it even work ?Let us see this by taking an example, let X = 1100.(X-1) inverts all the bits till it encounter lowest set ‘1’ and it also invert that lowest set ‘1’.X-1 becomes 1011. After ‘ANDing’ X with X-1 we get lowest set bit stripped. \nC\n#include using namespace std;void strip_last_set_bit(int &num){ num = num & (num-1);}int main(){ int num = 7; strip_last_set_bit(num); cout << num << endl; return 0;}\nOutput: \n6\n \nGetting lowest set bit of a number:\nThis is done by using expression ‘X &(-X)’Let us see this by taking an example:Let X = 00101100. So ~X(1’s complement) will be ‘11010011’ and 2’s complement will be (~X+1 or -X) i.e ‘11010100’.So if we ‘AND’ original number ‘X’ with its two’s complement which is ‘-X’, we get lowest set bit. \n00101100\n& 11010100\n-----------\n00000100\n \nC\n#include using namespace std;int lowest_set_bit(int num){ int ret = num & (-num); return ret;}int main(){ int num = 10; int ans = lowest_set_bit(num); cout << ans << endl; return 0;}\nOutput: \n2\nDivision by 2 and Multiplication by 2 are very frequently that too in loops in Competitive Programming so using Bitwise operators can help in speeding up the code.\nDivide by 2 using right shift operator:\n00001100 >> 1 (00001100 is 12)\n------------\n00000110 (00000110 is 6)\nC++\n#include using namespace std;int main(){ int num = 12; int ans = num>>1; cout << ans << endl; return 0;}\n6\nMultiply by 2 using left shift operator:\n00001100 << 1 (00001100 is 12)\n------------\n00011000 (00000110 is 24)\nC++\nPython3\nJavascript\n#include using namespace std;int main(){ int num = 12; int ans = num<<1; cout << ans << endl; return 0;}\n# Python program for the above approach num = 12ans = num<<1print(ans) # This code is contributed by Shubham Singh\n\n24\nBit Tricks for Competitive ProgrammingRefer BitWise Operators Articles for more articles on Bit Hacks.This article is contributed by Pankaj Mishra. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above \njit_t\npulamolusaimohan\nthedev05\nSHUBHAMSINGH10\naltyon\nBitwise-XOR\nC++\nCompetitive Programming\nCPP\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nOperator Overloading in C++\nSocket Programming in C/C++\nTemplates in C++ with Examples\nCopy Constructor in C++\nPolymorphism in C++\nCompetitive Programming - A Complete Guide\nPractice for cracking any coding interview\nArrow operator -> in C/C++ with Examples\nTop 10 Algorithms and Data Structures for Competitive Programming\nModulo 10^9+7 (1000000007)"},"parsed":{"kind":"list like","value":[{"code":null,"e":24282,"s":24254,"text":"\n23 Feb, 2022"},{"code":null,"e":24510,"s":24282,"text":"It is recommended to refer Interesting facts about Bitwise Operators as a prerequisite.1. How to set a bit in the number ‘num’ :If we want to set a bit at nth position in number ‘num’ ,it can be done using ‘OR’ operator( | ). "},{"code":null,"e":24559,"s":24510,"text":"First we left shift ‘1’ to n position via (1<using namespace std;// num is the number and pos is the position// at which we want to set the bit.void set(int & num,int pos){ // First step is shift '1', second // step is bitwise OR num |= (1 << pos);}int main(){ int num = 4, pos = 1; set(num, pos); cout << (int)(num) << endl; return 0;}","e":25083,"s":24745,"text":null},{"code":null,"e":25093,"s":25083,"text":"Output: "},{"code":null,"e":25095,"s":25093,"text":"6"},{"code":null,"e":25256,"s":25095,"text":"We have passed the parameter by ‘call by reference’ to make permanent changes in the number.2. How to unset/clear a bit at n’th position in the number ‘num’ : "},{"code":null,"e":25380,"s":25256,"text":"Suppose we want to unset a bit at nth position in number ‘num’ then we have to do this with the help of ‘AND’ (&) operator."},{"code":null,"e":25495,"s":25382,"text":"First we left shift ‘1’ to n position via (1<using namespace std;// First step is to get a number that has all 1's except the given position.void unset(int &num,int pos){ //Second step is to bitwise and this number with given number num &= (~(1 << pos));}int main(){ int num = 7; int pos = 1; unset(num, pos); cout << num << endl; return 0;}","e":25977,"s":25637,"text":null},{"code":null,"e":25987,"s":25977,"text":"Output: "},{"code":null,"e":25989,"s":25987,"text":"5"},{"code":null,"e":26250,"s":25989,"text":"3. Toggling a bit at nth position :Toggling means to turn bit ‘on'(1) if it was ‘off'(0) and to turn ‘off'(0) if it was ‘on'(1) previously.We will be using ‘XOR’ operator here which is this ‘^’. The reason behind ‘XOR’ operator is because of its properties. "},{"code":null,"e":26309,"s":26250,"text":"Properties of ‘XOR’ operator. 1^1 = 00^0 = 01^0 = 10^1 = 1"},{"code":null,"e":26317,"s":26309,"text":"1^1 = 0"},{"code":null,"e":26325,"s":26317,"text":"0^0 = 0"},{"code":null,"e":26333,"s":26325,"text":"1^0 = 1"},{"code":null,"e":26341,"s":26333,"text":"0^1 = 1"},{"code":null,"e":26441,"s":26341,"text":"If two bits are different then ‘XOR’ operator returns a set bit(1) else it returns an unset bit(0)."},{"code":null,"e":26445,"s":26443,"text":"C"},{"code":"#include using namespace std;// First step is to shift 1,Second step is to XOR with given numbervoid toggle(int &num,int pos){ num ^= (1 << pos);}int main(){ int num = 4; int pos = 1; toggle(num, pos); cout << num << endl; return 0;}","e":26707,"s":26445,"text":null},{"code":null,"e":26717,"s":26707,"text":"Output: "},{"code":null,"e":26719,"s":26717,"text":"6"},{"code":null,"e":26773,"s":26719,"text":"4. Checking if bit at nth position is set or unset: "},{"code":null,"e":26821,"s":26773,"text":"It is quite easily doable using ‘AND’ operator."},{"code":null,"e":26877,"s":26823,"text":"Left shift ‘1’ to given position and then ‘AND'(‘&’)."},{"code":null,"e":26881,"s":26879,"text":"C"},{"code":"#include using namespace std; bool at_position(int num,int pos){ bool bit = num & (1<using namespace std;int main(){ int num = 4; // Inverting every bit of number num cout << (~num); return 0;}","e":27933,"s":27792,"text":null},{"code":null,"e":27945,"s":27933,"text":"Output:\n -5"},{"code":null,"e":28027,"s":27945,"text":"Two’s complement of the number: 2’s complement of a number is 1’s complement + 1."},{"code":null,"e":28177,"s":28027,"text":"So formally we can have 2’s complement by finding 1s complement and adding 1 to the result i.e (~num+1) or what else we can do is using ‘-‘ operator."},{"code":null,"e":28179,"s":28177,"text":"C"},{"code":"#include using namespace std;int main(){ int num = 4; int twos_complement = -num; cout << \"This is two's complement \" << twos_complement << endl; cout << \"This is also two's complement \" << (~num+1) << endl; return 0;}","e":28423,"s":28179,"text":null},{"code":null,"e":28433,"s":28423,"text":"Output: "},{"code":null,"e":28494,"s":28433,"text":"This is two's complement -4\nThis is also two's complement -4"},{"code":null,"e":28531,"s":28496,"text":"Stripping off the lowest set bit :"},{"code":null,"e":28683,"s":28533,"text":"In many situations we want to strip off the lowest set bit for example in Binary Indexed tree data structure, counting number of set bit in a number."},{"code":null,"e":28712,"s":28683,"text":"We do something like this: "},{"code":null,"e":28726,"s":28712,"text":"X = X & (X-1)"},{"code":null,"e":28981,"s":28726,"text":"But how does it even work ?Let us see this by taking an example, let X = 1100.(X-1) inverts all the bits till it encounter lowest set ‘1’ and it also invert that lowest set ‘1’.X-1 becomes 1011. After ‘ANDing’ X with X-1 we get lowest set bit stripped. "},{"code":null,"e":28983,"s":28981,"text":"C"},{"code":"#include using namespace std;void strip_last_set_bit(int &num){ num = num & (num-1);}int main(){ int num = 7; strip_last_set_bit(num); cout << num << endl; return 0;}","e":29175,"s":28983,"text":null},{"code":null,"e":29185,"s":29175,"text":"Output: "},{"code":null,"e":29187,"s":29185,"text":"6"},{"code":null,"e":29225,"s":29189,"text":"Getting lowest set bit of a number:"},{"code":null,"e":29520,"s":29225,"text":"This is done by using expression ‘X &(-X)’Let us see this by taking an example:Let X = 00101100. So ~X(1’s complement) will be ‘11010011’ and 2’s complement will be (~X+1 or -X) i.e ‘11010100’.So if we ‘AND’ original number ‘X’ with its two’s complement which is ‘-X’, we get lowest set bit. "},{"code":null,"e":29561,"s":29520,"text":"00101100\n& 11010100\n-----------\n00000100"},{"code":null,"e":29565,"s":29563,"text":"C"},{"code":"#include using namespace std;int lowest_set_bit(int num){ int ret = num & (-num); return ret;}int main(){ int num = 10; int ans = lowest_set_bit(num); cout << ans << endl; return 0;}","e":29776,"s":29565,"text":null},{"code":null,"e":29786,"s":29776,"text":"Output: "},{"code":null,"e":29788,"s":29786,"text":"2"},{"code":null,"e":29952,"s":29788,"text":"Division by 2 and Multiplication by 2 are very frequently that too in loops in Competitive Programming so using Bitwise operators can help in speeding up the code."},{"code":null,"e":29992,"s":29952,"text":"Divide by 2 using right shift operator:"},{"code":null,"e":30061,"s":29992,"text":"00001100 >> 1 (00001100 is 12)\n------------\n00000110 (00000110 is 6)"},{"code":null,"e":30065,"s":30061,"text":"C++"},{"code":"#include using namespace std;int main(){ int num = 12; int ans = num>>1; cout << ans << endl; return 0;}","e":30192,"s":30065,"text":null},{"code":null,"e":30194,"s":30192,"text":"6"},{"code":null,"e":30235,"s":30194,"text":"Multiply by 2 using left shift operator:"},{"code":null,"e":30305,"s":30235,"text":"00001100 << 1 (00001100 is 12)\n------------\n00011000 (00000110 is 24)"},{"code":null,"e":30309,"s":30305,"text":"C++"},{"code":null,"e":30317,"s":30309,"text":"Python3"},{"code":null,"e":30328,"s":30317,"text":"Javascript"},{"code":"#include using namespace std;int main(){ int num = 12; int ans = num<<1; cout << ans << endl; return 0;}","e":30455,"s":30328,"text":null},{"code":"# Python program for the above approach num = 12ans = num<<1print(ans) # This code is contributed by Shubham Singh","e":30570,"s":30455,"text":null},{"code":"","e":30727,"s":30570,"text":null},{"code":null,"e":30730,"s":30727,"text":"24"},{"code":null,"e":31224,"s":30730,"text":"Bit Tricks for Competitive ProgrammingRefer BitWise Operators Articles for more articles on Bit Hacks.This article is contributed by Pankaj Mishra. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above "},{"code":null,"e":31230,"s":31224,"text":"jit_t"},{"code":null,"e":31247,"s":31230,"text":"pulamolusaimohan"},{"code":null,"e":31256,"s":31247,"text":"thedev05"},{"code":null,"e":31271,"s":31256,"text":"SHUBHAMSINGH10"},{"code":null,"e":31278,"s":31271,"text":"altyon"},{"code":null,"e":31290,"s":31278,"text":"Bitwise-XOR"},{"code":null,"e":31294,"s":31290,"text":"C++"},{"code":null,"e":31318,"s":31294,"text":"Competitive Programming"},{"code":null,"e":31322,"s":31318,"text":"CPP"},{"code":null,"e":31420,"s":31322,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":31448,"s":31420,"text":"Operator Overloading in C++"},{"code":null,"e":31476,"s":31448,"text":"Socket Programming in C/C++"},{"code":null,"e":31507,"s":31476,"text":"Templates in C++ with Examples"},{"code":null,"e":31531,"s":31507,"text":"Copy Constructor in C++"},{"code":null,"e":31551,"s":31531,"text":"Polymorphism in C++"},{"code":null,"e":31594,"s":31551,"text":"Competitive Programming - A Complete Guide"},{"code":null,"e":31637,"s":31594,"text":"Practice for cracking any coding interview"},{"code":null,"e":31678,"s":31637,"text":"Arrow operator -> in C/C++ with Examples"},{"code":null,"e":31744,"s":31678,"text":"Top 10 Algorithms and Data Structures for Competitive Programming"}],"string":"[\n {\n \"code\": null,\n \"e\": 24282,\n \"s\": 24254,\n \"text\": \"\\n23 Feb, 2022\"\n },\n {\n \"code\": null,\n \"e\": 24510,\n \"s\": 24282,\n \"text\": \"It is recommended to refer Interesting facts about Bitwise Operators as a prerequisite.1. How to set a bit in the number ‘num’ :If we want to set a bit at nth position in number ‘num’ ,it can be done using ‘OR’ operator( | ). \"\n },\n {\n \"code\": null,\n \"e\": 24559,\n \"s\": 24510,\n \"text\": \"First we left shift ‘1’ to n position via (1<using namespace std;// num is the number and pos is the position// at which we want to set the bit.void set(int & num,int pos){ // First step is shift '1', second // step is bitwise OR num |= (1 << pos);}int main(){ int num = 4, pos = 1; set(num, pos); cout << (int)(num) << endl; return 0;}\",\n \"e\": 25083,\n \"s\": 24745,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 25093,\n \"s\": 25083,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 25095,\n \"s\": 25093,\n \"text\": \"6\"\n },\n {\n \"code\": null,\n \"e\": 25256,\n \"s\": 25095,\n \"text\": \"We have passed the parameter by ‘call by reference’ to make permanent changes in the number.2. How to unset/clear a bit at n’th position in the number ‘num’ : \"\n },\n {\n \"code\": null,\n \"e\": 25380,\n \"s\": 25256,\n \"text\": \"Suppose we want to unset a bit at nth position in number ‘num’ then we have to do this with the help of ‘AND’ (&) operator.\"\n },\n {\n \"code\": null,\n \"e\": 25495,\n \"s\": 25382,\n \"text\": \"First we left shift ‘1’ to n position via (1<using namespace std;// First step is to get a number that has all 1's except the given position.void unset(int &num,int pos){ //Second step is to bitwise and this number with given number num &= (~(1 << pos));}int main(){ int num = 7; int pos = 1; unset(num, pos); cout << num << endl; return 0;}\",\n \"e\": 25977,\n \"s\": 25637,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 25987,\n \"s\": 25977,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 25989,\n \"s\": 25987,\n \"text\": \"5\"\n },\n {\n \"code\": null,\n \"e\": 26250,\n \"s\": 25989,\n \"text\": \"3. Toggling a bit at nth position :Toggling means to turn bit ‘on'(1) if it was ‘off'(0) and to turn ‘off'(0) if it was ‘on'(1) previously.We will be using ‘XOR’ operator here which is this ‘^’. The reason behind ‘XOR’ operator is because of its properties. \"\n },\n {\n \"code\": null,\n \"e\": 26309,\n \"s\": 26250,\n \"text\": \"Properties of ‘XOR’ operator. 1^1 = 00^0 = 01^0 = 10^1 = 1\"\n },\n {\n \"code\": null,\n \"e\": 26317,\n \"s\": 26309,\n \"text\": \"1^1 = 0\"\n },\n {\n \"code\": null,\n \"e\": 26325,\n \"s\": 26317,\n \"text\": \"0^0 = 0\"\n },\n {\n \"code\": null,\n \"e\": 26333,\n \"s\": 26325,\n \"text\": \"1^0 = 1\"\n },\n {\n \"code\": null,\n \"e\": 26341,\n \"s\": 26333,\n \"text\": \"0^1 = 1\"\n },\n {\n \"code\": null,\n \"e\": 26441,\n \"s\": 26341,\n \"text\": \"If two bits are different then ‘XOR’ operator returns a set bit(1) else it returns an unset bit(0).\"\n },\n {\n \"code\": null,\n \"e\": 26445,\n \"s\": 26443,\n \"text\": \"C\"\n },\n {\n \"code\": \"#include using namespace std;// First step is to shift 1,Second step is to XOR with given numbervoid toggle(int &num,int pos){ num ^= (1 << pos);}int main(){ int num = 4; int pos = 1; toggle(num, pos); cout << num << endl; return 0;}\",\n \"e\": 26707,\n \"s\": 26445,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 26717,\n \"s\": 26707,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 26719,\n \"s\": 26717,\n \"text\": \"6\"\n },\n {\n \"code\": null,\n \"e\": 26773,\n \"s\": 26719,\n \"text\": \"4. Checking if bit at nth position is set or unset: \"\n },\n {\n \"code\": null,\n \"e\": 26821,\n \"s\": 26773,\n \"text\": \"It is quite easily doable using ‘AND’ operator.\"\n },\n {\n \"code\": null,\n \"e\": 26877,\n \"s\": 26823,\n \"text\": \"Left shift ‘1’ to given position and then ‘AND'(‘&’).\"\n },\n {\n \"code\": null,\n \"e\": 26881,\n \"s\": 26879,\n \"text\": \"C\"\n },\n {\n \"code\": \"#include using namespace std; bool at_position(int num,int pos){ bool bit = num & (1<using namespace std;int main(){ int num = 4; // Inverting every bit of number num cout << (~num); return 0;}\",\n \"e\": 27933,\n \"s\": 27792,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 27945,\n \"s\": 27933,\n \"text\": \"Output:\\n -5\"\n },\n {\n \"code\": null,\n \"e\": 28027,\n \"s\": 27945,\n \"text\": \"Two’s complement of the number: 2’s complement of a number is 1’s complement + 1.\"\n },\n {\n \"code\": null,\n \"e\": 28177,\n \"s\": 28027,\n \"text\": \"So formally we can have 2’s complement by finding 1s complement and adding 1 to the result i.e (~num+1) or what else we can do is using ‘-‘ operator.\"\n },\n {\n \"code\": null,\n \"e\": 28179,\n \"s\": 28177,\n \"text\": \"C\"\n },\n {\n \"code\": \"#include using namespace std;int main(){ int num = 4; int twos_complement = -num; cout << \\\"This is two's complement \\\" << twos_complement << endl; cout << \\\"This is also two's complement \\\" << (~num+1) << endl; return 0;}\",\n \"e\": 28423,\n \"s\": 28179,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 28433,\n \"s\": 28423,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 28494,\n \"s\": 28433,\n \"text\": \"This is two's complement -4\\nThis is also two's complement -4\"\n },\n {\n \"code\": null,\n \"e\": 28531,\n \"s\": 28496,\n \"text\": \"Stripping off the lowest set bit :\"\n },\n {\n \"code\": null,\n \"e\": 28683,\n \"s\": 28533,\n \"text\": \"In many situations we want to strip off the lowest set bit for example in Binary Indexed tree data structure, counting number of set bit in a number.\"\n },\n {\n \"code\": null,\n \"e\": 28712,\n \"s\": 28683,\n \"text\": \"We do something like this: \"\n },\n {\n \"code\": null,\n \"e\": 28726,\n \"s\": 28712,\n \"text\": \"X = X & (X-1)\"\n },\n {\n \"code\": null,\n \"e\": 28981,\n \"s\": 28726,\n \"text\": \"But how does it even work ?Let us see this by taking an example, let X = 1100.(X-1) inverts all the bits till it encounter lowest set ‘1’ and it also invert that lowest set ‘1’.X-1 becomes 1011. After ‘ANDing’ X with X-1 we get lowest set bit stripped. \"\n },\n {\n \"code\": null,\n \"e\": 28983,\n \"s\": 28981,\n \"text\": \"C\"\n },\n {\n \"code\": \"#include using namespace std;void strip_last_set_bit(int &num){ num = num & (num-1);}int main(){ int num = 7; strip_last_set_bit(num); cout << num << endl; return 0;}\",\n \"e\": 29175,\n \"s\": 28983,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 29185,\n \"s\": 29175,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 29187,\n \"s\": 29185,\n \"text\": \"6\"\n },\n {\n \"code\": null,\n \"e\": 29225,\n \"s\": 29189,\n \"text\": \"Getting lowest set bit of a number:\"\n },\n {\n \"code\": null,\n \"e\": 29520,\n \"s\": 29225,\n \"text\": \"This is done by using expression ‘X &(-X)’Let us see this by taking an example:Let X = 00101100. So ~X(1’s complement) will be ‘11010011’ and 2’s complement will be (~X+1 or -X) i.e ‘11010100’.So if we ‘AND’ original number ‘X’ with its two’s complement which is ‘-X’, we get lowest set bit. \"\n },\n {\n \"code\": null,\n \"e\": 29561,\n \"s\": 29520,\n \"text\": \"00101100\\n& 11010100\\n-----------\\n00000100\"\n },\n {\n \"code\": null,\n \"e\": 29565,\n \"s\": 29563,\n \"text\": \"C\"\n },\n {\n \"code\": \"#include using namespace std;int lowest_set_bit(int num){ int ret = num & (-num); return ret;}int main(){ int num = 10; int ans = lowest_set_bit(num); cout << ans << endl; return 0;}\",\n \"e\": 29776,\n \"s\": 29565,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 29786,\n \"s\": 29776,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 29788,\n \"s\": 29786,\n \"text\": \"2\"\n },\n {\n \"code\": null,\n \"e\": 29952,\n \"s\": 29788,\n \"text\": \"Division by 2 and Multiplication by 2 are very frequently that too in loops in Competitive Programming so using Bitwise operators can help in speeding up the code.\"\n },\n {\n \"code\": null,\n \"e\": 29992,\n \"s\": 29952,\n \"text\": \"Divide by 2 using right shift operator:\"\n },\n {\n \"code\": null,\n \"e\": 30061,\n \"s\": 29992,\n \"text\": \"00001100 >> 1 (00001100 is 12)\\n------------\\n00000110 (00000110 is 6)\"\n },\n {\n \"code\": null,\n \"e\": 30065,\n \"s\": 30061,\n \"text\": \"C++\"\n },\n {\n \"code\": \"#include using namespace std;int main(){ int num = 12; int ans = num>>1; cout << ans << endl; return 0;}\",\n \"e\": 30192,\n \"s\": 30065,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 30194,\n \"s\": 30192,\n \"text\": \"6\"\n },\n {\n \"code\": null,\n \"e\": 30235,\n \"s\": 30194,\n \"text\": \"Multiply by 2 using left shift operator:\"\n },\n {\n \"code\": null,\n \"e\": 30305,\n \"s\": 30235,\n \"text\": \"00001100 << 1 (00001100 is 12)\\n------------\\n00011000 (00000110 is 24)\"\n },\n {\n \"code\": null,\n \"e\": 30309,\n \"s\": 30305,\n \"text\": \"C++\"\n },\n {\n \"code\": null,\n \"e\": 30317,\n \"s\": 30309,\n \"text\": \"Python3\"\n },\n {\n \"code\": null,\n \"e\": 30328,\n \"s\": 30317,\n \"text\": \"Javascript\"\n },\n {\n \"code\": \"#include using namespace std;int main(){ int num = 12; int ans = num<<1; cout << ans << endl; return 0;}\",\n \"e\": 30455,\n \"s\": 30328,\n \"text\": null\n },\n {\n \"code\": \"# Python program for the above approach num = 12ans = num<<1print(ans) # This code is contributed by Shubham Singh\",\n \"e\": 30570,\n \"s\": 30455,\n \"text\": null\n },\n {\n \"code\": \"\",\n \"e\": 30727,\n \"s\": 30570,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 30730,\n \"s\": 30727,\n \"text\": \"24\"\n },\n {\n \"code\": null,\n \"e\": 31224,\n \"s\": 30730,\n \"text\": \"Bit Tricks for Competitive ProgrammingRefer BitWise Operators Articles for more articles on Bit Hacks.This article is contributed by Pankaj Mishra. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above \"\n },\n {\n \"code\": null,\n \"e\": 31230,\n \"s\": 31224,\n \"text\": \"jit_t\"\n },\n {\n \"code\": null,\n \"e\": 31247,\n \"s\": 31230,\n \"text\": \"pulamolusaimohan\"\n },\n {\n \"code\": null,\n \"e\": 31256,\n \"s\": 31247,\n \"text\": \"thedev05\"\n },\n {\n \"code\": null,\n \"e\": 31271,\n \"s\": 31256,\n \"text\": \"SHUBHAMSINGH10\"\n },\n {\n \"code\": null,\n \"e\": 31278,\n \"s\": 31271,\n \"text\": \"altyon\"\n },\n {\n \"code\": null,\n \"e\": 31290,\n \"s\": 31278,\n \"text\": \"Bitwise-XOR\"\n },\n {\n \"code\": null,\n \"e\": 31294,\n \"s\": 31290,\n \"text\": \"C++\"\n },\n {\n \"code\": null,\n \"e\": 31318,\n \"s\": 31294,\n \"text\": \"Competitive Programming\"\n },\n {\n \"code\": null,\n \"e\": 31322,\n \"s\": 31318,\n \"text\": \"CPP\"\n },\n {\n \"code\": null,\n \"e\": 31420,\n \"s\": 31322,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 31448,\n \"s\": 31420,\n \"text\": \"Operator Overloading in C++\"\n },\n {\n \"code\": null,\n \"e\": 31476,\n \"s\": 31448,\n \"text\": \"Socket Programming in C/C++\"\n },\n {\n \"code\": null,\n \"e\": 31507,\n \"s\": 31476,\n \"text\": \"Templates in C++ with Examples\"\n },\n {\n \"code\": null,\n \"e\": 31531,\n \"s\": 31507,\n \"text\": \"Copy Constructor in C++\"\n },\n {\n \"code\": null,\n \"e\": 31551,\n \"s\": 31531,\n \"text\": \"Polymorphism in C++\"\n },\n {\n \"code\": null,\n \"e\": 31594,\n \"s\": 31551,\n \"text\": \"Competitive Programming - A Complete Guide\"\n },\n {\n \"code\": null,\n \"e\": 31637,\n \"s\": 31594,\n \"text\": \"Practice for cracking any coding interview\"\n },\n {\n \"code\": null,\n \"e\": 31678,\n \"s\": 31637,\n \"text\": \"Arrow operator -> in C/C++ with Examples\"\n },\n {\n \"code\": null,\n \"e\": 31744,\n \"s\": 31678,\n \"text\": \"Top 10 Algorithms and Data Structures for Competitive Programming\"\n }\n]"}}},{"rowIdx":76517,"cells":{"title":{"kind":"string","value":"Program to find minimum swaps required to make given anagram in python"},"text":{"kind":"string","value":"Suppose we have two strings S and T and they are anagrams of each other. We have to find the minimum number of swaps required in S to make it same as T.\nSo, if the input is like S = \"kolkata\" T = \"katloka\", then the output will be 3, as can swap in this sequence [katloka (given), kotlaka, koltaka, kolkata].\nTo solve this, we will follow these steps −\nDefine a function util() . This will take S, T, i\nif i >= size of S , thenreturn 0\nreturn 0\nif S[i] is same as T[i], thenreturn util(S, T, i + 1)\nreturn util(S, T, i + 1)\nx := T[i]\nret := 99999\nfor j in range i + 1 to size of T, doif x is same as S[j], thenswap S[i] and S[j]ret := minimum of ret and (1 + util(S, T, i + 1))swap S[i] and S[j]\nif x is same as S[j], thenswap S[i] and S[j]ret := minimum of ret and (1 + util(S, T, i + 1))swap S[i] and S[j]\nswap S[i] and S[j]\nret := minimum of ret and (1 + util(S, T, i + 1))\nswap S[i] and S[j]\nreturn ret\nFrom the main method do the following:\nreturn util(S, T, 0)\nLet us see the following implementation to get better understanding −\nLive Demo\nclass Solution:\n def util(self, S, T, i) :\n S = list(S)\n T = list(T)\n if i >= len(S):\n return 0\n if S[i] == T[i]:\n return self.util(S, T, i + 1)\n x = T[i]\n ret = 99999;\n for j in range(i + 1, len(T)):\n if x == S[j]:\n S[i], S[j] = S[j], S[i]\n ret = min(ret, 1 + self.util(S, T, i + 1))\n S[i], S[j] = S[j], S[i]\n return ret\n \n def solve(self, S, T):\n return self.util(S, T, 0)\n\nob = Solution()\nS = \"kolkata\"\nT = \"katloka\"\nprint(ob.solve(S, T))\n\"kolkata\", \"katloka\"\n3"},"parsed":{"kind":"list like","value":[{"code":null,"e":1215,"s":1062,"text":"Suppose we have two strings S and T and they are anagrams of each other. We have to find the minimum number of swaps required in S to make it same as T."},{"code":null,"e":1371,"s":1215,"text":"So, if the input is like S = \"kolkata\" T = \"katloka\", then the output will be 3, as can swap in this sequence [katloka (given), kotlaka, koltaka, kolkata]."},{"code":null,"e":1415,"s":1371,"text":"To solve this, we will follow these steps −"},{"code":null,"e":1465,"s":1415,"text":"Define a function util() . This will take S, T, i"},{"code":null,"e":1498,"s":1465,"text":"if i >= size of S , thenreturn 0"},{"code":null,"e":1507,"s":1498,"text":"return 0"},{"code":null,"e":1561,"s":1507,"text":"if S[i] is same as T[i], thenreturn util(S, T, i + 1)"},{"code":null,"e":1586,"s":1561,"text":"return util(S, T, i + 1)"},{"code":null,"e":1596,"s":1586,"text":"x := T[i]"},{"code":null,"e":1609,"s":1596,"text":"ret := 99999"},{"code":null,"e":1758,"s":1609,"text":"for j in range i + 1 to size of T, doif x is same as S[j], thenswap S[i] and S[j]ret := minimum of ret and (1 + util(S, T, i + 1))swap S[i] and S[j]"},{"code":null,"e":1870,"s":1758,"text":"if x is same as S[j], thenswap S[i] and S[j]ret := minimum of ret and (1 + util(S, T, i + 1))swap S[i] and S[j]"},{"code":null,"e":1889,"s":1870,"text":"swap S[i] and S[j]"},{"code":null,"e":1939,"s":1889,"text":"ret := minimum of ret and (1 + util(S, T, i + 1))"},{"code":null,"e":1958,"s":1939,"text":"swap S[i] and S[j]"},{"code":null,"e":1969,"s":1958,"text":"return ret"},{"code":null,"e":2008,"s":1969,"text":"From the main method do the following:"},{"code":null,"e":2029,"s":2008,"text":"return util(S, T, 0)"},{"code":null,"e":2099,"s":2029,"text":"Let us see the following implementation to get better understanding −"},{"code":null,"e":2109,"s":2099,"text":"Live Demo"},{"code":null,"e":2661,"s":2109,"text":"class Solution:\n def util(self, S, T, i) :\n S = list(S)\n T = list(T)\n if i >= len(S):\n return 0\n if S[i] == T[i]:\n return self.util(S, T, i + 1)\n x = T[i]\n ret = 99999;\n for j in range(i + 1, len(T)):\n if x == S[j]:\n S[i], S[j] = S[j], S[i]\n ret = min(ret, 1 + self.util(S, T, i + 1))\n S[i], S[j] = S[j], S[i]\n return ret\n \n def solve(self, S, T):\n return self.util(S, T, 0)\n\nob = Solution()\nS = \"kolkata\"\nT = \"katloka\"\nprint(ob.solve(S, T))"},{"code":null,"e":2682,"s":2661,"text":"\"kolkata\", \"katloka\""},{"code":null,"e":2684,"s":2682,"text":"3"}],"string":"[\n {\n \"code\": null,\n \"e\": 1215,\n \"s\": 1062,\n \"text\": \"Suppose we have two strings S and T and they are anagrams of each other. We have to find the minimum number of swaps required in S to make it same as T.\"\n },\n {\n \"code\": null,\n \"e\": 1371,\n \"s\": 1215,\n \"text\": \"So, if the input is like S = \\\"kolkata\\\" T = \\\"katloka\\\", then the output will be 3, as can swap in this sequence [katloka (given), kotlaka, koltaka, kolkata].\"\n },\n {\n \"code\": null,\n \"e\": 1415,\n \"s\": 1371,\n \"text\": \"To solve this, we will follow these steps −\"\n },\n {\n \"code\": null,\n \"e\": 1465,\n \"s\": 1415,\n \"text\": \"Define a function util() . This will take S, T, i\"\n },\n {\n \"code\": null,\n \"e\": 1498,\n \"s\": 1465,\n \"text\": \"if i >= size of S , thenreturn 0\"\n },\n {\n \"code\": null,\n \"e\": 1507,\n \"s\": 1498,\n \"text\": \"return 0\"\n },\n {\n \"code\": null,\n \"e\": 1561,\n \"s\": 1507,\n \"text\": \"if S[i] is same as T[i], thenreturn util(S, T, i + 1)\"\n },\n {\n \"code\": null,\n \"e\": 1586,\n \"s\": 1561,\n \"text\": \"return util(S, T, i + 1)\"\n },\n {\n \"code\": null,\n \"e\": 1596,\n \"s\": 1586,\n \"text\": \"x := T[i]\"\n },\n {\n \"code\": null,\n \"e\": 1609,\n \"s\": 1596,\n \"text\": \"ret := 99999\"\n },\n {\n \"code\": null,\n \"e\": 1758,\n \"s\": 1609,\n \"text\": \"for j in range i + 1 to size of T, doif x is same as S[j], thenswap S[i] and S[j]ret := minimum of ret and (1 + util(S, T, i + 1))swap S[i] and S[j]\"\n },\n {\n \"code\": null,\n \"e\": 1870,\n \"s\": 1758,\n \"text\": \"if x is same as S[j], thenswap S[i] and S[j]ret := minimum of ret and (1 + util(S, T, i + 1))swap S[i] and S[j]\"\n },\n {\n \"code\": null,\n \"e\": 1889,\n \"s\": 1870,\n \"text\": \"swap S[i] and S[j]\"\n },\n {\n \"code\": null,\n \"e\": 1939,\n \"s\": 1889,\n \"text\": \"ret := minimum of ret and (1 + util(S, T, i + 1))\"\n },\n {\n \"code\": null,\n \"e\": 1958,\n \"s\": 1939,\n \"text\": \"swap S[i] and S[j]\"\n },\n {\n \"code\": null,\n \"e\": 1969,\n \"s\": 1958,\n \"text\": \"return ret\"\n },\n {\n \"code\": null,\n \"e\": 2008,\n \"s\": 1969,\n \"text\": \"From the main method do the following:\"\n },\n {\n \"code\": null,\n \"e\": 2029,\n \"s\": 2008,\n \"text\": \"return util(S, T, 0)\"\n },\n {\n \"code\": null,\n \"e\": 2099,\n \"s\": 2029,\n \"text\": \"Let us see the following implementation to get better understanding −\"\n },\n {\n \"code\": null,\n \"e\": 2109,\n \"s\": 2099,\n \"text\": \"Live Demo\"\n },\n {\n \"code\": null,\n \"e\": 2661,\n \"s\": 2109,\n \"text\": \"class Solution:\\n def util(self, S, T, i) :\\n S = list(S)\\n T = list(T)\\n if i >= len(S):\\n return 0\\n if S[i] == T[i]:\\n return self.util(S, T, i + 1)\\n x = T[i]\\n ret = 99999;\\n for j in range(i + 1, len(T)):\\n if x == S[j]:\\n S[i], S[j] = S[j], S[i]\\n ret = min(ret, 1 + self.util(S, T, i + 1))\\n S[i], S[j] = S[j], S[i]\\n return ret\\n \\n def solve(self, S, T):\\n return self.util(S, T, 0)\\n\\nob = Solution()\\nS = \\\"kolkata\\\"\\nT = \\\"katloka\\\"\\nprint(ob.solve(S, T))\"\n },\n {\n \"code\": null,\n \"e\": 2682,\n \"s\": 2661,\n \"text\": \"\\\"kolkata\\\", \\\"katloka\\\"\"\n },\n {\n \"code\": null,\n \"e\": 2684,\n \"s\": 2682,\n \"text\": \"3\"\n }\n]"}}},{"rowIdx":76518,"cells":{"title":{"kind":"string","value":"Python MongoDB - Limit"},"text":{"kind":"string","value":"While retrieving the contents of a collection you can limit the number of documents in the result using the limit() method. This method accepts a number value representing the number of documents you want in the result.\nFollowing is the syntax of the limit() method −\n>db.COLLECTION_NAME.find().limit(NUMBER)\n\nAssume we have created a collection and inserted 5 documents into it as shown below −\n> use testDB\nswitched to db testDB\n> db.createCollection(\"sample\")\n{ \"ok\" : 1 }\n> data = [\n ... {\"_id\": \"1001\", \"name\": \"Ram\", \"age\": \"26\", \"city\": \"Hyderabad\"},\n ... {\"_id\": \"1002\", \"name\": \"Rahim\", \"age\": 27, \"city\": \"Bangalore\"},\n ... {\"_id\": \"1003\", \"name\": \"Robert\", \"age\": 28, \"city\": \"Mumbai\"},\n ... {\"_id\": \"1004\", \"name\": \"Romeo\", \"age\": 25, \"city\": \"Pune\"},\n ... {\"_id\": \"1005\", \"name\": \"Sarmista\", \"age\": 23, \"city\": \"Delhi\"},\n ... {\"_id\": \"1006\", \"name\": \"Rasajna\", \"age\": 26, \"city\": \"Chennai\"}\n]\n> db.sample.insert(data)\nBulkWriteResult({\n \"writeErrors\" : [ ],\n \"writeConcernErrors\" : [ ],\n \"nInserted\" : 6,\n \"nUpserted\" : 0,\n \"nMatched\" : 0,\n \"nModified\" : 0,\n \"nRemoved\" : 0,\n \"upserted\" : [ ]\n})\nFollowing line retrieves the first 3 documents of the collection.\n> db.sample.find().limit(3)\n{ \"_id\" : \"1001\", \"name\" : \"Ram\", \"age\" : \"26\", \"city\" : \"Hyderabad\" }\n{ \"_id\" : \"1002\", \"name\" : \"Rahim\", \"age\" : 27, \"city\" : \"Bangalore\" }\n{ \"_id\" : \"1003\", \"name\" : \"Robert\", \"age\" : 28, \"city\" : \"Mumbai\" }\n\nTo restrict the results of a query to a particular number of documents pymongo provides the limit() method. To this method pass a number value representing the number of documents you need in the result.\nFollowing example retrieves first three documents in a collection.\nfrom pymongo import MongoClient\n\n#Creating a pymongo client\nclient = MongoClient('localhost', 27017)\n\n#Getting the database instance\ndb = client['l']\n\n#Creating a collection\ncoll = db['myColl']\n\n#Inserting document into a collection\ndata = [\n {\"_id\": \"1001\", \"name\": \"Ram\", \"age\": \"26\", \"city\": \"Hyderabad\"},\n {\"_id\": \"1002\", \"name\": \"Rahim\", \"age\": \"27\", \"city\": \"Bangalore\"},\n {\"_id\": \"1003\", \"name\": \"Robert\", \"age\": \"28\", \"city\": \"Mumbai\"},\n {\"_id\": \"1004\", \"name\": \"Romeo\", \"age\": 25, \"city\": \"Pune\"},\n {\"_id\": \"1005\", \"name\": \"Sarmista\", \"age\": 23, \"city\": \"Delhi\"},\n {\"_id\": \"1006\", \"name\": \"Rasajna\", \"age\": 26, \"city\": \"Chennai\"}\n]\nres = coll.insert_many(data)\nprint(\"Data inserted ......\")\n\n#Retrieving first 3 documents using the find() and limit() methods\nprint(\"First 3 documents in the collection: \")\n\nfor doc1 in coll.find().limit(3):\n print(doc1)\nData inserted ......\nFirst 3 documents in the collection:\n{'_id': '1001', 'name': 'Ram', 'age': '26', 'city': 'Hyderabad'}\n{'_id': '1002', 'name': 'Rahim', 'age': '27', 'city': 'Bangalore'}\n{'_id': '1003', 'name': 'Robert', 'age': '28', 'city': 'Mumbai'}\n\n\n 187 Lectures \n 17.5 hours \n\n Malhar Lathkar\n\n 55 Lectures \n 8 hours \n\n Arnab Chakraborty\n\n 136 Lectures \n 11 hours \n\n In28Minutes Official\n\n 75 Lectures \n 13 hours \n\n Eduonix Learning Solutions\n\n 70 Lectures \n 8.5 hours \n\n Lets Kode It\n\n 63 Lectures \n 6 hours \n\n Abhilash Nelson\n Print\n Add Notes\n Bookmark this page"},"parsed":{"kind":"list like","value":[{"code":null,"e":3425,"s":3205,"text":"While retrieving the contents of a collection you can limit the number of documents in the result using the limit() method. This method accepts a number value representing the number of documents you want in the result."},{"code":null,"e":3473,"s":3425,"text":"Following is the syntax of the limit() method −"},{"code":null,"e":3515,"s":3473,"text":">db.COLLECTION_NAME.find().limit(NUMBER)\n"},{"code":null,"e":3601,"s":3515,"text":"Assume we have created a collection and inserted 5 documents into it as shown below −"},{"code":null,"e":4342,"s":3601,"text":"> use testDB\nswitched to db testDB\n> db.createCollection(\"sample\")\n{ \"ok\" : 1 }\n> data = [\n ... {\"_id\": \"1001\", \"name\": \"Ram\", \"age\": \"26\", \"city\": \"Hyderabad\"},\n ... {\"_id\": \"1002\", \"name\": \"Rahim\", \"age\": 27, \"city\": \"Bangalore\"},\n ... {\"_id\": \"1003\", \"name\": \"Robert\", \"age\": 28, \"city\": \"Mumbai\"},\n ... {\"_id\": \"1004\", \"name\": \"Romeo\", \"age\": 25, \"city\": \"Pune\"},\n ... {\"_id\": \"1005\", \"name\": \"Sarmista\", \"age\": 23, \"city\": \"Delhi\"},\n ... {\"_id\": \"1006\", \"name\": \"Rasajna\", \"age\": 26, \"city\": \"Chennai\"}\n]\n> db.sample.insert(data)\nBulkWriteResult({\n \"writeErrors\" : [ ],\n \"writeConcernErrors\" : [ ],\n \"nInserted\" : 6,\n \"nUpserted\" : 0,\n \"nMatched\" : 0,\n \"nModified\" : 0,\n \"nRemoved\" : 0,\n \"upserted\" : [ ]\n})"},{"code":null,"e":4408,"s":4342,"text":"Following line retrieves the first 3 documents of the collection."},{"code":null,"e":4648,"s":4408,"text":"> db.sample.find().limit(3)\n{ \"_id\" : \"1001\", \"name\" : \"Ram\", \"age\" : \"26\", \"city\" : \"Hyderabad\" }\n{ \"_id\" : \"1002\", \"name\" : \"Rahim\", \"age\" : 27, \"city\" : \"Bangalore\" }\n{ \"_id\" : \"1003\", \"name\" : \"Robert\", \"age\" : 28, \"city\" : \"Mumbai\" }\n"},{"code":null,"e":4852,"s":4648,"text":"To restrict the results of a query to a particular number of documents pymongo provides the limit() method. To this method pass a number value representing the number of documents you need in the result."},{"code":null,"e":4919,"s":4852,"text":"Following example retrieves first three documents in a collection."},{"code":null,"e":5796,"s":4919,"text":"from pymongo import MongoClient\n\n#Creating a pymongo client\nclient = MongoClient('localhost', 27017)\n\n#Getting the database instance\ndb = client['l']\n\n#Creating a collection\ncoll = db['myColl']\n\n#Inserting document into a collection\ndata = [\n {\"_id\": \"1001\", \"name\": \"Ram\", \"age\": \"26\", \"city\": \"Hyderabad\"},\n {\"_id\": \"1002\", \"name\": \"Rahim\", \"age\": \"27\", \"city\": \"Bangalore\"},\n {\"_id\": \"1003\", \"name\": \"Robert\", \"age\": \"28\", \"city\": \"Mumbai\"},\n {\"_id\": \"1004\", \"name\": \"Romeo\", \"age\": 25, \"city\": \"Pune\"},\n {\"_id\": \"1005\", \"name\": \"Sarmista\", \"age\": 23, \"city\": \"Delhi\"},\n {\"_id\": \"1006\", \"name\": \"Rasajna\", \"age\": 26, \"city\": \"Chennai\"}\n]\nres = coll.insert_many(data)\nprint(\"Data inserted ......\")\n\n#Retrieving first 3 documents using the find() and limit() methods\nprint(\"First 3 documents in the collection: \")\n\nfor doc1 in coll.find().limit(3):\n print(doc1)"},{"code":null,"e":6052,"s":5796,"text":"Data inserted ......\nFirst 3 documents in the collection:\n{'_id': '1001', 'name': 'Ram', 'age': '26', 'city': 'Hyderabad'}\n{'_id': '1002', 'name': 'Rahim', 'age': '27', 'city': 'Bangalore'}\n{'_id': '1003', 'name': 'Robert', 'age': '28', 'city': 'Mumbai'}\n"},{"code":null,"e":6089,"s":6052,"text":"\n 187 Lectures \n 17.5 hours \n"},{"code":null,"e":6105,"s":6089,"text":" Malhar Lathkar"},{"code":null,"e":6138,"s":6105,"text":"\n 55 Lectures \n 8 hours \n"},{"code":null,"e":6157,"s":6138,"text":" Arnab Chakraborty"},{"code":null,"e":6192,"s":6157,"text":"\n 136 Lectures \n 11 hours \n"},{"code":null,"e":6214,"s":6192,"text":" In28Minutes Official"},{"code":null,"e":6248,"s":6214,"text":"\n 75 Lectures \n 13 hours \n"},{"code":null,"e":6276,"s":6248,"text":" Eduonix Learning Solutions"},{"code":null,"e":6311,"s":6276,"text":"\n 70 Lectures \n 8.5 hours \n"},{"code":null,"e":6325,"s":6311,"text":" Lets Kode It"},{"code":null,"e":6358,"s":6325,"text":"\n 63 Lectures \n 6 hours \n"},{"code":null,"e":6375,"s":6358,"text":" Abhilash Nelson"},{"code":null,"e":6382,"s":6375,"text":" Print"},{"code":null,"e":6393,"s":6382,"text":" Add Notes"}],"string":"[\n {\n \"code\": null,\n \"e\": 3425,\n \"s\": 3205,\n \"text\": \"While retrieving the contents of a collection you can limit the number of documents in the result using the limit() method. This method accepts a number value representing the number of documents you want in the result.\"\n },\n {\n \"code\": null,\n \"e\": 3473,\n \"s\": 3425,\n \"text\": \"Following is the syntax of the limit() method −\"\n },\n {\n \"code\": null,\n \"e\": 3515,\n \"s\": 3473,\n \"text\": \">db.COLLECTION_NAME.find().limit(NUMBER)\\n\"\n },\n {\n \"code\": null,\n \"e\": 3601,\n \"s\": 3515,\n \"text\": \"Assume we have created a collection and inserted 5 documents into it as shown below −\"\n },\n {\n \"code\": null,\n \"e\": 4342,\n \"s\": 3601,\n \"text\": \"> use testDB\\nswitched to db testDB\\n> db.createCollection(\\\"sample\\\")\\n{ \\\"ok\\\" : 1 }\\n> data = [\\n ... {\\\"_id\\\": \\\"1001\\\", \\\"name\\\": \\\"Ram\\\", \\\"age\\\": \\\"26\\\", \\\"city\\\": \\\"Hyderabad\\\"},\\n ... {\\\"_id\\\": \\\"1002\\\", \\\"name\\\": \\\"Rahim\\\", \\\"age\\\": 27, \\\"city\\\": \\\"Bangalore\\\"},\\n ... {\\\"_id\\\": \\\"1003\\\", \\\"name\\\": \\\"Robert\\\", \\\"age\\\": 28, \\\"city\\\": \\\"Mumbai\\\"},\\n ... {\\\"_id\\\": \\\"1004\\\", \\\"name\\\": \\\"Romeo\\\", \\\"age\\\": 25, \\\"city\\\": \\\"Pune\\\"},\\n ... {\\\"_id\\\": \\\"1005\\\", \\\"name\\\": \\\"Sarmista\\\", \\\"age\\\": 23, \\\"city\\\": \\\"Delhi\\\"},\\n ... {\\\"_id\\\": \\\"1006\\\", \\\"name\\\": \\\"Rasajna\\\", \\\"age\\\": 26, \\\"city\\\": \\\"Chennai\\\"}\\n]\\n> db.sample.insert(data)\\nBulkWriteResult({\\n \\\"writeErrors\\\" : [ ],\\n \\\"writeConcernErrors\\\" : [ ],\\n \\\"nInserted\\\" : 6,\\n \\\"nUpserted\\\" : 0,\\n \\\"nMatched\\\" : 0,\\n \\\"nModified\\\" : 0,\\n \\\"nRemoved\\\" : 0,\\n \\\"upserted\\\" : [ ]\\n})\"\n },\n {\n \"code\": null,\n \"e\": 4408,\n \"s\": 4342,\n \"text\": \"Following line retrieves the first 3 documents of the collection.\"\n },\n {\n \"code\": null,\n \"e\": 4648,\n \"s\": 4408,\n \"text\": \"> db.sample.find().limit(3)\\n{ \\\"_id\\\" : \\\"1001\\\", \\\"name\\\" : \\\"Ram\\\", \\\"age\\\" : \\\"26\\\", \\\"city\\\" : \\\"Hyderabad\\\" }\\n{ \\\"_id\\\" : \\\"1002\\\", \\\"name\\\" : \\\"Rahim\\\", \\\"age\\\" : 27, \\\"city\\\" : \\\"Bangalore\\\" }\\n{ \\\"_id\\\" : \\\"1003\\\", \\\"name\\\" : \\\"Robert\\\", \\\"age\\\" : 28, \\\"city\\\" : \\\"Mumbai\\\" }\\n\"\n },\n {\n \"code\": null,\n \"e\": 4852,\n \"s\": 4648,\n \"text\": \"To restrict the results of a query to a particular number of documents pymongo provides the limit() method. To this method pass a number value representing the number of documents you need in the result.\"\n },\n {\n \"code\": null,\n \"e\": 4919,\n \"s\": 4852,\n \"text\": \"Following example retrieves first three documents in a collection.\"\n },\n {\n \"code\": null,\n \"e\": 5796,\n \"s\": 4919,\n \"text\": \"from pymongo import MongoClient\\n\\n#Creating a pymongo client\\nclient = MongoClient('localhost', 27017)\\n\\n#Getting the database instance\\ndb = client['l']\\n\\n#Creating a collection\\ncoll = db['myColl']\\n\\n#Inserting document into a collection\\ndata = [\\n {\\\"_id\\\": \\\"1001\\\", \\\"name\\\": \\\"Ram\\\", \\\"age\\\": \\\"26\\\", \\\"city\\\": \\\"Hyderabad\\\"},\\n {\\\"_id\\\": \\\"1002\\\", \\\"name\\\": \\\"Rahim\\\", \\\"age\\\": \\\"27\\\", \\\"city\\\": \\\"Bangalore\\\"},\\n {\\\"_id\\\": \\\"1003\\\", \\\"name\\\": \\\"Robert\\\", \\\"age\\\": \\\"28\\\", \\\"city\\\": \\\"Mumbai\\\"},\\n {\\\"_id\\\": \\\"1004\\\", \\\"name\\\": \\\"Romeo\\\", \\\"age\\\": 25, \\\"city\\\": \\\"Pune\\\"},\\n {\\\"_id\\\": \\\"1005\\\", \\\"name\\\": \\\"Sarmista\\\", \\\"age\\\": 23, \\\"city\\\": \\\"Delhi\\\"},\\n {\\\"_id\\\": \\\"1006\\\", \\\"name\\\": \\\"Rasajna\\\", \\\"age\\\": 26, \\\"city\\\": \\\"Chennai\\\"}\\n]\\nres = coll.insert_many(data)\\nprint(\\\"Data inserted ......\\\")\\n\\n#Retrieving first 3 documents using the find() and limit() methods\\nprint(\\\"First 3 documents in the collection: \\\")\\n\\nfor doc1 in coll.find().limit(3):\\n print(doc1)\"\n },\n {\n \"code\": null,\n \"e\": 6052,\n \"s\": 5796,\n \"text\": \"Data inserted ......\\nFirst 3 documents in the collection:\\n{'_id': '1001', 'name': 'Ram', 'age': '26', 'city': 'Hyderabad'}\\n{'_id': '1002', 'name': 'Rahim', 'age': '27', 'city': 'Bangalore'}\\n{'_id': '1003', 'name': 'Robert', 'age': '28', 'city': 'Mumbai'}\\n\"\n },\n {\n \"code\": null,\n \"e\": 6089,\n \"s\": 6052,\n \"text\": \"\\n 187 Lectures \\n 17.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 6105,\n \"s\": 6089,\n \"text\": \" Malhar Lathkar\"\n },\n {\n \"code\": null,\n \"e\": 6138,\n \"s\": 6105,\n \"text\": \"\\n 55 Lectures \\n 8 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 6157,\n \"s\": 6138,\n \"text\": \" Arnab Chakraborty\"\n },\n {\n \"code\": null,\n \"e\": 6192,\n \"s\": 6157,\n \"text\": \"\\n 136 Lectures \\n 11 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 6214,\n \"s\": 6192,\n \"text\": \" In28Minutes Official\"\n },\n {\n \"code\": null,\n \"e\": 6248,\n \"s\": 6214,\n \"text\": \"\\n 75 Lectures \\n 13 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 6276,\n \"s\": 6248,\n \"text\": \" Eduonix Learning Solutions\"\n },\n {\n \"code\": null,\n \"e\": 6311,\n \"s\": 6276,\n \"text\": \"\\n 70 Lectures \\n 8.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 6325,\n \"s\": 6311,\n \"text\": \" Lets Kode It\"\n },\n {\n \"code\": null,\n \"e\": 6358,\n \"s\": 6325,\n \"text\": \"\\n 63 Lectures \\n 6 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 6375,\n \"s\": 6358,\n \"text\": \" Abhilash Nelson\"\n },\n {\n \"code\": null,\n \"e\": 6382,\n \"s\": 6375,\n \"text\": \" Print\"\n },\n {\n \"code\": null,\n \"e\": 6393,\n \"s\": 6382,\n \"text\": \" Add Notes\"\n }\n]"}}},{"rowIdx":76519,"cells":{"title":{"kind":"string","value":"How can we import data from .CSV file into MySQL table?"},"text":{"kind":"string","value":"Actually.CSV is also a text file in which the values are separated by commas or in other words we can say that text file with CSV(comma separated values). We need to use FIELDS SEPARATED OPTION with LOAD DATA INFILE statement while importing the data from .CSV file to MySQL table. We are considering the following example to make it understand −\nFollowings are the comma separated values in A.CSV file −\n105,Chum,USA,11000\n106,Danny,AUS,12000\nWe want to import this data into the following file named employee1_tbl −\nmysql> Create table employee1_tbl(Id Int, Name Varchar(20), Country Varchar(20),Salary Int);\n\nQuery OK, 0 rows affected (0.91 sec)\nNow, the transfer of data from a file to a database table can be done with the help of the following table −\nmysql> LOAD DATA LOCAL INFILE 'd:\\A.csv' INTO table employee1_tbl FIELDS TERMINATED BY ',';\nQuery OK, 2 rows affected (0.16 sec)\nRecords: 2 Deleted: 0 Skipped: 0 Warnings: 0\n\nmysql> Select * from employee1_tbl;\n+------+-------+---------+--------+\n| Id | Name | Country | Salary |\n+------+-------+---------+--------+\n| 105 | Chum | USA | 11000 |\n| 106 | Danny | AUS | 12000 |\n+------+-------+---------+--------+\n2 rows in set (0.00 sec)\nThe above result set shows that the data from A.CSV file has been transferred to the table."},"parsed":{"kind":"list like","value":[{"code":null,"e":1409,"s":1062,"text":"Actually.CSV is also a text file in which the values are separated by commas or in other words we can say that text file with CSV(comma separated values). We need to use FIELDS SEPARATED OPTION with LOAD DATA INFILE statement while importing the data from .CSV file to MySQL table. We are considering the following example to make it understand −"},{"code":null,"e":1467,"s":1409,"text":"Followings are the comma separated values in A.CSV file −"},{"code":null,"e":1506,"s":1467,"text":"105,Chum,USA,11000\n106,Danny,AUS,12000"},{"code":null,"e":1580,"s":1506,"text":"We want to import this data into the following file named employee1_tbl −"},{"code":null,"e":1711,"s":1580,"text":"mysql> Create table employee1_tbl(Id Int, Name Varchar(20), Country Varchar(20),Salary Int);\n\nQuery OK, 0 rows affected (0.91 sec)"},{"code":null,"e":1820,"s":1711,"text":"Now, the transfer of data from a file to a database table can be done with the help of the following table −"},{"code":null,"e":2272,"s":1820,"text":"mysql> LOAD DATA LOCAL INFILE 'd:\\A.csv' INTO table employee1_tbl FIELDS TERMINATED BY ',';\nQuery OK, 2 rows affected (0.16 sec)\nRecords: 2 Deleted: 0 Skipped: 0 Warnings: 0\n\nmysql> Select * from employee1_tbl;\n+------+-------+---------+--------+\n| Id | Name | Country | Salary |\n+------+-------+---------+--------+\n| 105 | Chum | USA | 11000 |\n| 106 | Danny | AUS | 12000 |\n+------+-------+---------+--------+\n2 rows in set (0.00 sec)"},{"code":null,"e":2364,"s":2272,"text":"The above result set shows that the data from A.CSV file has been transferred to the table."}],"string":"[\n {\n \"code\": null,\n \"e\": 1409,\n \"s\": 1062,\n \"text\": \"Actually.CSV is also a text file in which the values are separated by commas or in other words we can say that text file with CSV(comma separated values). We need to use FIELDS SEPARATED OPTION with LOAD DATA INFILE statement while importing the data from .CSV file to MySQL table. We are considering the following example to make it understand −\"\n },\n {\n \"code\": null,\n \"e\": 1467,\n \"s\": 1409,\n \"text\": \"Followings are the comma separated values in A.CSV file −\"\n },\n {\n \"code\": null,\n \"e\": 1506,\n \"s\": 1467,\n \"text\": \"105,Chum,USA,11000\\n106,Danny,AUS,12000\"\n },\n {\n \"code\": null,\n \"e\": 1580,\n \"s\": 1506,\n \"text\": \"We want to import this data into the following file named employee1_tbl −\"\n },\n {\n \"code\": null,\n \"e\": 1711,\n \"s\": 1580,\n \"text\": \"mysql> Create table employee1_tbl(Id Int, Name Varchar(20), Country Varchar(20),Salary Int);\\n\\nQuery OK, 0 rows affected (0.91 sec)\"\n },\n {\n \"code\": null,\n \"e\": 1820,\n \"s\": 1711,\n \"text\": \"Now, the transfer of data from a file to a database table can be done with the help of the following table −\"\n },\n {\n \"code\": null,\n \"e\": 2272,\n \"s\": 1820,\n \"text\": \"mysql> LOAD DATA LOCAL INFILE 'd:\\\\A.csv' INTO table employee1_tbl FIELDS TERMINATED BY ',';\\nQuery OK, 2 rows affected (0.16 sec)\\nRecords: 2 Deleted: 0 Skipped: 0 Warnings: 0\\n\\nmysql> Select * from employee1_tbl;\\n+------+-------+---------+--------+\\n| Id | Name | Country | Salary |\\n+------+-------+---------+--------+\\n| 105 | Chum | USA | 11000 |\\n| 106 | Danny | AUS | 12000 |\\n+------+-------+---------+--------+\\n2 rows in set (0.00 sec)\"\n },\n {\n \"code\": null,\n \"e\": 2364,\n \"s\": 2272,\n \"text\": \"The above result set shows that the data from A.CSV file has been transferred to the table.\"\n }\n]"}}},{"rowIdx":76520,"cells":{"title":{"kind":"string","value":"Classical Neural Network: What really are Nodes and Layers? | by Michael Chan | Towards Data Science"},"text":{"kind":"string","value":"We have spoken previously about activation functions, and as promised we will explain its link with the layers and the nodes in an architecture of neural networks.\nNote that this is an explanation for classical Neural Network and not specialized ones. This knowledge will despite it, be of use when studying specific neural networks.\nAlright, all being said, let’s get started.\nFirst, we will be taking as an example the following very simple architecture of neural network (NN). (fig. 1)\nInput Layer: Node1 → X | Activation: sigmoid\nHidden Layer: Node1 →N1 and Node2 → N2 (from top to bottom) | Activation: sigmoid\nOutput Layer: Node1 → M | Activation\n#This code is the keras implementation of the above described NNdef simple_nn(): model = Sequential() model.add(Dense(2, input_dim=1, activation='sigmoid')) model.add(Dense(1, activation='sigmoid')) model.compile(loss='mean_squared_error', optimizer='sgd') return model\nGiven the above notations, we get the following function (fig.2):\nHere multiple things are to be noticed:\nThe output of the neural network will always belong to [0,1]. As we mentioned in the activation functions article, the output layer activation function is very much important and pretty much defines the type of model you want to achieve (i.e classification/regression etc...)\nWith only one hidden layer composed of two nodes, we end up with a vector of weights of dimensionality 7. That puts in perspective of difficult the training is when the number of nodes increases.\nExcept for activation functions, operations are linear combinations. Again, activation functions introduce non-linearity.\nFirst of all, even though Deep Learning (studies of numerous layers NN) is a category of study by itself, it nonetheless has the same goal as classical Machine Learning: “approaching a specific underlying model/distribution from data points (most of the times)”. Therefore the goal of a NN is also to approach a distribution i.e a function, but then how so? Here intervenes some basic knowledge about Analysis, brace yourself!\nFor simplicity's sake (you can contact me if you are interested to know the more general explanation), we will be changing to the following architecture. Here is its function (fig.3):\nLet’s first start with a continuous function from reals to reals. Let’s fix ourselves the goal to approach such a function. A canonical way of starting this is to first plot the function our NN represents (fig.3). Since we do not need any specific data to explain the idea, we will not be training the NN and will simply be assigning weights arbitrarily (fig.4).\nHere is the plot (fig.5):\nSurprise! What kind of shape is this? A rectangle !!!\nSo our Neural network is actually mimicking the distribution of a rectangle (more or less). For some, this might not seem special, but for some others that have heard of Riemman Integration and step functions, for instance, will more or less see where I am heading to. Exactly, an approximation of the continuous function by step functions like neural network (not exactly a step function but summing up does the job).\nFew things again to note:\nThe sharpness of the edges for the rectangle is defined by the scalar in front of X and the position of the high-value derivative is defined by the scalar added to the product.\nTwo nodes are enough to make a rectangle, and therefore to approach the continuous function, we simply need to add nodes! (in case of an odd number of nodes, we will simply have rectangles and a step function)\nEven though it is harder to picture, the approximation of continuous function in higher dimensions works pretty much the same (except for one step where we rescale values).\nNow that we have seen such approximations, we can be confident in the power of NN to approach a distribution (even if non-continuous). But this explanation still lacks something, we arbitrarily gave some accurate weights to our NN, but unfortunately, we are unable to do such a thing in general datasets since we ignore the distribution. And here intervenes optimization techniques such as the famous SGD (Stochastic Gradient Descent) or Batch GD (etc...). Assuming that these optimizations do get us to a close enough solution, this will imply that we overperformed the original weights (for rectangles) that we were giving. Showing the example above (rectangles) is somehow giving a lower bound to accuracy, even though the mentioned technique seemed optimal, the optimization of weights might not necessarily converge toward the technique’s optimal but will again, outperform it.\nThanks for reading and stay tuned for further articles. Also, a nice click on this link (toward the affiliate program) would really help me out! You will simply have to achieve some quick tasks (simply wait and activate notifications) and all of that will really help me out for more future hardware related content!"},"parsed":{"kind":"list like","value":[{"code":null,"e":336,"s":172,"text":"We have spoken previously about activation functions, and as promised we will explain its link with the layers and the nodes in an architecture of neural networks."},{"code":null,"e":506,"s":336,"text":"Note that this is an explanation for classical Neural Network and not specialized ones. This knowledge will despite it, be of use when studying specific neural networks."},{"code":null,"e":550,"s":506,"text":"Alright, all being said, let’s get started."},{"code":null,"e":661,"s":550,"text":"First, we will be taking as an example the following very simple architecture of neural network (NN). (fig. 1)"},{"code":null,"e":706,"s":661,"text":"Input Layer: Node1 → X | Activation: sigmoid"},{"code":null,"e":788,"s":706,"text":"Hidden Layer: Node1 →N1 and Node2 → N2 (from top to bottom) | Activation: sigmoid"},{"code":null,"e":825,"s":788,"text":"Output Layer: Node1 → M | Activation"},{"code":null,"e":1110,"s":825,"text":"#This code is the keras implementation of the above described NNdef simple_nn(): model = Sequential() model.add(Dense(2, input_dim=1, activation='sigmoid')) model.add(Dense(1, activation='sigmoid')) model.compile(loss='mean_squared_error', optimizer='sgd') return model"},{"code":null,"e":1176,"s":1110,"text":"Given the above notations, we get the following function (fig.2):"},{"code":null,"e":1216,"s":1176,"text":"Here multiple things are to be noticed:"},{"code":null,"e":1492,"s":1216,"text":"The output of the neural network will always belong to [0,1]. As we mentioned in the activation functions article, the output layer activation function is very much important and pretty much defines the type of model you want to achieve (i.e classification/regression etc...)"},{"code":null,"e":1688,"s":1492,"text":"With only one hidden layer composed of two nodes, we end up with a vector of weights of dimensionality 7. That puts in perspective of difficult the training is when the number of nodes increases."},{"code":null,"e":1810,"s":1688,"text":"Except for activation functions, operations are linear combinations. Again, activation functions introduce non-linearity."},{"code":null,"e":2237,"s":1810,"text":"First of all, even though Deep Learning (studies of numerous layers NN) is a category of study by itself, it nonetheless has the same goal as classical Machine Learning: “approaching a specific underlying model/distribution from data points (most of the times)”. Therefore the goal of a NN is also to approach a distribution i.e a function, but then how so? Here intervenes some basic knowledge about Analysis, brace yourself!"},{"code":null,"e":2421,"s":2237,"text":"For simplicity's sake (you can contact me if you are interested to know the more general explanation), we will be changing to the following architecture. Here is its function (fig.3):"},{"code":null,"e":2784,"s":2421,"text":"Let’s first start with a continuous function from reals to reals. Let’s fix ourselves the goal to approach such a function. A canonical way of starting this is to first plot the function our NN represents (fig.3). Since we do not need any specific data to explain the idea, we will not be training the NN and will simply be assigning weights arbitrarily (fig.4)."},{"code":null,"e":2810,"s":2784,"text":"Here is the plot (fig.5):"},{"code":null,"e":2864,"s":2810,"text":"Surprise! What kind of shape is this? A rectangle !!!"},{"code":null,"e":3283,"s":2864,"text":"So our Neural network is actually mimicking the distribution of a rectangle (more or less). For some, this might not seem special, but for some others that have heard of Riemman Integration and step functions, for instance, will more or less see where I am heading to. Exactly, an approximation of the continuous function by step functions like neural network (not exactly a step function but summing up does the job)."},{"code":null,"e":3309,"s":3283,"text":"Few things again to note:"},{"code":null,"e":3486,"s":3309,"text":"The sharpness of the edges for the rectangle is defined by the scalar in front of X and the position of the high-value derivative is defined by the scalar added to the product."},{"code":null,"e":3696,"s":3486,"text":"Two nodes are enough to make a rectangle, and therefore to approach the continuous function, we simply need to add nodes! (in case of an odd number of nodes, we will simply have rectangles and a step function)"},{"code":null,"e":3869,"s":3696,"text":"Even though it is harder to picture, the approximation of continuous function in higher dimensions works pretty much the same (except for one step where we rescale values)."},{"code":null,"e":4752,"s":3869,"text":"Now that we have seen such approximations, we can be confident in the power of NN to approach a distribution (even if non-continuous). But this explanation still lacks something, we arbitrarily gave some accurate weights to our NN, but unfortunately, we are unable to do such a thing in general datasets since we ignore the distribution. And here intervenes optimization techniques such as the famous SGD (Stochastic Gradient Descent) or Batch GD (etc...). Assuming that these optimizations do get us to a close enough solution, this will imply that we overperformed the original weights (for rectangles) that we were giving. Showing the example above (rectangles) is somehow giving a lower bound to accuracy, even though the mentioned technique seemed optimal, the optimization of weights might not necessarily converge toward the technique’s optimal but will again, outperform it."}],"string":"[\n {\n \"code\": null,\n \"e\": 336,\n \"s\": 172,\n \"text\": \"We have spoken previously about activation functions, and as promised we will explain its link with the layers and the nodes in an architecture of neural networks.\"\n },\n {\n \"code\": null,\n \"e\": 506,\n \"s\": 336,\n \"text\": \"Note that this is an explanation for classical Neural Network and not specialized ones. This knowledge will despite it, be of use when studying specific neural networks.\"\n },\n {\n \"code\": null,\n \"e\": 550,\n \"s\": 506,\n \"text\": \"Alright, all being said, let’s get started.\"\n },\n {\n \"code\": null,\n \"e\": 661,\n \"s\": 550,\n \"text\": \"First, we will be taking as an example the following very simple architecture of neural network (NN). (fig. 1)\"\n },\n {\n \"code\": null,\n \"e\": 706,\n \"s\": 661,\n \"text\": \"Input Layer: Node1 → X | Activation: sigmoid\"\n },\n {\n \"code\": null,\n \"e\": 788,\n \"s\": 706,\n \"text\": \"Hidden Layer: Node1 →N1 and Node2 → N2 (from top to bottom) | Activation: sigmoid\"\n },\n {\n \"code\": null,\n \"e\": 825,\n \"s\": 788,\n \"text\": \"Output Layer: Node1 → M | Activation\"\n },\n {\n \"code\": null,\n \"e\": 1110,\n \"s\": 825,\n \"text\": \"#This code is the keras implementation of the above described NNdef simple_nn(): model = Sequential() model.add(Dense(2, input_dim=1, activation='sigmoid')) model.add(Dense(1, activation='sigmoid')) model.compile(loss='mean_squared_error', optimizer='sgd') return model\"\n },\n {\n \"code\": null,\n \"e\": 1176,\n \"s\": 1110,\n \"text\": \"Given the above notations, we get the following function (fig.2):\"\n },\n {\n \"code\": null,\n \"e\": 1216,\n \"s\": 1176,\n \"text\": \"Here multiple things are to be noticed:\"\n },\n {\n \"code\": null,\n \"e\": 1492,\n \"s\": 1216,\n \"text\": \"The output of the neural network will always belong to [0,1]. As we mentioned in the activation functions article, the output layer activation function is very much important and pretty much defines the type of model you want to achieve (i.e classification/regression etc...)\"\n },\n {\n \"code\": null,\n \"e\": 1688,\n \"s\": 1492,\n \"text\": \"With only one hidden layer composed of two nodes, we end up with a vector of weights of dimensionality 7. That puts in perspective of difficult the training is when the number of nodes increases.\"\n },\n {\n \"code\": null,\n \"e\": 1810,\n \"s\": 1688,\n \"text\": \"Except for activation functions, operations are linear combinations. Again, activation functions introduce non-linearity.\"\n },\n {\n \"code\": null,\n \"e\": 2237,\n \"s\": 1810,\n \"text\": \"First of all, even though Deep Learning (studies of numerous layers NN) is a category of study by itself, it nonetheless has the same goal as classical Machine Learning: “approaching a specific underlying model/distribution from data points (most of the times)”. Therefore the goal of a NN is also to approach a distribution i.e a function, but then how so? Here intervenes some basic knowledge about Analysis, brace yourself!\"\n },\n {\n \"code\": null,\n \"e\": 2421,\n \"s\": 2237,\n \"text\": \"For simplicity's sake (you can contact me if you are interested to know the more general explanation), we will be changing to the following architecture. Here is its function (fig.3):\"\n },\n {\n \"code\": null,\n \"e\": 2784,\n \"s\": 2421,\n \"text\": \"Let’s first start with a continuous function from reals to reals. Let’s fix ourselves the goal to approach such a function. A canonical way of starting this is to first plot the function our NN represents (fig.3). Since we do not need any specific data to explain the idea, we will not be training the NN and will simply be assigning weights arbitrarily (fig.4).\"\n },\n {\n \"code\": null,\n \"e\": 2810,\n \"s\": 2784,\n \"text\": \"Here is the plot (fig.5):\"\n },\n {\n \"code\": null,\n \"e\": 2864,\n \"s\": 2810,\n \"text\": \"Surprise! What kind of shape is this? A rectangle !!!\"\n },\n {\n \"code\": null,\n \"e\": 3283,\n \"s\": 2864,\n \"text\": \"So our Neural network is actually mimicking the distribution of a rectangle (more or less). For some, this might not seem special, but for some others that have heard of Riemman Integration and step functions, for instance, will more or less see where I am heading to. Exactly, an approximation of the continuous function by step functions like neural network (not exactly a step function but summing up does the job).\"\n },\n {\n \"code\": null,\n \"e\": 3309,\n \"s\": 3283,\n \"text\": \"Few things again to note:\"\n },\n {\n \"code\": null,\n \"e\": 3486,\n \"s\": 3309,\n \"text\": \"The sharpness of the edges for the rectangle is defined by the scalar in front of X and the position of the high-value derivative is defined by the scalar added to the product.\"\n },\n {\n \"code\": null,\n \"e\": 3696,\n \"s\": 3486,\n \"text\": \"Two nodes are enough to make a rectangle, and therefore to approach the continuous function, we simply need to add nodes! (in case of an odd number of nodes, we will simply have rectangles and a step function)\"\n },\n {\n \"code\": null,\n \"e\": 3869,\n \"s\": 3696,\n \"text\": \"Even though it is harder to picture, the approximation of continuous function in higher dimensions works pretty much the same (except for one step where we rescale values).\"\n },\n {\n \"code\": null,\n \"e\": 4752,\n \"s\": 3869,\n \"text\": \"Now that we have seen such approximations, we can be confident in the power of NN to approach a distribution (even if non-continuous). But this explanation still lacks something, we arbitrarily gave some accurate weights to our NN, but unfortunately, we are unable to do such a thing in general datasets since we ignore the distribution. And here intervenes optimization techniques such as the famous SGD (Stochastic Gradient Descent) or Batch GD (etc...). Assuming that these optimizations do get us to a close enough solution, this will imply that we overperformed the original weights (for rectangles) that we were giving. Showing the example above (rectangles) is somehow giving a lower bound to accuracy, even though the mentioned technique seemed optimal, the optimization of weights might not necessarily converge toward the technique’s optimal but will again, outperform it.\"\n }\n]"}}},{"rowIdx":76521,"cells":{"title":{"kind":"string","value":"Compressing string in JavaScript"},"text":{"kind":"string","value":"We are required to write a JavaScript function that takes in a string that might contain some continuous repeating characters.\nThe function should compress the string like this −\n'wwwaabbbb' -> 'w3a2b4'\n'kkkkj' -> 'k4j'\nAnd if the length of the compressed string is greater than or equal to the original string we should return the original string.\nFor example −\n'aab' can be compressed to 'a2b1' but it increases its length to 4 so our function should return 'aab'\nThe code for this will be −\n Live Demo\nconst str1 = 'wwwaabbbb';\nconst str2 = 'kkkkj';\nconst str3 = 'aab';\nconst compressString = (str = '') => {\n let res = '';\n let count = 1;\n for(let i = 0; i < str.length; i++){\n let cur = str[i];\n let next = str[i + 1];\n if(cur === next){\n count++;\n }else{\n res += cur + String(count);\n count = 1;\n };\n }\n return res.length < str.length ? res : str;\n};\nconsole.log(compressString(str1));\nconsole.log(compressString(str2));\nconsole.log(compressString(str3));\nAnd the output in the console will be −\n3a2b4\nk4j1\naab"},"parsed":{"kind":"list like","value":[{"code":null,"e":1189,"s":1062,"text":"We are required to write a JavaScript function that takes in a string that might contain some continuous repeating characters."},{"code":null,"e":1241,"s":1189,"text":"The function should compress the string like this −"},{"code":null,"e":1282,"s":1241,"text":"'wwwaabbbb' -> 'w3a2b4'\n'kkkkj' -> 'k4j'"},{"code":null,"e":1411,"s":1282,"text":"And if the length of the compressed string is greater than or equal to the original string we should return the original string."},{"code":null,"e":1425,"s":1411,"text":"For example −"},{"code":null,"e":1528,"s":1425,"text":"'aab' can be compressed to 'a2b1' but it increases its length to 4 so our function should return 'aab'"},{"code":null,"e":1556,"s":1528,"text":"The code for this will be −"},{"code":null,"e":1567,"s":1556,"text":" Live Demo"},{"code":null,"e":2083,"s":1567,"text":"const str1 = 'wwwaabbbb';\nconst str2 = 'kkkkj';\nconst str3 = 'aab';\nconst compressString = (str = '') => {\n let res = '';\n let count = 1;\n for(let i = 0; i < str.length; i++){\n let cur = str[i];\n let next = str[i + 1];\n if(cur === next){\n count++;\n }else{\n res += cur + String(count);\n count = 1;\n };\n }\n return res.length < str.length ? res : str;\n};\nconsole.log(compressString(str1));\nconsole.log(compressString(str2));\nconsole.log(compressString(str3));"},{"code":null,"e":2123,"s":2083,"text":"And the output in the console will be −"},{"code":null,"e":2138,"s":2123,"text":"3a2b4\nk4j1\naab"}],"string":"[\n {\n \"code\": null,\n \"e\": 1189,\n \"s\": 1062,\n \"text\": \"We are required to write a JavaScript function that takes in a string that might contain some continuous repeating characters.\"\n },\n {\n \"code\": null,\n \"e\": 1241,\n \"s\": 1189,\n \"text\": \"The function should compress the string like this −\"\n },\n {\n \"code\": null,\n \"e\": 1282,\n \"s\": 1241,\n \"text\": \"'wwwaabbbb' -> 'w3a2b4'\\n'kkkkj' -> 'k4j'\"\n },\n {\n \"code\": null,\n \"e\": 1411,\n \"s\": 1282,\n \"text\": \"And if the length of the compressed string is greater than or equal to the original string we should return the original string.\"\n },\n {\n \"code\": null,\n \"e\": 1425,\n \"s\": 1411,\n \"text\": \"For example −\"\n },\n {\n \"code\": null,\n \"e\": 1528,\n \"s\": 1425,\n \"text\": \"'aab' can be compressed to 'a2b1' but it increases its length to 4 so our function should return 'aab'\"\n },\n {\n \"code\": null,\n \"e\": 1556,\n \"s\": 1528,\n \"text\": \"The code for this will be −\"\n },\n {\n \"code\": null,\n \"e\": 1567,\n \"s\": 1556,\n \"text\": \" Live Demo\"\n },\n {\n \"code\": null,\n \"e\": 2083,\n \"s\": 1567,\n \"text\": \"const str1 = 'wwwaabbbb';\\nconst str2 = 'kkkkj';\\nconst str3 = 'aab';\\nconst compressString = (str = '') => {\\n let res = '';\\n let count = 1;\\n for(let i = 0; i < str.length; i++){\\n let cur = str[i];\\n let next = str[i + 1];\\n if(cur === next){\\n count++;\\n }else{\\n res += cur + String(count);\\n count = 1;\\n };\\n }\\n return res.length < str.length ? res : str;\\n};\\nconsole.log(compressString(str1));\\nconsole.log(compressString(str2));\\nconsole.log(compressString(str3));\"\n },\n {\n \"code\": null,\n \"e\": 2123,\n \"s\": 2083,\n \"text\": \"And the output in the console will be −\"\n },\n {\n \"code\": null,\n \"e\": 2138,\n \"s\": 2123,\n \"text\": \"3a2b4\\nk4j1\\naab\"\n }\n]"}}},{"rowIdx":76522,"cells":{"title":{"kind":"string","value":"Scope of Variables in C#"},"text":{"kind":"string","value":"The scope of a variable is a region of code that indicates where the variables are being accessed.\nFor a variable, it has the following levels −\nVariable declared inside a method is a local variable.\nVariable declared inside a class is a local variable are class member variables.\nLet us see an example of scope of variables −\n Live Demo\nusing System;\n\nnamespace Demo {\n class Program {\n public int Divide(int num1, int num2) {\n // local variable in a method\n int result;\n result = num1 / num2;\n return result;\n }\n static void Main(string[] args) {\n // local variable\n int a = 150;\n int b = 10;\n int res;\n Program p = new Program();\n res = p.Divide(a, b);\n Console.WriteLine(\"Division Result = {0}\", res );\n Console.ReadLine();\n }\n }\n}\nDivision Result = 15"},"parsed":{"kind":"list like","value":[{"code":null,"e":1161,"s":1062,"text":"The scope of a variable is a region of code that indicates where the variables are being accessed."},{"code":null,"e":1207,"s":1161,"text":"For a variable, it has the following levels −"},{"code":null,"e":1262,"s":1207,"text":"Variable declared inside a method is a local variable."},{"code":null,"e":1343,"s":1262,"text":"Variable declared inside a class is a local variable are class member variables."},{"code":null,"e":1389,"s":1343,"text":"Let us see an example of scope of variables −"},{"code":null,"e":1400,"s":1389,"text":" Live Demo"},{"code":null,"e":1918,"s":1400,"text":"using System;\n\nnamespace Demo {\n class Program {\n public int Divide(int num1, int num2) {\n // local variable in a method\n int result;\n result = num1 / num2;\n return result;\n }\n static void Main(string[] args) {\n // local variable\n int a = 150;\n int b = 10;\n int res;\n Program p = new Program();\n res = p.Divide(a, b);\n Console.WriteLine(\"Division Result = {0}\", res );\n Console.ReadLine();\n }\n }\n}"},{"code":null,"e":1939,"s":1918,"text":"Division Result = 15"}],"string":"[\n {\n \"code\": null,\n \"e\": 1161,\n \"s\": 1062,\n \"text\": \"The scope of a variable is a region of code that indicates where the variables are being accessed.\"\n },\n {\n \"code\": null,\n \"e\": 1207,\n \"s\": 1161,\n \"text\": \"For a variable, it has the following levels −\"\n },\n {\n \"code\": null,\n \"e\": 1262,\n \"s\": 1207,\n \"text\": \"Variable declared inside a method is a local variable.\"\n },\n {\n \"code\": null,\n \"e\": 1343,\n \"s\": 1262,\n \"text\": \"Variable declared inside a class is a local variable are class member variables.\"\n },\n {\n \"code\": null,\n \"e\": 1389,\n \"s\": 1343,\n \"text\": \"Let us see an example of scope of variables −\"\n },\n {\n \"code\": null,\n \"e\": 1400,\n \"s\": 1389,\n \"text\": \" Live Demo\"\n },\n {\n \"code\": null,\n \"e\": 1918,\n \"s\": 1400,\n \"text\": \"using System;\\n\\nnamespace Demo {\\n class Program {\\n public int Divide(int num1, int num2) {\\n // local variable in a method\\n int result;\\n result = num1 / num2;\\n return result;\\n }\\n static void Main(string[] args) {\\n // local variable\\n int a = 150;\\n int b = 10;\\n int res;\\n Program p = new Program();\\n res = p.Divide(a, b);\\n Console.WriteLine(\\\"Division Result = {0}\\\", res );\\n Console.ReadLine();\\n }\\n }\\n}\"\n },\n {\n \"code\": null,\n \"e\": 1939,\n \"s\": 1918,\n \"text\": \"Division Result = 15\"\n }\n]"}}},{"rowIdx":76523,"cells":{"title":{"kind":"string","value":"Spring Boot - Database Handling"},"text":{"kind":"string","value":"Spring Boot provides a very good support to create a DataSource for Database. We need not write any extra code to create a DataSource in Spring Boot. Just adding the dependencies and doing the configuration details is enough to create a DataSource and connect the Database.\nIn this chapter, we are going to use Spring Boot JDBC driver connection to connect the database.\nFirst, we need to add the Spring Boot Starter JDBC dependency in our build configuration file.\nMaven users can add the following dependencies in the pom.xml file.\n\n org.springframework.boot\n spring-boot-starter-jdbc\n\nGradle users can add the following dependencies in the build.gradle file.\ncompile('org.springframework.boot:spring-boot-starter-jdbc')\n\nTo connect the H2 database, we need to add the H2 database dependency in our build configuration file.\nFor Maven users, add the below dependency in your pom.xml file.\n\n com.h2database\n h2\n\nFor Gradle users, add the below dependency in your build.gradle file.\ncompile('com.h2database:h2')\n\nWe need to create the schema.sql file and data.sql file under the classpath src/main/resources directory to connect the H2 database.\nThe schema.sql file is given below.\nCREATE TABLE PRODUCT (ID INT PRIMARY KEY, PRODUCT_NAME VARCHAR(25));\n\nThe data.sql file is given below.\nINSERT INTO PRODUCT (ID,PRODUCT_NAME) VALUES (1,'Honey');\nINSERT INTO PRODUCT (ID,PRODUCT_NAME) VALUES (2,'Almond');\n\nTo connect the MySQL database, we need to add the MySQL dependency into our build configuration file.\nFor Maven users, add the following dependency in your pom.xml file.\n\n mysql\n mysql-connector-java\n\nFor Gradle users, add the following dependency in your build.gradle file.\ncompile('mysql:mysql-connector-java')\n\nNow, create database and tables in MySQL as shown −\nFor properties file users, add the following properties in the application.properties file.\nspring.datasource.driverClassName = com.mysql.jdbc.Driver\nspring.datasource.url = jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect = true\nspring.datasource.username = root\nspring.datasource.password = root\nspring.datasource.testOnBorrow = true\nspring.datasource.testWhileIdle = true\nspring.datasource.timeBetweenEvictionRunsMillis = 60000\nspring.datasource.minEvictableIdleTimeMillis = 30000\nspring.datasource.validationQuery = SELECT 1\nspring.datasource.max-active = 15\nspring.datasource.max-idle = 10\nspring.datasource.max-wait = 8000\nFor YAML users, add the following properties in the application.yml file.\nspring:\n datasource: \n driverClassName: com.mysql.jdbc.Driver\n url: \"jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect=true\"\n username: \"root\"\n password: \"root\"\n testOnBorrow: true\n testWhileIdle: true\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 30000\n validationQuery: SELECT 1\n max-active: 15\n max-idle: 10\n max-wait: 8000\nRedis is an open source database used to store the in-memory data structure. To connect the Redis database in Spring Boot application, we need to add the Redis dependency in our build configuration file.\nMaven users should add the following dependency in your pom.xml file.\n\n org.springframework.boot\n spring-boot-starter-redis\n\nGradle users should add the following dependency in your build.gradle file.\ncompile('org.springframework.boot:spring-boot-starter-data-redis')\n\nFor Redis connection, we need to use RedisTemplate. For RedisTemplate we need to provide the JedisConnectionFactory details.\n@Bean\nJedisConnectionFactory jedisConnectionFactory() {\n JedisConnectionFactory jedisConFactory = new JedisConnectionFactory();\n jedisConFactory.setHostName(\"localhost\");\n jedisConFactory.setPort(6000);\n jedisConFactory.setUsePool(true);\n return jedisConFactory;\n}\n@Bean\npublic RedisTemplate redisTemplate() {\n RedisTemplate template = new RedisTemplate<>();\n template.setConnectionFactory(jedisConnectionFactory());\n template.setKeySerializer(new StringRedisSerializer());\n template.setHashKeySerializer(new StringRedisSerializer());\n template.setHashValueSerializer(new StringRedisSerializer());\n template.setValueSerializer(new StringRedisSerializer());\n return template;\n}\nNow auto wire the RedisTemplate class and access the data from Redis database.\n@Autowired\n\nRedisTemplate redis;\nMap datalist = redis.opsForHash().entries(“Redis_code_index_key”);\nTo access the Relational Database by using JdbcTemplate in Spring Boot application, we need to add the Spring Boot Starter JDBC dependency in our build configuration file.\nThen, if you @Autowired the JdbcTemplate class, Spring Boot automatically connects the Database and sets the Datasource for the JdbcTemplate object.\n@Autowired\nJdbcTemplate jdbcTemplate;\nCollection> rows = jdbc.queryForList(\"SELECT QUERY\");\nThe @Repository annotation should be added into the class file. The @Repository annotation is used to create database repository for your Spring Boot application.\n@Repository\npublic class ProductServiceDAO {\n}\nWe can keep ‘n’ number Datasources in a single Spring Boot application. The example given here shows how to create more than 1 data source in Spring Boot application. Now, add the two data source configuration details in the application properties file.\nFor properties file users, add the following properties into your application.properties file.\nspring.dbProductService.driverClassName = com.mysql.jdbc.Driver\nspring.dbProductService.url = jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect = true\nspring.dbProductService.username = root\nspring.dbProductService.password = root\nspring.dbProductService.testOnBorrow = true\nspring.dbProductService.testWhileIdle = true\nspring.dbProductService.timeBetweenEvictionRunsMillis = 60000\nspring.dbProductService.minEvictableIdleTimeMillis = 30000\nspring.dbProductService.validationQuery = SELECT 1\nspring.dbProductService.max-active = 15\nspring.dbProductService.max-idle = 10\nspring.dbProductService.max-wait = 8000\n\nspring.dbUserService.driverClassName = com.mysql.jdbc.Driver\nspring.dbUserService.url = jdbc:mysql://localhost:3306/USERSERVICE?autoreconnect = true\nspring.dbUserService.username = root\nspring.dbUserService.password = root\nspring.dbUserService.testOnBorrow = true\nspring.dbUserService.testWhileIdle = true\nspring.dbUserService.timeBetweenEvictionRunsMillis = 60000\nspring.dbUserService.minEvictableIdleTimeMillis = 30000\nspring.dbUserService.validationQuery = SELECT 1\nspring.dbUserService.max-active = 15\nspring.dbUserService.max-idle = 10\nspring.dbUserService.max-wait = 8000\nYaml users should add the following properties in your application.yml file.\nspring:\n dbProductService: \n driverClassName: com.mysql.jdbc.Driver\n url: \"jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect=true\"\n password: \"root\"\n username: \"root\"\n testOnBorrow: true\n testWhileIdle: true\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 30000\n validationQuery: SELECT 1\n max-active: 15\n max-idle: 10\n max-wait: 8000\n dbUserService: \n driverClassName: com.mysql.jdbc.Driver\n url: \"jdbc:mysql://localhost:3306/USERSERVICE?autoreconnect=true\"\n password: \"root\"\n username: \"root\"\n testOnBorrow: true\n testWhileIdle: true\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 30000\n validationQuery: SELECT 1 \n max-active: 15\n max-idle: 10\n max-wait: 8000\nNow, create a Configuration class to create a DataSource and JdbcTemplate for multiple data sources.\nimport javax.sql.DataSource;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;\nimport org.springframework.boot.context.properties.ConfigurationProperties;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Primary;\nimport org.springframework.jdbc.core.JdbcTemplate;\n\n@Configuration\npublic class DatabaseConfig {\n @Bean(name = \"dbProductService\")\n @ConfigurationProperties(prefix = \"spring.dbProductService\")\n @Primary\n public DataSource createProductServiceDataSource() {\n return DataSourceBuilder.create().build();\n }\n @Bean(name = \"dbUserService\")\n @ConfigurationProperties(prefix = \"spring.dbUserService\")\n public DataSource createUserServiceDataSource() {\n return DataSourceBuilder.create().build();\n }\n @Bean(name = \"jdbcProductService\")\n @Autowired\n public JdbcTemplate createJdbcTemplate_ProductService(@Qualifier(\"dbProductService\") DataSource productServiceDS) {\n return new JdbcTemplate(productServiceDS);\n }\n @Bean(name = \"jdbcUserService\")\n @Autowired\n public JdbcTemplate createJdbcTemplate_UserService(@Qualifier(\"dbUserService\") DataSource userServiceDS) {\n return new JdbcTemplate(userServiceDS);\n }\n}\nThen, auto wire the JDBCTemplate object by using @Qualifier annotation.\n@Qualifier(\"jdbcProductService\")\n@Autowired\nJdbcTemplate jdbcTemplate;\n\n@Qualifier(\"jdbcUserService\")\n@Autowired\nJdbcTemplate jdbcTemplate;\n\n 102 Lectures \n 8 hours \n\n Karthikeya T\n\n 39 Lectures \n 5 hours \n\n Chaand Sheikh\n\n 73 Lectures \n 5.5 hours \n\n Senol Atac\n\n 62 Lectures \n 4.5 hours \n\n Senol Atac\n\n 67 Lectures \n 4.5 hours \n\n Senol Atac\n\n 69 Lectures \n 5 hours \n\n Senol Atac\n Print\n Add Notes\n Bookmark this page"},"parsed":{"kind":"list like","value":[{"code":null,"e":3299,"s":3025,"text":"Spring Boot provides a very good support to create a DataSource for Database. We need not write any extra code to create a DataSource in Spring Boot. Just adding the dependencies and doing the configuration details is enough to create a DataSource and connect the Database."},{"code":null,"e":3396,"s":3299,"text":"In this chapter, we are going to use Spring Boot JDBC driver connection to connect the database."},{"code":null,"e":3491,"s":3396,"text":"First, we need to add the Spring Boot Starter JDBC dependency in our build configuration file."},{"code":null,"e":3559,"s":3491,"text":"Maven users can add the following dependencies in the pom.xml file."},{"code":null,"e":3686,"s":3559,"text":"\n org.springframework.boot\n spring-boot-starter-jdbc\n"},{"code":null,"e":3760,"s":3686,"text":"Gradle users can add the following dependencies in the build.gradle file."},{"code":null,"e":3822,"s":3760,"text":"compile('org.springframework.boot:spring-boot-starter-jdbc')\n"},{"code":null,"e":3925,"s":3822,"text":"To connect the H2 database, we need to add the H2 database dependency in our build configuration file."},{"code":null,"e":3989,"s":3925,"text":"For Maven users, add the below dependency in your pom.xml file."},{"code":null,"e":4084,"s":3989,"text":"\n com.h2database\n h2\n"},{"code":null,"e":4154,"s":4084,"text":"For Gradle users, add the below dependency in your build.gradle file."},{"code":null,"e":4184,"s":4154,"text":"compile('com.h2database:h2')\n"},{"code":null,"e":4317,"s":4184,"text":"We need to create the schema.sql file and data.sql file under the classpath src/main/resources directory to connect the H2 database."},{"code":null,"e":4353,"s":4317,"text":"The schema.sql file is given below."},{"code":null,"e":4423,"s":4353,"text":"CREATE TABLE PRODUCT (ID INT PRIMARY KEY, PRODUCT_NAME VARCHAR(25));\n"},{"code":null,"e":4457,"s":4423,"text":"The data.sql file is given below."},{"code":null,"e":4575,"s":4457,"text":"INSERT INTO PRODUCT (ID,PRODUCT_NAME) VALUES (1,'Honey');\nINSERT INTO PRODUCT (ID,PRODUCT_NAME) VALUES (2,'Almond');\n"},{"code":null,"e":4677,"s":4575,"text":"To connect the MySQL database, we need to add the MySQL dependency into our build configuration file."},{"code":null,"e":4745,"s":4677,"text":"For Maven users, add the following dependency in your pom.xml file."},{"code":null,"e":4849,"s":4745,"text":"\n mysql\n mysql-connector-java\n"},{"code":null,"e":4923,"s":4849,"text":"For Gradle users, add the following dependency in your build.gradle file."},{"code":null,"e":4962,"s":4923,"text":"compile('mysql:mysql-connector-java')\n"},{"code":null,"e":5014,"s":4962,"text":"Now, create database and tables in MySQL as shown −"},{"code":null,"e":5106,"s":5014,"text":"For properties file users, add the following properties in the application.properties file."},{"code":null,"e":5651,"s":5106,"text":"spring.datasource.driverClassName = com.mysql.jdbc.Driver\nspring.datasource.url = jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect = true\nspring.datasource.username = root\nspring.datasource.password = root\nspring.datasource.testOnBorrow = true\nspring.datasource.testWhileIdle = true\nspring.datasource.timeBetweenEvictionRunsMillis = 60000\nspring.datasource.minEvictableIdleTimeMillis = 30000\nspring.datasource.validationQuery = SELECT 1\nspring.datasource.max-active = 15\nspring.datasource.max-idle = 10\nspring.datasource.max-wait = 8000"},{"code":null,"e":5725,"s":5651,"text":"For YAML users, add the following properties in the application.yml file."},{"code":null,"e":6142,"s":5725,"text":"spring:\n datasource: \n driverClassName: com.mysql.jdbc.Driver\n url: \"jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect=true\"\n username: \"root\"\n password: \"root\"\n testOnBorrow: true\n testWhileIdle: true\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 30000\n validationQuery: SELECT 1\n max-active: 15\n max-idle: 10\n max-wait: 8000"},{"code":null,"e":6346,"s":6142,"text":"Redis is an open source database used to store the in-memory data structure. To connect the Redis database in Spring Boot application, we need to add the Redis dependency in our build configuration file."},{"code":null,"e":6416,"s":6346,"text":"Maven users should add the following dependency in your pom.xml file."},{"code":null,"e":6544,"s":6416,"text":"\n org.springframework.boot\n spring-boot-starter-redis\n"},{"code":null,"e":6620,"s":6544,"text":"Gradle users should add the following dependency in your build.gradle file."},{"code":null,"e":6688,"s":6620,"text":"compile('org.springframework.boot:spring-boot-starter-data-redis')\n"},{"code":null,"e":6813,"s":6688,"text":"For Redis connection, we need to use RedisTemplate. For RedisTemplate we need to provide the JedisConnectionFactory details."},{"code":null,"e":7546,"s":6813,"text":"@Bean\nJedisConnectionFactory jedisConnectionFactory() {\n JedisConnectionFactory jedisConFactory = new JedisConnectionFactory();\n jedisConFactory.setHostName(\"localhost\");\n jedisConFactory.setPort(6000);\n jedisConFactory.setUsePool(true);\n return jedisConFactory;\n}\n@Bean\npublic RedisTemplate redisTemplate() {\n RedisTemplate template = new RedisTemplate<>();\n template.setConnectionFactory(jedisConnectionFactory());\n template.setKeySerializer(new StringRedisSerializer());\n template.setHashKeySerializer(new StringRedisSerializer());\n template.setHashValueSerializer(new StringRedisSerializer());\n template.setValueSerializer(new StringRedisSerializer());\n return template;\n}"},{"code":null,"e":7625,"s":7546,"text":"Now auto wire the RedisTemplate class and access the data from Redis database."},{"code":null,"e":7756,"s":7625,"text":"@Autowired\n\nRedisTemplate redis;\nMap datalist = redis.opsForHash().entries(“Redis_code_index_key”);"},{"code":null,"e":7928,"s":7756,"text":"To access the Relational Database by using JdbcTemplate in Spring Boot application, we need to add the Spring Boot Starter JDBC dependency in our build configuration file."},{"code":null,"e":8077,"s":7928,"text":"Then, if you @Autowired the JdbcTemplate class, Spring Boot automatically connects the Database and sets the Datasource for the JdbcTemplate object."},{"code":null,"e":8189,"s":8077,"text":"@Autowired\nJdbcTemplate jdbcTemplate;\nCollection> rows = jdbc.queryForList(\"SELECT QUERY\");"},{"code":null,"e":8352,"s":8189,"text":"The @Repository annotation should be added into the class file. The @Repository annotation is used to create database repository for your Spring Boot application."},{"code":null,"e":8399,"s":8352,"text":"@Repository\npublic class ProductServiceDAO {\n}"},{"code":null,"e":8653,"s":8399,"text":"We can keep ‘n’ number Datasources in a single Spring Boot application. The example given here shows how to create more than 1 data source in Spring Boot application. Now, add the two data source configuration details in the application properties file."},{"code":null,"e":8748,"s":8653,"text":"For properties file users, add the following properties into your application.properties file."},{"code":null,"e":9944,"s":8748,"text":"spring.dbProductService.driverClassName = com.mysql.jdbc.Driver\nspring.dbProductService.url = jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect = true\nspring.dbProductService.username = root\nspring.dbProductService.password = root\nspring.dbProductService.testOnBorrow = true\nspring.dbProductService.testWhileIdle = true\nspring.dbProductService.timeBetweenEvictionRunsMillis = 60000\nspring.dbProductService.minEvictableIdleTimeMillis = 30000\nspring.dbProductService.validationQuery = SELECT 1\nspring.dbProductService.max-active = 15\nspring.dbProductService.max-idle = 10\nspring.dbProductService.max-wait = 8000\n\nspring.dbUserService.driverClassName = com.mysql.jdbc.Driver\nspring.dbUserService.url = jdbc:mysql://localhost:3306/USERSERVICE?autoreconnect = true\nspring.dbUserService.username = root\nspring.dbUserService.password = root\nspring.dbUserService.testOnBorrow = true\nspring.dbUserService.testWhileIdle = true\nspring.dbUserService.timeBetweenEvictionRunsMillis = 60000\nspring.dbUserService.minEvictableIdleTimeMillis = 30000\nspring.dbUserService.validationQuery = SELECT 1\nspring.dbUserService.max-active = 15\nspring.dbUserService.max-idle = 10\nspring.dbUserService.max-wait = 8000"},{"code":null,"e":10021,"s":9944,"text":"Yaml users should add the following properties in your application.yml file."},{"code":null,"e":10857,"s":10021,"text":"spring:\n dbProductService: \n driverClassName: com.mysql.jdbc.Driver\n url: \"jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect=true\"\n password: \"root\"\n username: \"root\"\n testOnBorrow: true\n testWhileIdle: true\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 30000\n validationQuery: SELECT 1\n max-active: 15\n max-idle: 10\n max-wait: 8000\n dbUserService: \n driverClassName: com.mysql.jdbc.Driver\n url: \"jdbc:mysql://localhost:3306/USERSERVICE?autoreconnect=true\"\n password: \"root\"\n username: \"root\"\n testOnBorrow: true\n testWhileIdle: true\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 30000\n validationQuery: SELECT 1 \n max-active: 15\n max-idle: 10\n max-wait: 8000"},{"code":null,"e":10958,"s":10857,"text":"Now, create a Configuration class to create a DataSource and JdbcTemplate for multiple data sources."},{"code":null,"e":12385,"s":10958,"text":"import javax.sql.DataSource;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;\nimport org.springframework.boot.context.properties.ConfigurationProperties;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Primary;\nimport org.springframework.jdbc.core.JdbcTemplate;\n\n@Configuration\npublic class DatabaseConfig {\n @Bean(name = \"dbProductService\")\n @ConfigurationProperties(prefix = \"spring.dbProductService\")\n @Primary\n public DataSource createProductServiceDataSource() {\n return DataSourceBuilder.create().build();\n }\n @Bean(name = \"dbUserService\")\n @ConfigurationProperties(prefix = \"spring.dbUserService\")\n public DataSource createUserServiceDataSource() {\n return DataSourceBuilder.create().build();\n }\n @Bean(name = \"jdbcProductService\")\n @Autowired\n public JdbcTemplate createJdbcTemplate_ProductService(@Qualifier(\"dbProductService\") DataSource productServiceDS) {\n return new JdbcTemplate(productServiceDS);\n }\n @Bean(name = \"jdbcUserService\")\n @Autowired\n public JdbcTemplate createJdbcTemplate_UserService(@Qualifier(\"dbUserService\") DataSource userServiceDS) {\n return new JdbcTemplate(userServiceDS);\n }\n}"},{"code":null,"e":12457,"s":12385,"text":"Then, auto wire the JDBCTemplate object by using @Qualifier annotation."},{"code":null,"e":12597,"s":12457,"text":"@Qualifier(\"jdbcProductService\")\n@Autowired\nJdbcTemplate jdbcTemplate;\n\n@Qualifier(\"jdbcUserService\")\n@Autowired\nJdbcTemplate jdbcTemplate;"},{"code":null,"e":12631,"s":12597,"text":"\n 102 Lectures \n 8 hours \n"},{"code":null,"e":12645,"s":12631,"text":" Karthikeya T"},{"code":null,"e":12678,"s":12645,"text":"\n 39 Lectures \n 5 hours \n"},{"code":null,"e":12693,"s":12678,"text":" Chaand Sheikh"},{"code":null,"e":12728,"s":12693,"text":"\n 73 Lectures \n 5.5 hours \n"},{"code":null,"e":12740,"s":12728,"text":" Senol Atac"},{"code":null,"e":12775,"s":12740,"text":"\n 62 Lectures \n 4.5 hours \n"},{"code":null,"e":12787,"s":12775,"text":" Senol Atac"},{"code":null,"e":12822,"s":12787,"text":"\n 67 Lectures \n 4.5 hours \n"},{"code":null,"e":12834,"s":12822,"text":" Senol Atac"},{"code":null,"e":12867,"s":12834,"text":"\n 69 Lectures \n 5 hours \n"},{"code":null,"e":12879,"s":12867,"text":" Senol Atac"},{"code":null,"e":12886,"s":12879,"text":" Print"},{"code":null,"e":12897,"s":12886,"text":" Add Notes"}],"string":"[\n {\n \"code\": null,\n \"e\": 3299,\n \"s\": 3025,\n \"text\": \"Spring Boot provides a very good support to create a DataSource for Database. We need not write any extra code to create a DataSource in Spring Boot. Just adding the dependencies and doing the configuration details is enough to create a DataSource and connect the Database.\"\n },\n {\n \"code\": null,\n \"e\": 3396,\n \"s\": 3299,\n \"text\": \"In this chapter, we are going to use Spring Boot JDBC driver connection to connect the database.\"\n },\n {\n \"code\": null,\n \"e\": 3491,\n \"s\": 3396,\n \"text\": \"First, we need to add the Spring Boot Starter JDBC dependency in our build configuration file.\"\n },\n {\n \"code\": null,\n \"e\": 3559,\n \"s\": 3491,\n \"text\": \"Maven users can add the following dependencies in the pom.xml file.\"\n },\n {\n \"code\": null,\n \"e\": 3686,\n \"s\": 3559,\n \"text\": \"\\n org.springframework.boot\\n spring-boot-starter-jdbc\\n\"\n },\n {\n \"code\": null,\n \"e\": 3760,\n \"s\": 3686,\n \"text\": \"Gradle users can add the following dependencies in the build.gradle file.\"\n },\n {\n \"code\": null,\n \"e\": 3822,\n \"s\": 3760,\n \"text\": \"compile('org.springframework.boot:spring-boot-starter-jdbc')\\n\"\n },\n {\n \"code\": null,\n \"e\": 3925,\n \"s\": 3822,\n \"text\": \"To connect the H2 database, we need to add the H2 database dependency in our build configuration file.\"\n },\n {\n \"code\": null,\n \"e\": 3989,\n \"s\": 3925,\n \"text\": \"For Maven users, add the below dependency in your pom.xml file.\"\n },\n {\n \"code\": null,\n \"e\": 4084,\n \"s\": 3989,\n \"text\": \"\\n com.h2database\\n h2\\n\"\n },\n {\n \"code\": null,\n \"e\": 4154,\n \"s\": 4084,\n \"text\": \"For Gradle users, add the below dependency in your build.gradle file.\"\n },\n {\n \"code\": null,\n \"e\": 4184,\n \"s\": 4154,\n \"text\": \"compile('com.h2database:h2')\\n\"\n },\n {\n \"code\": null,\n \"e\": 4317,\n \"s\": 4184,\n \"text\": \"We need to create the schema.sql file and data.sql file under the classpath src/main/resources directory to connect the H2 database.\"\n },\n {\n \"code\": null,\n \"e\": 4353,\n \"s\": 4317,\n \"text\": \"The schema.sql file is given below.\"\n },\n {\n \"code\": null,\n \"e\": 4423,\n \"s\": 4353,\n \"text\": \"CREATE TABLE PRODUCT (ID INT PRIMARY KEY, PRODUCT_NAME VARCHAR(25));\\n\"\n },\n {\n \"code\": null,\n \"e\": 4457,\n \"s\": 4423,\n \"text\": \"The data.sql file is given below.\"\n },\n {\n \"code\": null,\n \"e\": 4575,\n \"s\": 4457,\n \"text\": \"INSERT INTO PRODUCT (ID,PRODUCT_NAME) VALUES (1,'Honey');\\nINSERT INTO PRODUCT (ID,PRODUCT_NAME) VALUES (2,'Almond');\\n\"\n },\n {\n \"code\": null,\n \"e\": 4677,\n \"s\": 4575,\n \"text\": \"To connect the MySQL database, we need to add the MySQL dependency into our build configuration file.\"\n },\n {\n \"code\": null,\n \"e\": 4745,\n \"s\": 4677,\n \"text\": \"For Maven users, add the following dependency in your pom.xml file.\"\n },\n {\n \"code\": null,\n \"e\": 4849,\n \"s\": 4745,\n \"text\": \"\\n mysql\\n mysql-connector-java\\n\"\n },\n {\n \"code\": null,\n \"e\": 4923,\n \"s\": 4849,\n \"text\": \"For Gradle users, add the following dependency in your build.gradle file.\"\n },\n {\n \"code\": null,\n \"e\": 4962,\n \"s\": 4923,\n \"text\": \"compile('mysql:mysql-connector-java')\\n\"\n },\n {\n \"code\": null,\n \"e\": 5014,\n \"s\": 4962,\n \"text\": \"Now, create database and tables in MySQL as shown −\"\n },\n {\n \"code\": null,\n \"e\": 5106,\n \"s\": 5014,\n \"text\": \"For properties file users, add the following properties in the application.properties file.\"\n },\n {\n \"code\": null,\n \"e\": 5651,\n \"s\": 5106,\n \"text\": \"spring.datasource.driverClassName = com.mysql.jdbc.Driver\\nspring.datasource.url = jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect = true\\nspring.datasource.username = root\\nspring.datasource.password = root\\nspring.datasource.testOnBorrow = true\\nspring.datasource.testWhileIdle = true\\nspring.datasource.timeBetweenEvictionRunsMillis = 60000\\nspring.datasource.minEvictableIdleTimeMillis = 30000\\nspring.datasource.validationQuery = SELECT 1\\nspring.datasource.max-active = 15\\nspring.datasource.max-idle = 10\\nspring.datasource.max-wait = 8000\"\n },\n {\n \"code\": null,\n \"e\": 5725,\n \"s\": 5651,\n \"text\": \"For YAML users, add the following properties in the application.yml file.\"\n },\n {\n \"code\": null,\n \"e\": 6142,\n \"s\": 5725,\n \"text\": \"spring:\\n datasource: \\n driverClassName: com.mysql.jdbc.Driver\\n url: \\\"jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect=true\\\"\\n username: \\\"root\\\"\\n password: \\\"root\\\"\\n testOnBorrow: true\\n testWhileIdle: true\\n timeBetweenEvictionRunsMillis: 60000\\n minEvictableIdleTimeMillis: 30000\\n validationQuery: SELECT 1\\n max-active: 15\\n max-idle: 10\\n max-wait: 8000\"\n },\n {\n \"code\": null,\n \"e\": 6346,\n \"s\": 6142,\n \"text\": \"Redis is an open source database used to store the in-memory data structure. To connect the Redis database in Spring Boot application, we need to add the Redis dependency in our build configuration file.\"\n },\n {\n \"code\": null,\n \"e\": 6416,\n \"s\": 6346,\n \"text\": \"Maven users should add the following dependency in your pom.xml file.\"\n },\n {\n \"code\": null,\n \"e\": 6544,\n \"s\": 6416,\n \"text\": \"\\n org.springframework.boot\\n spring-boot-starter-redis\\n\"\n },\n {\n \"code\": null,\n \"e\": 6620,\n \"s\": 6544,\n \"text\": \"Gradle users should add the following dependency in your build.gradle file.\"\n },\n {\n \"code\": null,\n \"e\": 6688,\n \"s\": 6620,\n \"text\": \"compile('org.springframework.boot:spring-boot-starter-data-redis')\\n\"\n },\n {\n \"code\": null,\n \"e\": 6813,\n \"s\": 6688,\n \"text\": \"For Redis connection, we need to use RedisTemplate. For RedisTemplate we need to provide the JedisConnectionFactory details.\"\n },\n {\n \"code\": null,\n \"e\": 7546,\n \"s\": 6813,\n \"text\": \"@Bean\\nJedisConnectionFactory jedisConnectionFactory() {\\n JedisConnectionFactory jedisConFactory = new JedisConnectionFactory();\\n jedisConFactory.setHostName(\\\"localhost\\\");\\n jedisConFactory.setPort(6000);\\n jedisConFactory.setUsePool(true);\\n return jedisConFactory;\\n}\\n@Bean\\npublic RedisTemplate redisTemplate() {\\n RedisTemplate template = new RedisTemplate<>();\\n template.setConnectionFactory(jedisConnectionFactory());\\n template.setKeySerializer(new StringRedisSerializer());\\n template.setHashKeySerializer(new StringRedisSerializer());\\n template.setHashValueSerializer(new StringRedisSerializer());\\n template.setValueSerializer(new StringRedisSerializer());\\n return template;\\n}\"\n },\n {\n \"code\": null,\n \"e\": 7625,\n \"s\": 7546,\n \"text\": \"Now auto wire the RedisTemplate class and access the data from Redis database.\"\n },\n {\n \"code\": null,\n \"e\": 7756,\n \"s\": 7625,\n \"text\": \"@Autowired\\n\\nRedisTemplate redis;\\nMap datalist = redis.opsForHash().entries(“Redis_code_index_key”);\"\n },\n {\n \"code\": null,\n \"e\": 7928,\n \"s\": 7756,\n \"text\": \"To access the Relational Database by using JdbcTemplate in Spring Boot application, we need to add the Spring Boot Starter JDBC dependency in our build configuration file.\"\n },\n {\n \"code\": null,\n \"e\": 8077,\n \"s\": 7928,\n \"text\": \"Then, if you @Autowired the JdbcTemplate class, Spring Boot automatically connects the Database and sets the Datasource for the JdbcTemplate object.\"\n },\n {\n \"code\": null,\n \"e\": 8189,\n \"s\": 8077,\n \"text\": \"@Autowired\\nJdbcTemplate jdbcTemplate;\\nCollection> rows = jdbc.queryForList(\\\"SELECT QUERY\\\");\"\n },\n {\n \"code\": null,\n \"e\": 8352,\n \"s\": 8189,\n \"text\": \"The @Repository annotation should be added into the class file. The @Repository annotation is used to create database repository for your Spring Boot application.\"\n },\n {\n \"code\": null,\n \"e\": 8399,\n \"s\": 8352,\n \"text\": \"@Repository\\npublic class ProductServiceDAO {\\n}\"\n },\n {\n \"code\": null,\n \"e\": 8653,\n \"s\": 8399,\n \"text\": \"We can keep ‘n’ number Datasources in a single Spring Boot application. The example given here shows how to create more than 1 data source in Spring Boot application. Now, add the two data source configuration details in the application properties file.\"\n },\n {\n \"code\": null,\n \"e\": 8748,\n \"s\": 8653,\n \"text\": \"For properties file users, add the following properties into your application.properties file.\"\n },\n {\n \"code\": null,\n \"e\": 9944,\n \"s\": 8748,\n \"text\": \"spring.dbProductService.driverClassName = com.mysql.jdbc.Driver\\nspring.dbProductService.url = jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect = true\\nspring.dbProductService.username = root\\nspring.dbProductService.password = root\\nspring.dbProductService.testOnBorrow = true\\nspring.dbProductService.testWhileIdle = true\\nspring.dbProductService.timeBetweenEvictionRunsMillis = 60000\\nspring.dbProductService.minEvictableIdleTimeMillis = 30000\\nspring.dbProductService.validationQuery = SELECT 1\\nspring.dbProductService.max-active = 15\\nspring.dbProductService.max-idle = 10\\nspring.dbProductService.max-wait = 8000\\n\\nspring.dbUserService.driverClassName = com.mysql.jdbc.Driver\\nspring.dbUserService.url = jdbc:mysql://localhost:3306/USERSERVICE?autoreconnect = true\\nspring.dbUserService.username = root\\nspring.dbUserService.password = root\\nspring.dbUserService.testOnBorrow = true\\nspring.dbUserService.testWhileIdle = true\\nspring.dbUserService.timeBetweenEvictionRunsMillis = 60000\\nspring.dbUserService.minEvictableIdleTimeMillis = 30000\\nspring.dbUserService.validationQuery = SELECT 1\\nspring.dbUserService.max-active = 15\\nspring.dbUserService.max-idle = 10\\nspring.dbUserService.max-wait = 8000\"\n },\n {\n \"code\": null,\n \"e\": 10021,\n \"s\": 9944,\n \"text\": \"Yaml users should add the following properties in your application.yml file.\"\n },\n {\n \"code\": null,\n \"e\": 10857,\n \"s\": 10021,\n \"text\": \"spring:\\n dbProductService: \\n driverClassName: com.mysql.jdbc.Driver\\n url: \\\"jdbc:mysql://localhost:3306/PRODUCTSERVICE?autoreconnect=true\\\"\\n password: \\\"root\\\"\\n username: \\\"root\\\"\\n testOnBorrow: true\\n testWhileIdle: true\\n timeBetweenEvictionRunsMillis: 60000\\n minEvictableIdleTimeMillis: 30000\\n validationQuery: SELECT 1\\n max-active: 15\\n max-idle: 10\\n max-wait: 8000\\n dbUserService: \\n driverClassName: com.mysql.jdbc.Driver\\n url: \\\"jdbc:mysql://localhost:3306/USERSERVICE?autoreconnect=true\\\"\\n password: \\\"root\\\"\\n username: \\\"root\\\"\\n testOnBorrow: true\\n testWhileIdle: true\\n timeBetweenEvictionRunsMillis: 60000\\n minEvictableIdleTimeMillis: 30000\\n validationQuery: SELECT 1 \\n max-active: 15\\n max-idle: 10\\n max-wait: 8000\"\n },\n {\n \"code\": null,\n \"e\": 10958,\n \"s\": 10857,\n \"text\": \"Now, create a Configuration class to create a DataSource and JdbcTemplate for multiple data sources.\"\n },\n {\n \"code\": null,\n \"e\": 12385,\n \"s\": 10958,\n \"text\": \"import javax.sql.DataSource;\\n\\nimport org.springframework.beans.factory.annotation.Autowired;\\nimport org.springframework.beans.factory.annotation.Qualifier;\\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;\\nimport org.springframework.boot.context.properties.ConfigurationProperties;\\nimport org.springframework.context.annotation.Bean;\\nimport org.springframework.context.annotation.Configuration;\\nimport org.springframework.context.annotation.Primary;\\nimport org.springframework.jdbc.core.JdbcTemplate;\\n\\n@Configuration\\npublic class DatabaseConfig {\\n @Bean(name = \\\"dbProductService\\\")\\n @ConfigurationProperties(prefix = \\\"spring.dbProductService\\\")\\n @Primary\\n public DataSource createProductServiceDataSource() {\\n return DataSourceBuilder.create().build();\\n }\\n @Bean(name = \\\"dbUserService\\\")\\n @ConfigurationProperties(prefix = \\\"spring.dbUserService\\\")\\n public DataSource createUserServiceDataSource() {\\n return DataSourceBuilder.create().build();\\n }\\n @Bean(name = \\\"jdbcProductService\\\")\\n @Autowired\\n public JdbcTemplate createJdbcTemplate_ProductService(@Qualifier(\\\"dbProductService\\\") DataSource productServiceDS) {\\n return new JdbcTemplate(productServiceDS);\\n }\\n @Bean(name = \\\"jdbcUserService\\\")\\n @Autowired\\n public JdbcTemplate createJdbcTemplate_UserService(@Qualifier(\\\"dbUserService\\\") DataSource userServiceDS) {\\n return new JdbcTemplate(userServiceDS);\\n }\\n}\"\n },\n {\n \"code\": null,\n \"e\": 12457,\n \"s\": 12385,\n \"text\": \"Then, auto wire the JDBCTemplate object by using @Qualifier annotation.\"\n },\n {\n \"code\": null,\n \"e\": 12597,\n \"s\": 12457,\n \"text\": \"@Qualifier(\\\"jdbcProductService\\\")\\n@Autowired\\nJdbcTemplate jdbcTemplate;\\n\\n@Qualifier(\\\"jdbcUserService\\\")\\n@Autowired\\nJdbcTemplate jdbcTemplate;\"\n },\n {\n \"code\": null,\n \"e\": 12631,\n \"s\": 12597,\n \"text\": \"\\n 102 Lectures \\n 8 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 12645,\n \"s\": 12631,\n \"text\": \" Karthikeya T\"\n },\n {\n \"code\": null,\n \"e\": 12678,\n \"s\": 12645,\n \"text\": \"\\n 39 Lectures \\n 5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 12693,\n \"s\": 12678,\n \"text\": \" Chaand Sheikh\"\n },\n {\n \"code\": null,\n \"e\": 12728,\n \"s\": 12693,\n \"text\": \"\\n 73 Lectures \\n 5.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 12740,\n \"s\": 12728,\n \"text\": \" Senol Atac\"\n },\n {\n \"code\": null,\n \"e\": 12775,\n \"s\": 12740,\n \"text\": \"\\n 62 Lectures \\n 4.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 12787,\n \"s\": 12775,\n \"text\": \" Senol Atac\"\n },\n {\n \"code\": null,\n \"e\": 12822,\n \"s\": 12787,\n \"text\": \"\\n 67 Lectures \\n 4.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 12834,\n \"s\": 12822,\n \"text\": \" Senol Atac\"\n },\n {\n \"code\": null,\n \"e\": 12867,\n \"s\": 12834,\n \"text\": \"\\n 69 Lectures \\n 5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 12879,\n \"s\": 12867,\n \"text\": \" Senol Atac\"\n },\n {\n \"code\": null,\n \"e\": 12886,\n \"s\": 12879,\n \"text\": \" Print\"\n },\n {\n \"code\": null,\n \"e\": 12897,\n \"s\": 12886,\n \"text\": \" Add Notes\"\n }\n]"}}},{"rowIdx":76524,"cells":{"title":{"kind":"string","value":"TypeScript - Array every()"},"text":{"kind":"string","value":"every() method tests whether all the elements in an array passes the test implemented by the provided function.\narray.every(callback[, thisObject]);\n\ncallback − Function to test for each element.\ncallback − Function to test for each element.\nthisObject − Object to use as this when executing callback.\nthisObject − Object to use as this when executing callback.\nReturns true if every element in this array satisfies the provided testing function.\nfunction isBigEnough(element, index, array) { \n return (element >= 10); \n} \n \nvar passed = [12, 5, 8, 130, 44].every(isBigEnough); \nconsole.log(\"Test Value : \" + passed );\n\nOn compiling, it will generate the same code in JavaScript.\nIts output is as follows −\nTest Value : false\n\n\n 45 Lectures \n 4 hours \n\n Antonio Papa\n\n 41 Lectures \n 7 hours \n\n Haider Malik\n\n 60 Lectures \n 2.5 hours \n\n Skillbakerystudios\n\n 77 Lectures \n 8 hours \n\n Sean Bradley\n\n 77 Lectures \n 3.5 hours \n\n TELCOMA Global\n\n 19 Lectures \n 3 hours \n\n Christopher Frewin\n Print\n Add Notes\n Bookmark this page"},"parsed":{"kind":"list like","value":[{"code":null,"e":2160,"s":2048,"text":"every() method tests whether all the elements in an array passes the test implemented by the provided function."},{"code":null,"e":2198,"s":2160,"text":"array.every(callback[, thisObject]);\n"},{"code":null,"e":2244,"s":2198,"text":"callback − Function to test for each element."},{"code":null,"e":2290,"s":2244,"text":"callback − Function to test for each element."},{"code":null,"e":2350,"s":2290,"text":"thisObject − Object to use as this when executing callback."},{"code":null,"e":2410,"s":2350,"text":"thisObject − Object to use as this when executing callback."},{"code":null,"e":2495,"s":2410,"text":"Returns true if every element in this array satisfies the provided testing function."},{"code":null,"e":2679,"s":2495,"text":"function isBigEnough(element, index, array) { \n return (element >= 10); \n} \n \nvar passed = [12, 5, 8, 130, 44].every(isBigEnough); \nconsole.log(\"Test Value : \" + passed );\n"},{"code":null,"e":2739,"s":2679,"text":"On compiling, it will generate the same code in JavaScript."},{"code":null,"e":2766,"s":2739,"text":"Its output is as follows −"},{"code":null,"e":2786,"s":2766,"text":"Test Value : false\n"},{"code":null,"e":2819,"s":2786,"text":"\n 45 Lectures \n 4 hours \n"},{"code":null,"e":2833,"s":2819,"text":" Antonio Papa"},{"code":null,"e":2866,"s":2833,"text":"\n 41 Lectures \n 7 hours \n"},{"code":null,"e":2880,"s":2866,"text":" Haider Malik"},{"code":null,"e":2915,"s":2880,"text":"\n 60 Lectures \n 2.5 hours \n"},{"code":null,"e":2935,"s":2915,"text":" Skillbakerystudios"},{"code":null,"e":2968,"s":2935,"text":"\n 77 Lectures \n 8 hours \n"},{"code":null,"e":2982,"s":2968,"text":" Sean Bradley"},{"code":null,"e":3017,"s":2982,"text":"\n 77 Lectures \n 3.5 hours \n"},{"code":null,"e":3033,"s":3017,"text":" TELCOMA Global"},{"code":null,"e":3066,"s":3033,"text":"\n 19 Lectures \n 3 hours \n"},{"code":null,"e":3086,"s":3066,"text":" Christopher Frewin"},{"code":null,"e":3093,"s":3086,"text":" Print"},{"code":null,"e":3104,"s":3093,"text":" Add Notes"}],"string":"[\n {\n \"code\": null,\n \"e\": 2160,\n \"s\": 2048,\n \"text\": \"every() method tests whether all the elements in an array passes the test implemented by the provided function.\"\n },\n {\n \"code\": null,\n \"e\": 2198,\n \"s\": 2160,\n \"text\": \"array.every(callback[, thisObject]);\\n\"\n },\n {\n \"code\": null,\n \"e\": 2244,\n \"s\": 2198,\n \"text\": \"callback − Function to test for each element.\"\n },\n {\n \"code\": null,\n \"e\": 2290,\n \"s\": 2244,\n \"text\": \"callback − Function to test for each element.\"\n },\n {\n \"code\": null,\n \"e\": 2350,\n \"s\": 2290,\n \"text\": \"thisObject − Object to use as this when executing callback.\"\n },\n {\n \"code\": null,\n \"e\": 2410,\n \"s\": 2350,\n \"text\": \"thisObject − Object to use as this when executing callback.\"\n },\n {\n \"code\": null,\n \"e\": 2495,\n \"s\": 2410,\n \"text\": \"Returns true if every element in this array satisfies the provided testing function.\"\n },\n {\n \"code\": null,\n \"e\": 2679,\n \"s\": 2495,\n \"text\": \"function isBigEnough(element, index, array) { \\n return (element >= 10); \\n} \\n \\nvar passed = [12, 5, 8, 130, 44].every(isBigEnough); \\nconsole.log(\\\"Test Value : \\\" + passed );\\n\"\n },\n {\n \"code\": null,\n \"e\": 2739,\n \"s\": 2679,\n \"text\": \"On compiling, it will generate the same code in JavaScript.\"\n },\n {\n \"code\": null,\n \"e\": 2766,\n \"s\": 2739,\n \"text\": \"Its output is as follows −\"\n },\n {\n \"code\": null,\n \"e\": 2786,\n \"s\": 2766,\n \"text\": \"Test Value : false\\n\"\n },\n {\n \"code\": null,\n \"e\": 2819,\n \"s\": 2786,\n \"text\": \"\\n 45 Lectures \\n 4 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 2833,\n \"s\": 2819,\n \"text\": \" Antonio Papa\"\n },\n {\n \"code\": null,\n \"e\": 2866,\n \"s\": 2833,\n \"text\": \"\\n 41 Lectures \\n 7 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 2880,\n \"s\": 2866,\n \"text\": \" Haider Malik\"\n },\n {\n \"code\": null,\n \"e\": 2915,\n \"s\": 2880,\n \"text\": \"\\n 60 Lectures \\n 2.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 2935,\n \"s\": 2915,\n \"text\": \" Skillbakerystudios\"\n },\n {\n \"code\": null,\n \"e\": 2968,\n \"s\": 2935,\n \"text\": \"\\n 77 Lectures \\n 8 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 2982,\n \"s\": 2968,\n \"text\": \" Sean Bradley\"\n },\n {\n \"code\": null,\n \"e\": 3017,\n \"s\": 2982,\n \"text\": \"\\n 77 Lectures \\n 3.5 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3033,\n \"s\": 3017,\n \"text\": \" TELCOMA Global\"\n },\n {\n \"code\": null,\n \"e\": 3066,\n \"s\": 3033,\n \"text\": \"\\n 19 Lectures \\n 3 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 3086,\n \"s\": 3066,\n \"text\": \" Christopher Frewin\"\n },\n {\n \"code\": null,\n \"e\": 3093,\n \"s\": 3086,\n \"text\": \" Print\"\n },\n {\n \"code\": null,\n \"e\": 3104,\n \"s\": 3093,\n \"text\": \" Add Notes\"\n }\n]"}}},{"rowIdx":76525,"cells":{"title":{"kind":"string","value":"Spring Boot Example Tutorials | Spring Boot Hello World Example Online TutorialsPoint"},"text":{"kind":"string","value":"PROGRAMMINGJava ExamplesC Examples\nJava Examples\nC Examples\nC Tutorials\naws\nJAVAEXCEPTIONSCOLLECTIONSSWINGJDBC\nEXCEPTIONS\nCOLLECTIONS\nSWING\nJDBC\nJAVA 8\nSPRING\nSPRING BOOT\nHIBERNATE\nPYTHON\nPHP\nJQUERY\nPROGRAMMINGJava ExamplesC Examples\nJava Examples\nC Examples\nC Tutorials\naws\nIn this tutorial, I am going to show you the most popular and trending module in Spring Framework that is Spring Boot. By this tutorials you can get to know how to write a Simple Spring Boot Example.\nUsed Technologies :\nSpring 3.2.3\nSpring Boot 1.5.1\nJava 8\nMaven 3\nHere I am going to implement a basic hello world spring boot example.\nProject Structure :\nMaven Dependencies :\nTo make our example as simple as possible, I have placed dependencies in pom.xml what just I want.\n\n4.0.0\norg.springframework.samples\nSpring_Boot_Example\n0.0.1-SNAPSHOT\n\n\n\n\n1.8\nUTF-8\nUTF-8\n\n\n3.2.3.RELEASE\n\n\n\norg.springframework.boot\nspring-boot-starter-parent\n1.5.1.RELEASE\n\n\n\n\norg.springframework.boot\nspring-boot-starter-web\n\n\n\n\n\norg.springframework.boot\nspring-boot-maven-plugin\n\n\n\n\n\nCreate Application Class :\npackage com.onlinetutorialspoint.spring.boot;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class Application {\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n } \n}\n\n@SpringBootApplication annotation tells the spring application context, it is an spring boot application. Most of the developers can used to define the spring boot main classes with the @Configuration, @EnableAutoConfiguration and @ComponentScan annotations. Since these annotations are mandatory to every Spring application, the Spring Boot given us an annotation called @SpringBootApplication instead.\nHere @Configuration + @EnableAutoConfiguration + @ComponentScan = @SpringBootApplication\npackage com.onlinetutorialspoint.spring.boot;\n\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\npublic class HelloController {\n @RequestMapping(\"/\")\n public String index() {\n return \"Hello World Spring !\";\n }\n}\n\nRunning the Spring Boot Example :\nOn e of the biggest advantage of Spring boot application is, to run we don’t deploy the application in any server. We can run the above spring boot example as a simple Java standalone application.\nRun the main method in Application.java.\nIf every thing goes well, you can find the below text in your console.\n\nRun it :\nHappy Learning 🙂\n\n\nspring_boot_example\n\nSimple Spring Boot Example\nFile size: 9 KB\nDownloads: 1204\n\n\nSpring Boot Environment Properties reading based on activeprofile\nSpring Boot FileUpload Ajax Example\nSSL Spring Boot HTTPs Enabling Example\nSpring Boot Validation Login Form Example\nExternal Apache ActiveMQ Spring Boot Example\nSpring Boot In Memory Basic Authentication Security\nStep By Step Spring Boot Docker Deployment Example\nSpring Boot Hibernate Integration Example\nSpring Boot JPA Integration Example\nSpring boot exception handling rest service (CRUD) operations\nSpring Boot MongoDB + Spring Data Example\nSpring Boot MVC Example Tutorials\nSpring Boot How to change the Tomcat to Jetty Server\nHow to Send Mail Spring Boot Example\nHow to set Spring boot favicon image\n\nSpring Boot Environment Properties reading based on activeprofile\nSpring Boot FileUpload Ajax Example\nSSL Spring Boot HTTPs Enabling Example\nSpring Boot Validation Login Form Example\nExternal Apache ActiveMQ Spring Boot Example\nSpring Boot In Memory Basic Authentication Security\nStep By Step Spring Boot Docker Deployment Example\nSpring Boot Hibernate Integration Example\nSpring Boot JPA Integration Example\nSpring boot exception handling rest service (CRUD) operations\nSpring Boot MongoDB + Spring Data Example\nSpring Boot MVC Example Tutorials\nSpring Boot How to change the Tomcat to Jetty Server\nHow to Send Mail Spring Boot Example\nHow to set Spring boot favicon image\n\n\n\n\n\n\nSpring Boot Training\nMarch 2, 2018 at 9:36 am - Reply \n\nLooking nice information about Spring Boot\nPlz do keep sharing on\n\n\n\n\n\n\n\n\n\nbhanu pratap\nJuly 24, 2018 at 2:57 pm - Reply \n\nGood Article,valuable information, Best software Training institute in Bangalore \n\n\n\n\n\n\n\n\n\nvinod kumar mvn\nAugust 31, 2018 at 2:45 pm - Reply \n\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\nThanks\n\n\n\n\n\n\n\n\n\nKatherine\nDecember 27, 2018 at 10:50 am - Reply \n\nHello ChandraSekhar,\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\n\n\n\n\n\n\n\n\n\n\nSpring Boot Training\nMarch 2, 2018 at 9:36 am - Reply \n\nLooking nice information about Spring Boot\nPlz do keep sharing on\n\n\n\n\nLooking nice information about Spring Boot\nPlz do keep sharing on\n\n\n\n\n\nbhanu pratap\nJuly 24, 2018 at 2:57 pm - Reply \n\nGood Article,valuable information, Best software Training institute in Bangalore \n\n\n\n\nGood Article,valuable information, Best software Training institute in Bangalore \n\n\n\n\n\nvinod kumar mvn\nAugust 31, 2018 at 2:45 pm - Reply \n\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\nThanks\n\n\n\n\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\nThanks\n\n\n\n\n\nKatherine\nDecember 27, 2018 at 10:50 am - Reply \n\nHello ChandraSekhar,\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\n\n\n\n\nHello ChandraSekhar,\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\n \n\n\nΔ\n Spring Boot – Hello World\n Spring Boot – MVC Example\n Spring Boot- Change Context Path\n Spring Boot – Change Tomcat Port Number\n Spring Boot – Change Tomcat to Jetty Server\n Spring Boot – Tomcat session timeout\n Spring Boot – Enable Random Port\n Spring Boot – Properties File\n Spring Boot – Beans Lazy Loading\n Spring Boot – Set Favicon image\n Spring Boot – Set Custom Banner\n Spring Boot – Set Application TimeZone\n Spring Boot – Send Mail\n Spring Boot – FileUpload Ajax\n Spring Boot – Actuator\n Spring Boot – Actuator Database Health Check\n Spring Boot – Swagger\n Spring Boot – Enable CORS\n Spring Boot – External Apache ActiveMQ Setup\n Spring Boot – Inmemory Apache ActiveMq\n Spring Boot – Scheduler Job\n Spring Boot – Exception Handling\n Spring Boot – Hibernate CRUD\n Spring Boot – JPA Integration CRUD\n Spring Boot – JPA DataRest CRUD\n Spring Boot – JdbcTemplate CRUD\n Spring Boot – Multiple Data Sources Config\n Spring Boot – JNDI Configuration\n Spring Boot – H2 Database CRUD\n Spring Boot – MongoDB CRUD\n Spring Boot – Redis Data CRUD\n Spring Boot – MVC Login Form Validation\n Spring Boot – Custom Error Pages\n Spring Boot – iText PDF\n Spring Boot – Enable SSL (HTTPs)\n Spring Boot – Basic Authentication\n Spring Boot – In Memory Basic Authentication\n Spring Boot – Security MySQL Database Integration\n Spring Boot – Redis Cache – Redis Server\n Spring Boot – Hazelcast Cache\n Spring Boot – EhCache\n Spring Boot – Kafka Producer\n Spring Boot – Kafka Consumer\n Spring Boot – Kafka JSON Message to Kafka Topic\n Spring Boot – RabbitMQ Publisher\n Spring Boot – RabbitMQ Consumer\n Spring Boot – SOAP Consumer\n Spring Boot – Soap WebServices\n Spring Boot – Batch Csv to Database\n Spring Boot – Eureka Server\n Spring Boot – MockMvc JUnit\n Spring Boot – Docker Deployment"},"parsed":{"kind":"list like","value":[{"code":null,"e":158,"s":123,"text":"PROGRAMMINGJava ExamplesC Examples"},{"code":null,"e":172,"s":158,"text":"Java Examples"},{"code":null,"e":183,"s":172,"text":"C Examples"},{"code":null,"e":195,"s":183,"text":"C Tutorials"},{"code":null,"e":199,"s":195,"text":"aws"},{"code":null,"e":234,"s":199,"text":"JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC"},{"code":null,"e":245,"s":234,"text":"EXCEPTIONS"},{"code":null,"e":257,"s":245,"text":"COLLECTIONS"},{"code":null,"e":263,"s":257,"text":"SWING"},{"code":null,"e":268,"s":263,"text":"JDBC"},{"code":null,"e":275,"s":268,"text":"JAVA 8"},{"code":null,"e":282,"s":275,"text":"SPRING"},{"code":null,"e":294,"s":282,"text":"SPRING BOOT"},{"code":null,"e":304,"s":294,"text":"HIBERNATE"},{"code":null,"e":311,"s":304,"text":"PYTHON"},{"code":null,"e":315,"s":311,"text":"PHP"},{"code":null,"e":322,"s":315,"text":"JQUERY"},{"code":null,"e":357,"s":322,"text":"PROGRAMMINGJava ExamplesC Examples"},{"code":null,"e":371,"s":357,"text":"Java Examples"},{"code":null,"e":382,"s":371,"text":"C Examples"},{"code":null,"e":394,"s":382,"text":"C Tutorials"},{"code":null,"e":398,"s":394,"text":"aws"},{"code":null,"e":598,"s":398,"text":"In this tutorial, I am going to show you the most popular and trending module in Spring Framework that is Spring Boot. By this tutorials you can get to know how to write a Simple Spring Boot Example."},{"code":null,"e":618,"s":598,"text":"Used Technologies :"},{"code":null,"e":631,"s":618,"text":"Spring 3.2.3"},{"code":null,"e":649,"s":631,"text":"Spring Boot 1.5.1"},{"code":null,"e":656,"s":649,"text":"Java 8"},{"code":null,"e":664,"s":656,"text":"Maven 3"},{"code":null,"e":734,"s":664,"text":"Here I am going to implement a basic hello world spring boot example."},{"code":null,"e":754,"s":734,"text":"Project Structure :"},{"code":null,"e":775,"s":754,"text":"Maven Dependencies :"},{"code":null,"e":874,"s":775,"text":"To make our example as simple as possible, I have placed dependencies in pom.xml what just I want."},{"code":null,"e":2020,"s":874,"text":"\n4.0.0\norg.springframework.samples\nSpring_Boot_Example\n0.0.1-SNAPSHOT\n\n\n\n\n1.8\nUTF-8\nUTF-8\n\n\n3.2.3.RELEASE\n\n\n\norg.springframework.boot\nspring-boot-starter-parent\n1.5.1.RELEASE\n\n\n\n\norg.springframework.boot\nspring-boot-starter-web\n\n\n\n\n\norg.springframework.boot\nspring-boot-maven-plugin\n\n\n\n\n"},{"code":null,"e":2047,"s":2020,"text":"Create Application Class :"},{"code":null,"e":2379,"s":2047,"text":"package com.onlinetutorialspoint.spring.boot;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class Application {\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n } \n}\n"},{"code":null,"e":2783,"s":2379,"text":"@SpringBootApplication annotation tells the spring application context, it is an spring boot application. Most of the developers can used to define the spring boot main classes with the @Configuration, @EnableAutoConfiguration and @ComponentScan annotations. Since these annotations are mandatory to every Spring application, the Spring Boot given us an annotation called @SpringBootApplication instead."},{"code":null,"e":2872,"s":2783,"text":"Here @Configuration + @EnableAutoConfiguration + @ComponentScan = @SpringBootApplication"},{"code":null,"e":3194,"s":2872,"text":"package com.onlinetutorialspoint.spring.boot;\n\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\npublic class HelloController {\n @RequestMapping(\"/\")\n public String index() {\n return \"Hello World Spring !\";\n }\n}\n"},{"code":null,"e":3228,"s":3194,"text":"Running the Spring Boot Example :"},{"code":null,"e":3425,"s":3228,"text":"On e of the biggest advantage of Spring boot application is, to run we don’t deploy the application in any server. We can run the above spring boot example as a simple Java standalone application."},{"code":null,"e":3466,"s":3425,"text":"Run the main method in Application.java."},{"code":null,"e":3537,"s":3466,"text":"If every thing goes well, you can find the below text in your console."},{"code":null,"e":3547,"s":3537,"text":"\nRun it :"},{"code":null,"e":3564,"s":3547,"text":"Happy Learning 🙂"},{"code":null,"e":3647,"s":3564,"text":"\n\nspring_boot_example\n\nSimple Spring Boot Example\nFile size: 9 KB\nDownloads: 1204\n"},{"code":null,"e":4323,"s":3647,"text":"\nSpring Boot Environment Properties reading based on activeprofile\nSpring Boot FileUpload Ajax Example\nSSL Spring Boot HTTPs Enabling Example\nSpring Boot Validation Login Form Example\nExternal Apache ActiveMQ Spring Boot Example\nSpring Boot In Memory Basic Authentication Security\nStep By Step Spring Boot Docker Deployment Example\nSpring Boot Hibernate Integration Example\nSpring Boot JPA Integration Example\nSpring boot exception handling rest service (CRUD) operations\nSpring Boot MongoDB + Spring Data Example\nSpring Boot MVC Example Tutorials\nSpring Boot How to change the Tomcat to Jetty Server\nHow to Send Mail Spring Boot Example\nHow to set Spring boot favicon image\n"},{"code":null,"e":4389,"s":4323,"text":"Spring Boot Environment Properties reading based on activeprofile"},{"code":null,"e":4425,"s":4389,"text":"Spring Boot FileUpload Ajax Example"},{"code":null,"e":4464,"s":4425,"text":"SSL Spring Boot HTTPs Enabling Example"},{"code":null,"e":4506,"s":4464,"text":"Spring Boot Validation Login Form Example"},{"code":null,"e":4551,"s":4506,"text":"External Apache ActiveMQ Spring Boot Example"},{"code":null,"e":4603,"s":4551,"text":"Spring Boot In Memory Basic Authentication Security"},{"code":null,"e":4654,"s":4603,"text":"Step By Step Spring Boot Docker Deployment Example"},{"code":null,"e":4696,"s":4654,"text":"Spring Boot Hibernate Integration Example"},{"code":null,"e":4732,"s":4696,"text":"Spring Boot JPA Integration Example"},{"code":null,"e":4794,"s":4732,"text":"Spring boot exception handling rest service (CRUD) operations"},{"code":null,"e":4836,"s":4794,"text":"Spring Boot MongoDB + Spring Data Example"},{"code":null,"e":4870,"s":4836,"text":"Spring Boot MVC Example Tutorials"},{"code":null,"e":4923,"s":4870,"text":"Spring Boot How to change the Tomcat to Jetty Server"},{"code":null,"e":4960,"s":4923,"text":"How to Send Mail Spring Boot Example"},{"code":null,"e":4997,"s":4960,"text":"How to set Spring boot favicon image"},{"code":null,"e":5834,"s":4997,"text":"\n\n\n\n\n\nSpring Boot Training\nMarch 2, 2018 at 9:36 am - Reply \n\nLooking nice information about Spring Boot\nPlz do keep sharing on\n\n\n\n\n\n\n\n\n\nbhanu pratap\nJuly 24, 2018 at 2:57 pm - Reply \n\nGood Article,valuable information, Best software Training institute in Bangalore \n\n\n\n\n\n\n\n\n\nvinod kumar mvn\nAugust 31, 2018 at 2:45 pm - Reply \n\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\nThanks\n\n\n\n\n\n\n\n\n\nKatherine\nDecember 27, 2018 at 10:50 am - Reply \n\nHello ChandraSekhar,\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\n\n\n\n\n"},{"code":null,"e":5965,"s":5834,"text":"\n\n\n\n\nSpring Boot Training\nMarch 2, 2018 at 9:36 am - Reply \n\nLooking nice information about Spring Boot\nPlz do keep sharing on\n\n\n\n"},{"code":null,"e":6031,"s":5965,"text":"Looking nice information about Spring Boot\nPlz do keep sharing on"},{"code":null,"e":6170,"s":6031,"text":"\n\n\n\n\nbhanu pratap\nJuly 24, 2018 at 2:57 pm - Reply \n\nGood Article,valuable information, Best software Training institute in Bangalore \n\n\n\n"},{"code":null,"e":6252,"s":6170,"text":"Good Article,valuable information, Best software Training institute in Bangalore "},{"code":null,"e":6518,"s":6252,"text":"\n\n\n\n\nvinod kumar mvn\nAugust 31, 2018 at 2:45 pm - Reply \n\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\nThanks\n\n\n\n"},{"code":null,"e":6715,"s":6518,"text":"The Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily."},{"code":null,"e":6722,"s":6715,"text":"Thanks"},{"code":null,"e":7021,"s":6722,"text":"\n\n\n\n\nKatherine\nDecember 27, 2018 at 10:50 am - Reply \n\nHello ChandraSekhar,\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\n\n\n\n"},{"code":null,"e":7261,"s":7021,"text":"Hello ChandraSekhar,\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner."},{"code":null,"e":7267,"s":7265,"text":"Δ"},{"code":null,"e":7294,"s":7267,"text":" Spring Boot – Hello World"},{"code":null,"e":7321,"s":7294,"text":" Spring Boot – MVC Example"},{"code":null,"e":7355,"s":7321,"text":" Spring Boot- Change Context Path"},{"code":null,"e":7396,"s":7355,"text":" Spring Boot – Change Tomcat Port Number"},{"code":null,"e":7441,"s":7396,"text":" Spring Boot – Change Tomcat to Jetty Server"},{"code":null,"e":7479,"s":7441,"text":" Spring Boot – Tomcat session timeout"},{"code":null,"e":7513,"s":7479,"text":" Spring Boot – Enable Random Port"},{"code":null,"e":7544,"s":7513,"text":" Spring Boot – Properties File"},{"code":null,"e":7578,"s":7544,"text":" Spring Boot – Beans Lazy Loading"},{"code":null,"e":7611,"s":7578,"text":" Spring Boot – Set Favicon image"},{"code":null,"e":7644,"s":7611,"text":" Spring Boot – Set Custom Banner"},{"code":null,"e":7684,"s":7644,"text":" Spring Boot – Set Application TimeZone"},{"code":null,"e":7709,"s":7684,"text":" Spring Boot – Send Mail"},{"code":null,"e":7740,"s":7709,"text":" Spring Boot – FileUpload Ajax"},{"code":null,"e":7764,"s":7740,"text":" Spring Boot – Actuator"},{"code":null,"e":7810,"s":7764,"text":" Spring Boot – Actuator Database Health Check"},{"code":null,"e":7833,"s":7810,"text":" Spring Boot – Swagger"},{"code":null,"e":7860,"s":7833,"text":" Spring Boot – Enable CORS"},{"code":null,"e":7906,"s":7860,"text":" Spring Boot – External Apache ActiveMQ Setup"},{"code":null,"e":7946,"s":7906,"text":" Spring Boot – Inmemory Apache ActiveMq"},{"code":null,"e":7975,"s":7946,"text":" Spring Boot – Scheduler Job"},{"code":null,"e":8009,"s":7975,"text":" Spring Boot – Exception Handling"},{"code":null,"e":8039,"s":8009,"text":" Spring Boot – Hibernate CRUD"},{"code":null,"e":8075,"s":8039,"text":" Spring Boot – JPA Integration CRUD"},{"code":null,"e":8108,"s":8075,"text":" Spring Boot – JPA DataRest CRUD"},{"code":null,"e":8141,"s":8108,"text":" Spring Boot – JdbcTemplate CRUD"},{"code":null,"e":8185,"s":8141,"text":" Spring Boot – Multiple Data Sources Config"},{"code":null,"e":8219,"s":8185,"text":" Spring Boot – JNDI Configuration"},{"code":null,"e":8251,"s":8219,"text":" Spring Boot – H2 Database CRUD"},{"code":null,"e":8279,"s":8251,"text":" Spring Boot – MongoDB CRUD"},{"code":null,"e":8310,"s":8279,"text":" Spring Boot – Redis Data CRUD"},{"code":null,"e":8351,"s":8310,"text":" Spring Boot – MVC Login Form Validation"},{"code":null,"e":8385,"s":8351,"text":" Spring Boot – Custom Error Pages"},{"code":null,"e":8410,"s":8385,"text":" Spring Boot – iText PDF"},{"code":null,"e":8444,"s":8410,"text":" Spring Boot – Enable SSL (HTTPs)"},{"code":null,"e":8480,"s":8444,"text":" Spring Boot – Basic Authentication"},{"code":null,"e":8526,"s":8480,"text":" Spring Boot – In Memory Basic Authentication"},{"code":null,"e":8577,"s":8526,"text":" Spring Boot – Security MySQL Database Integration"},{"code":null,"e":8619,"s":8577,"text":" Spring Boot – Redis Cache – Redis Server"},{"code":null,"e":8650,"s":8619,"text":" Spring Boot – Hazelcast Cache"},{"code":null,"e":8673,"s":8650,"text":" Spring Boot – EhCache"},{"code":null,"e":8703,"s":8673,"text":" Spring Boot – Kafka Producer"},{"code":null,"e":8733,"s":8703,"text":" Spring Boot – Kafka Consumer"},{"code":null,"e":8782,"s":8733,"text":" Spring Boot – Kafka JSON Message to Kafka Topic"},{"code":null,"e":8816,"s":8782,"text":" Spring Boot – RabbitMQ Publisher"},{"code":null,"e":8849,"s":8816,"text":" Spring Boot – RabbitMQ Consumer"},{"code":null,"e":8878,"s":8849,"text":" Spring Boot – SOAP Consumer"},{"code":null,"e":8910,"s":8878,"text":" Spring Boot – Soap WebServices"},{"code":null,"e":8947,"s":8910,"text":" Spring Boot – Batch Csv to Database"},{"code":null,"e":8976,"s":8947,"text":" Spring Boot – Eureka Server"},{"code":null,"e":9005,"s":8976,"text":" Spring Boot – MockMvc JUnit"}],"string":"[\n {\n \"code\": null,\n \"e\": 158,\n \"s\": 123,\n \"text\": \"PROGRAMMINGJava ExamplesC Examples\"\n },\n {\n \"code\": null,\n \"e\": 172,\n \"s\": 158,\n \"text\": \"Java Examples\"\n },\n {\n \"code\": null,\n \"e\": 183,\n \"s\": 172,\n \"text\": \"C Examples\"\n },\n {\n \"code\": null,\n \"e\": 195,\n \"s\": 183,\n \"text\": \"C Tutorials\"\n },\n {\n \"code\": null,\n \"e\": 199,\n \"s\": 195,\n \"text\": \"aws\"\n },\n {\n \"code\": null,\n \"e\": 234,\n \"s\": 199,\n \"text\": \"JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC\"\n },\n {\n \"code\": null,\n \"e\": 245,\n \"s\": 234,\n \"text\": \"EXCEPTIONS\"\n },\n {\n \"code\": null,\n \"e\": 257,\n \"s\": 245,\n \"text\": \"COLLECTIONS\"\n },\n {\n \"code\": null,\n \"e\": 263,\n \"s\": 257,\n \"text\": \"SWING\"\n },\n {\n \"code\": null,\n \"e\": 268,\n \"s\": 263,\n \"text\": \"JDBC\"\n },\n {\n \"code\": null,\n \"e\": 275,\n \"s\": 268,\n \"text\": \"JAVA 8\"\n },\n {\n \"code\": null,\n \"e\": 282,\n \"s\": 275,\n \"text\": \"SPRING\"\n },\n {\n \"code\": null,\n \"e\": 294,\n \"s\": 282,\n \"text\": \"SPRING BOOT\"\n },\n {\n \"code\": null,\n \"e\": 304,\n \"s\": 294,\n \"text\": \"HIBERNATE\"\n },\n {\n \"code\": null,\n \"e\": 311,\n \"s\": 304,\n \"text\": \"PYTHON\"\n },\n {\n \"code\": null,\n \"e\": 315,\n \"s\": 311,\n \"text\": \"PHP\"\n },\n {\n \"code\": null,\n \"e\": 322,\n \"s\": 315,\n \"text\": \"JQUERY\"\n },\n {\n \"code\": null,\n \"e\": 357,\n \"s\": 322,\n \"text\": \"PROGRAMMINGJava ExamplesC Examples\"\n },\n {\n \"code\": null,\n \"e\": 371,\n \"s\": 357,\n \"text\": \"Java Examples\"\n },\n {\n \"code\": null,\n \"e\": 382,\n \"s\": 371,\n \"text\": \"C Examples\"\n },\n {\n \"code\": null,\n \"e\": 394,\n \"s\": 382,\n \"text\": \"C Tutorials\"\n },\n {\n \"code\": null,\n \"e\": 398,\n \"s\": 394,\n \"text\": \"aws\"\n },\n {\n \"code\": null,\n \"e\": 598,\n \"s\": 398,\n \"text\": \"In this tutorial, I am going to show you the most popular and trending module in Spring Framework that is Spring Boot. By this tutorials you can get to know how to write a Simple Spring Boot Example.\"\n },\n {\n \"code\": null,\n \"e\": 618,\n \"s\": 598,\n \"text\": \"Used Technologies :\"\n },\n {\n \"code\": null,\n \"e\": 631,\n \"s\": 618,\n \"text\": \"Spring 3.2.3\"\n },\n {\n \"code\": null,\n \"e\": 649,\n \"s\": 631,\n \"text\": \"Spring Boot 1.5.1\"\n },\n {\n \"code\": null,\n \"e\": 656,\n \"s\": 649,\n \"text\": \"Java 8\"\n },\n {\n \"code\": null,\n \"e\": 664,\n \"s\": 656,\n \"text\": \"Maven 3\"\n },\n {\n \"code\": null,\n \"e\": 734,\n \"s\": 664,\n \"text\": \"Here I am going to implement a basic hello world spring boot example.\"\n },\n {\n \"code\": null,\n \"e\": 754,\n \"s\": 734,\n \"text\": \"Project Structure :\"\n },\n {\n \"code\": null,\n \"e\": 775,\n \"s\": 754,\n \"text\": \"Maven Dependencies :\"\n },\n {\n \"code\": null,\n \"e\": 874,\n \"s\": 775,\n \"text\": \"To make our example as simple as possible, I have placed dependencies in pom.xml what just I want.\"\n },\n {\n \"code\": null,\n \"e\": 2020,\n \"s\": 874,\n \"text\": \"\\n4.0.0\\norg.springframework.samples\\nSpring_Boot_Example\\n0.0.1-SNAPSHOT\\n\\n\\n\\n\\n1.8\\nUTF-8\\nUTF-8\\n\\n\\n3.2.3.RELEASE\\n\\n\\n\\norg.springframework.boot\\nspring-boot-starter-parent\\n1.5.1.RELEASE\\n\\n\\n\\n\\norg.springframework.boot\\nspring-boot-starter-web\\n\\n\\n\\n\\n\\norg.springframework.boot\\nspring-boot-maven-plugin\\n\\n\\n\\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 2047,\n \"s\": 2020,\n \"text\": \"Create Application Class :\"\n },\n {\n \"code\": null,\n \"e\": 2379,\n \"s\": 2047,\n \"text\": \"package com.onlinetutorialspoint.spring.boot;\\n\\nimport org.springframework.boot.SpringApplication;\\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\\n\\n@SpringBootApplication\\npublic class Application {\\n public static void main(String[] args) {\\n SpringApplication.run(Application.class, args);\\n } \\n}\\n\"\n },\n {\n \"code\": null,\n \"e\": 2783,\n \"s\": 2379,\n \"text\": \"@SpringBootApplication annotation tells the spring application context, it is an spring boot application. Most of the developers can used to define the spring boot main classes with the @Configuration, @EnableAutoConfiguration and @ComponentScan annotations. Since these annotations are mandatory to every Spring application, the Spring Boot given us an annotation called @SpringBootApplication instead.\"\n },\n {\n \"code\": null,\n \"e\": 2872,\n \"s\": 2783,\n \"text\": \"Here @Configuration + @EnableAutoConfiguration + @ComponentScan = @SpringBootApplication\"\n },\n {\n \"code\": null,\n \"e\": 3194,\n \"s\": 2872,\n \"text\": \"package com.onlinetutorialspoint.spring.boot;\\n\\nimport org.springframework.web.bind.annotation.RequestMapping;\\nimport org.springframework.web.bind.annotation.RestController;\\n\\n@RestController\\npublic class HelloController {\\n @RequestMapping(\\\"/\\\")\\n public String index() {\\n return \\\"Hello World Spring !\\\";\\n }\\n}\\n\"\n },\n {\n \"code\": null,\n \"e\": 3228,\n \"s\": 3194,\n \"text\": \"Running the Spring Boot Example :\"\n },\n {\n \"code\": null,\n \"e\": 3425,\n \"s\": 3228,\n \"text\": \"On e of the biggest advantage of Spring boot application is, to run we don’t deploy the application in any server. We can run the above spring boot example as a simple Java standalone application.\"\n },\n {\n \"code\": null,\n \"e\": 3466,\n \"s\": 3425,\n \"text\": \"Run the main method in Application.java.\"\n },\n {\n \"code\": null,\n \"e\": 3537,\n \"s\": 3466,\n \"text\": \"If every thing goes well, you can find the below text in your console.\"\n },\n {\n \"code\": null,\n \"e\": 3547,\n \"s\": 3537,\n \"text\": \"\\nRun it :\"\n },\n {\n \"code\": null,\n \"e\": 3564,\n \"s\": 3547,\n \"text\": \"Happy Learning 🙂\"\n },\n {\n \"code\": null,\n \"e\": 3647,\n \"s\": 3564,\n \"text\": \"\\n\\nspring_boot_example\\n\\nSimple Spring Boot Example\\nFile size: 9 KB\\nDownloads: 1204\\n\"\n },\n {\n \"code\": null,\n \"e\": 4323,\n \"s\": 3647,\n \"text\": \"\\nSpring Boot Environment Properties reading based on activeprofile\\nSpring Boot FileUpload Ajax Example\\nSSL Spring Boot HTTPs Enabling Example\\nSpring Boot Validation Login Form Example\\nExternal Apache ActiveMQ Spring Boot Example\\nSpring Boot In Memory Basic Authentication Security\\nStep By Step Spring Boot Docker Deployment Example\\nSpring Boot Hibernate Integration Example\\nSpring Boot JPA Integration Example\\nSpring boot exception handling rest service (CRUD) operations\\nSpring Boot MongoDB + Spring Data Example\\nSpring Boot MVC Example Tutorials\\nSpring Boot How to change the Tomcat to Jetty Server\\nHow to Send Mail Spring Boot Example\\nHow to set Spring boot favicon image\\n\"\n },\n {\n \"code\": null,\n \"e\": 4389,\n \"s\": 4323,\n \"text\": \"Spring Boot Environment Properties reading based on activeprofile\"\n },\n {\n \"code\": null,\n \"e\": 4425,\n \"s\": 4389,\n \"text\": \"Spring Boot FileUpload Ajax Example\"\n },\n {\n \"code\": null,\n \"e\": 4464,\n \"s\": 4425,\n \"text\": \"SSL Spring Boot HTTPs Enabling Example\"\n },\n {\n \"code\": null,\n \"e\": 4506,\n \"s\": 4464,\n \"text\": \"Spring Boot Validation Login Form Example\"\n },\n {\n \"code\": null,\n \"e\": 4551,\n \"s\": 4506,\n \"text\": \"External Apache ActiveMQ Spring Boot Example\"\n },\n {\n \"code\": null,\n \"e\": 4603,\n \"s\": 4551,\n \"text\": \"Spring Boot In Memory Basic Authentication Security\"\n },\n {\n \"code\": null,\n \"e\": 4654,\n \"s\": 4603,\n \"text\": \"Step By Step Spring Boot Docker Deployment Example\"\n },\n {\n \"code\": null,\n \"e\": 4696,\n \"s\": 4654,\n \"text\": \"Spring Boot Hibernate Integration Example\"\n },\n {\n \"code\": null,\n \"e\": 4732,\n \"s\": 4696,\n \"text\": \"Spring Boot JPA Integration Example\"\n },\n {\n \"code\": null,\n \"e\": 4794,\n \"s\": 4732,\n \"text\": \"Spring boot exception handling rest service (CRUD) operations\"\n },\n {\n \"code\": null,\n \"e\": 4836,\n \"s\": 4794,\n \"text\": \"Spring Boot MongoDB + Spring Data Example\"\n },\n {\n \"code\": null,\n \"e\": 4870,\n \"s\": 4836,\n \"text\": \"Spring Boot MVC Example Tutorials\"\n },\n {\n \"code\": null,\n \"e\": 4923,\n \"s\": 4870,\n \"text\": \"Spring Boot How to change the Tomcat to Jetty Server\"\n },\n {\n \"code\": null,\n \"e\": 4960,\n \"s\": 4923,\n \"text\": \"How to Send Mail Spring Boot Example\"\n },\n {\n \"code\": null,\n \"e\": 4997,\n \"s\": 4960,\n \"text\": \"How to set Spring boot favicon image\"\n },\n {\n \"code\": null,\n \"e\": 5834,\n \"s\": 4997,\n \"text\": \"\\n\\n\\n\\n\\n\\nSpring Boot Training\\nMarch 2, 2018 at 9:36 am - Reply \\n\\nLooking nice information about Spring Boot\\nPlz do keep sharing on\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nbhanu pratap\\nJuly 24, 2018 at 2:57 pm - Reply \\n\\nGood Article,valuable information, Best software Training institute in Bangalore \\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvinod kumar mvn\\nAugust 31, 2018 at 2:45 pm - Reply \\n\\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\\nThanks\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nKatherine\\nDecember 27, 2018 at 10:50 am - Reply \\n\\nHello ChandraSekhar,\\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\\n\\n\\n\\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 5965,\n \"s\": 5834,\n \"text\": \"\\n\\n\\n\\n\\nSpring Boot Training\\nMarch 2, 2018 at 9:36 am - Reply \\n\\nLooking nice information about Spring Boot\\nPlz do keep sharing on\\n\\n\\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 6031,\n \"s\": 5965,\n \"text\": \"Looking nice information about Spring Boot\\nPlz do keep sharing on\"\n },\n {\n \"code\": null,\n \"e\": 6170,\n \"s\": 6031,\n \"text\": \"\\n\\n\\n\\n\\nbhanu pratap\\nJuly 24, 2018 at 2:57 pm - Reply \\n\\nGood Article,valuable information, Best software Training institute in Bangalore \\n\\n\\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 6252,\n \"s\": 6170,\n \"text\": \"Good Article,valuable information, Best software Training institute in Bangalore \"\n },\n {\n \"code\": null,\n \"e\": 6518,\n \"s\": 6252,\n \"text\": \"\\n\\n\\n\\n\\nvinod kumar mvn\\nAugust 31, 2018 at 2:45 pm - Reply \\n\\nThe Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\\nThanks\\n\\n\\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 6715,\n \"s\": 6518,\n \"text\": \"The Article is very Informative and Worth Reading For the Candidates like me. Currently, I am learning spring boot training and this Article is helpful for me to understand the things very easily.\"\n },\n {\n \"code\": null,\n \"e\": 6722,\n \"s\": 6715,\n \"text\": \"Thanks\"\n },\n {\n \"code\": null,\n \"e\": 7021,\n \"s\": 6722,\n \"text\": \"\\n\\n\\n\\n\\nKatherine\\nDecember 27, 2018 at 10:50 am - Reply \\n\\nHello ChandraSekhar,\\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\\n\\n\\n\\n\"\n },\n {\n \"code\": null,\n \"e\": 7261,\n \"s\": 7021,\n \"text\": \"Hello ChandraSekhar,\\nI really Appreciate your work, here you given a very informative post. As a beginner to SpingBoot technology, I found some new points, which is very much usefull for me. And thiss very much helpfull for every beginner.\"\n },\n {\n \"code\": null,\n \"e\": 7267,\n \"s\": 7265,\n \"text\": \"Δ\"\n },\n {\n \"code\": null,\n \"e\": 7294,\n \"s\": 7267,\n \"text\": \" Spring Boot – Hello World\"\n },\n {\n \"code\": null,\n \"e\": 7321,\n \"s\": 7294,\n \"text\": \" Spring Boot – MVC Example\"\n },\n {\n \"code\": null,\n \"e\": 7355,\n \"s\": 7321,\n \"text\": \" Spring Boot- Change Context Path\"\n },\n {\n \"code\": null,\n \"e\": 7396,\n \"s\": 7355,\n \"text\": \" Spring Boot – Change Tomcat Port Number\"\n },\n {\n \"code\": null,\n \"e\": 7441,\n \"s\": 7396,\n \"text\": \" Spring Boot – Change Tomcat to Jetty Server\"\n },\n {\n \"code\": null,\n \"e\": 7479,\n \"s\": 7441,\n \"text\": \" Spring Boot – Tomcat session timeout\"\n },\n {\n \"code\": null,\n \"e\": 7513,\n \"s\": 7479,\n \"text\": \" Spring Boot – Enable Random Port\"\n },\n {\n \"code\": null,\n \"e\": 7544,\n \"s\": 7513,\n \"text\": \" Spring Boot – Properties File\"\n },\n {\n \"code\": null,\n \"e\": 7578,\n \"s\": 7544,\n \"text\": \" Spring Boot – Beans Lazy Loading\"\n },\n {\n \"code\": null,\n \"e\": 7611,\n \"s\": 7578,\n \"text\": \" Spring Boot – Set Favicon image\"\n },\n {\n \"code\": null,\n \"e\": 7644,\n \"s\": 7611,\n \"text\": \" Spring Boot – Set Custom Banner\"\n },\n {\n \"code\": null,\n \"e\": 7684,\n \"s\": 7644,\n \"text\": \" Spring Boot – Set Application TimeZone\"\n },\n {\n \"code\": null,\n \"e\": 7709,\n \"s\": 7684,\n \"text\": \" Spring Boot – Send Mail\"\n },\n {\n \"code\": null,\n \"e\": 7740,\n \"s\": 7709,\n \"text\": \" Spring Boot – FileUpload Ajax\"\n },\n {\n \"code\": null,\n \"e\": 7764,\n \"s\": 7740,\n \"text\": \" Spring Boot – Actuator\"\n },\n {\n \"code\": null,\n \"e\": 7810,\n \"s\": 7764,\n \"text\": \" Spring Boot – Actuator Database Health Check\"\n },\n {\n \"code\": null,\n \"e\": 7833,\n \"s\": 7810,\n \"text\": \" Spring Boot – Swagger\"\n },\n {\n \"code\": null,\n \"e\": 7860,\n \"s\": 7833,\n \"text\": \" Spring Boot – Enable CORS\"\n },\n {\n \"code\": null,\n \"e\": 7906,\n \"s\": 7860,\n \"text\": \" Spring Boot – External Apache ActiveMQ Setup\"\n },\n {\n \"code\": null,\n \"e\": 7946,\n \"s\": 7906,\n \"text\": \" Spring Boot – Inmemory Apache ActiveMq\"\n },\n {\n \"code\": null,\n \"e\": 7975,\n \"s\": 7946,\n \"text\": \" Spring Boot – Scheduler Job\"\n },\n {\n \"code\": null,\n \"e\": 8009,\n \"s\": 7975,\n \"text\": \" Spring Boot – Exception Handling\"\n },\n {\n \"code\": null,\n \"e\": 8039,\n \"s\": 8009,\n \"text\": \" Spring Boot – Hibernate CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8075,\n \"s\": 8039,\n \"text\": \" Spring Boot – JPA Integration CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8108,\n \"s\": 8075,\n \"text\": \" Spring Boot – JPA DataRest CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8141,\n \"s\": 8108,\n \"text\": \" Spring Boot – JdbcTemplate CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8185,\n \"s\": 8141,\n \"text\": \" Spring Boot – Multiple Data Sources Config\"\n },\n {\n \"code\": null,\n \"e\": 8219,\n \"s\": 8185,\n \"text\": \" Spring Boot – JNDI Configuration\"\n },\n {\n \"code\": null,\n \"e\": 8251,\n \"s\": 8219,\n \"text\": \" Spring Boot – H2 Database CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8279,\n \"s\": 8251,\n \"text\": \" Spring Boot – MongoDB CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8310,\n \"s\": 8279,\n \"text\": \" Spring Boot – Redis Data CRUD\"\n },\n {\n \"code\": null,\n \"e\": 8351,\n \"s\": 8310,\n \"text\": \" Spring Boot – MVC Login Form Validation\"\n },\n {\n \"code\": null,\n \"e\": 8385,\n \"s\": 8351,\n \"text\": \" Spring Boot – Custom Error Pages\"\n },\n {\n \"code\": null,\n \"e\": 8410,\n \"s\": 8385,\n \"text\": \" Spring Boot – iText PDF\"\n },\n {\n \"code\": null,\n \"e\": 8444,\n \"s\": 8410,\n \"text\": \" Spring Boot – Enable SSL (HTTPs)\"\n },\n {\n \"code\": null,\n \"e\": 8480,\n \"s\": 8444,\n \"text\": \" Spring Boot – Basic Authentication\"\n },\n {\n \"code\": null,\n \"e\": 8526,\n \"s\": 8480,\n \"text\": \" Spring Boot – In Memory Basic Authentication\"\n },\n {\n \"code\": null,\n \"e\": 8577,\n \"s\": 8526,\n \"text\": \" Spring Boot – Security MySQL Database Integration\"\n },\n {\n \"code\": null,\n \"e\": 8619,\n \"s\": 8577,\n \"text\": \" Spring Boot – Redis Cache – Redis Server\"\n },\n {\n \"code\": null,\n \"e\": 8650,\n \"s\": 8619,\n \"text\": \" Spring Boot – Hazelcast Cache\"\n },\n {\n \"code\": null,\n \"e\": 8673,\n \"s\": 8650,\n \"text\": \" Spring Boot – EhCache\"\n },\n {\n \"code\": null,\n \"e\": 8703,\n \"s\": 8673,\n \"text\": \" Spring Boot – Kafka Producer\"\n },\n {\n \"code\": null,\n \"e\": 8733,\n \"s\": 8703,\n \"text\": \" Spring Boot – Kafka Consumer\"\n },\n {\n \"code\": null,\n \"e\": 8782,\n \"s\": 8733,\n \"text\": \" Spring Boot – Kafka JSON Message to Kafka Topic\"\n },\n {\n \"code\": null,\n \"e\": 8816,\n \"s\": 8782,\n \"text\": \" Spring Boot – RabbitMQ Publisher\"\n },\n {\n \"code\": null,\n \"e\": 8849,\n \"s\": 8816,\n \"text\": \" Spring Boot – RabbitMQ Consumer\"\n },\n {\n \"code\": null,\n \"e\": 8878,\n \"s\": 8849,\n \"text\": \" Spring Boot – SOAP Consumer\"\n },\n {\n \"code\": null,\n \"e\": 8910,\n \"s\": 8878,\n \"text\": \" Spring Boot – Soap WebServices\"\n },\n {\n \"code\": null,\n \"e\": 8947,\n \"s\": 8910,\n \"text\": \" Spring Boot – Batch Csv to Database\"\n },\n {\n \"code\": null,\n \"e\": 8976,\n \"s\": 8947,\n \"text\": \" Spring Boot – Eureka Server\"\n },\n {\n \"code\": null,\n \"e\": 9005,\n \"s\": 8976,\n \"text\": \" Spring Boot – MockMvc JUnit\"\n }\n]"}}},{"rowIdx":76526,"cells":{"title":{"kind":"string","value":"Top Python Libraries Used In Data Science | by Tanu N Prabhu | Towards Data Science"},"text":{"kind":"string","value":"Let us understand what are the most important and useful python libraries that can be used in data science.\nData Science, as you all know, it is the process involved in studying the data. Yes, all you got to do is study the data and get new insights from the data. Here there is no need to focus on applying from scratch or learning new algorithms, all you need to know is learn how to approach the data and solve the problem. One of the key things that you need to know is using appropriate libraries to solve a data science problem. This article is all about providing the context to the important libraries used in Data Science. Before dwelling into the topic I would like to introduce the 5 primitive steps involved in solving a data science problem. Now I have sat down and designed these steps from scratch, so there is no right or wrong answer, the correct answer depends on how you approach the data. You can find more tutorials and code for data science, python on my GitHub Repository shown below:\ngithub.com\nGetting the data.Cleaning the dataExploring the dataBuilding the dataPresenting the data\nGetting the data.\nCleaning the data\nExploring the data\nBuilding the data\nPresenting the data\nNow, these steps are designed based on my experience, don’t fall into the assumption that this is the universal answer, but when you sit down and think about the problem, then these steps will make a lot more sense.\nThis is one of the most important steps for solving a data science problem because you have to think of a problem and then eventually think of solving it. One of the best ways to get the data is scraping the data from the internet or download the data set from Kaggle. Now it depends on you how and where to get the data from. I found that Kaggle is one of the best ways to get the data from. Below is the link which leads you to the official website of Kaggle, I need you guys to spend some time in using Kaggle.\nwww.kaggle.com\nAlternatively, you can scrape the data from the websites, to scrape the data you need specific ways and tools to do so. Below is my article where I have shown how to scrape the data from the websites.\ntowardsdatascience.com\nSome of the most important libraries that are used to get or scrape the data from the internet are as shown below:\nBeautiful SoupRequestsPandas\nBeautiful Soup\nRequests\nPandas\nBeautiful Soup: It is a python library that is used to extract or get the data from HTML or the XML files. Below is the official documentation of the Beautiful Soup library, I recommend you to go through the link.\nwww.crummy.com\nTo manually install Beautiful Soup just type the command below, here I have given you how to manually install all the libraries too, and make sure first you have python installed, but I recommend you guys to use Google Colab to type and practice your code, because in google colab you don’t need to install any libraries, you just have to just tell “import library_name” and the Colab will automatically import the library for you.\npip install beautifulsoup4\nTo use Beautiful Soup, you need to import it as shown below:\nfrom bs4 import BeautifulSoupSoup = BeautifulSoup(page_name.text, ‘html.parser’) \nRequests: The Requests library in python is used to send HTTP requests in an easy and more friendly way. There are so many methods in request library one of the most commonly used methods is the request.get() which returns the status of the URL passed whether it is a success or failure. Below is the documentation of the requests library, I recommend you go through the documentation for more details.\nrealpython.com\nTo manually install request type the following command:\npip install requests\nTo import the requests library you need to use:\nimport requestspaga_name = requests.get('url_name')\nPandas: Pandas is a high performance, easy-to-use and convenient data structure and an analysis tool for python programming language. Pandas provide us a data frame to store the data in a clear and concise way. Below is the official documentation of the panda's library.\npandas.pydata.org\nTo manually install pandas just type the code:\npip install pandas \nTo import pandas library all you have to do is:\nimport pandas as pd\nCleaning the data involves removing the duplicate rows, removing the outliers, finding the missing or null values, converting the object values into null values, and plotting them using graphs, these are some steps that are necessarily performed during cleaning the data. To read more about the cleaning process go through my article is shown below:\ntowardsdatascience.com\nSome main libraries that are involved in the data cleaning process are as shown below:\nPandasNumPy\nPandas\nNumPy\nPandas: Yes we use pandas library everywhere in data science, Again I don’t have to give insight about the panda's library, you can refer to the context in the above section.\nNumPy: NumPy is a python library also known as Numeric python which can perform scientific computing. You all must know that python never provides an array data structure, only with the help of a numpy library you can create and perform manipulations on an array. To read the official documentation of numpy library please go through the website down below:\nnumpy.org\nAlso to download the numpy, just run the following command on your command line (make sure you have python installed first):\npython -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose\nTo import numpy in python, all you have to do is just:\nimport numpy as np\nExploratory Data Analysis or (EDA) is understanding the informational indexes by abridging their fundamental attributes regularly plotting them outwardly. In other words, you are exploring the data in a deeper and concise (clear) way. Through the procedure of EDA, we can request to characterize the issue proclamation or definition of our informational collection which is significant. To read more about the EDA process go through please my article showed down below:\ntowardsdatascience.com\nSome main libraries that are used while performing EDA are as shown below:\nPandasSeabornMatplotlib.pyplot\nPandas\nSeaborn\nMatplotlib.pyplot\nPandas: Like I said pandas library is very important we use this library throughout Data Science, for more details of the pandas library go through the first section above.\nSeaborn: Seaborn is a python data visualization library, which provides a high-level interface for drawing graphs with the statistical information. In order to install the latest version of seaborn use:\npip install seaborn\nI recommend you go through the official documentation of seaborn, which is shown below:\nseaborn.pydata.org\nWith the help of seaborn various plots such as bar plot, scatterplot, heat maps and many more can be plotted. To import seaborn all you have to do is:\nimport seaborn as sns\nMatplotlib.pyplot: Matplotlib is a 2D plotting python library, with which we can plot various plots in python across various environments. It is an alternate to seaborn, and seaborn is based on matplotlib. To install matplotlib all you have to do is:\npython -m pip install -U matplotlib\nTo read the official documentation of matplotlib go through the link down below:\nmatplotlib.org\nTo import the matplotlib.pyplot library use the following code:\nimport matplotlib.pyplot as plt\nThis is one of the most important steps in data science and this is step is significantly harder than the rest of the steps because in this step you will build a machine learning model based on your problem statement and your data. Now the problem statement is very important because it is where which leads you to define a problem and think about different solutions. Many of the dataset available on the internet is based on a problem so here your problem-solving skills are very important. Also, there is no one algorithm that fits the best for your solution, you gotta think whether your data falls under regression, classification, clustering or dimension reduction all there are different categories of algorithms. To know more about building a model please go through my article down below:\nmedium.com\nMost of the time, it's a really confusing task to choose the best algorithm, so what I used the SciKit learn algorithms cheat sheet with the help of this you can trace down to see which algorithm fits the best. Below is the cheat sheet from Scikit learn.\nThe important library that is used in building a model is obvious:\nSciKit learn\nSciKit learn\nSciKit learn: It is an easy-to-use Python library that is used to build a machine learning model. It is built on NumPy, SciPy, and matplotlib. Below is the official documentation for the scikit learn library.\nscikit-learn.org\nIn order to import scikit learn, all you have to do is:\nimport sklearn\nTo manually install it, use the following command:\npip install -U scikit-learn\nThis is one of the last tasks that most of them don’t want to do. This is because no one wants to publicly speak about their finding on their data. There is a way of presenting the data. This is vital because at the end of the day you should have the skill to explain your findings to people, make this really small because people are not interested in your algorithms, they are only interested in what is the outcome. So in order to do a presentation of your findings, you need to install Jupyter notebook as shown below:\njupyter.org\nAnd also install one more command which helps your notebook to enable a presentation option:\npip install RISE\nMore instructions on making your notebook into a completely amazing presentation can be found in the article down here. Make sure that you follow each and every line of the tutorial. Also, you can watch a YouTube video for how to do presentations on Jupyter notebooks:\nSo now we have reached the end of the article, you now know how, when and where to use python libraries in data science. That’s pretty much it for this article, I have tried my level best to explain all the things from scratch. If you guys have any doubts then feel free to comment it down below. For more information about data science coding, tutorial please visit my GitHub repository. Thank you guys for reading my article, I hope you enjoyed it, if not let me know what needs to be improved, I’ll correct it. Anyways see you, have a good day."},"parsed":{"kind":"list like","value":[{"code":null,"e":279,"s":171,"text":"Let us understand what are the most important and useful python libraries that can be used in data science."},{"code":null,"e":1179,"s":279,"text":"Data Science, as you all know, it is the process involved in studying the data. Yes, all you got to do is study the data and get new insights from the data. Here there is no need to focus on applying from scratch or learning new algorithms, all you need to know is learn how to approach the data and solve the problem. One of the key things that you need to know is using appropriate libraries to solve a data science problem. This article is all about providing the context to the important libraries used in Data Science. Before dwelling into the topic I would like to introduce the 5 primitive steps involved in solving a data science problem. Now I have sat down and designed these steps from scratch, so there is no right or wrong answer, the correct answer depends on how you approach the data. You can find more tutorials and code for data science, python on my GitHub Repository shown below:"},{"code":null,"e":1190,"s":1179,"text":"github.com"},{"code":null,"e":1279,"s":1190,"text":"Getting the data.Cleaning the dataExploring the dataBuilding the dataPresenting the data"},{"code":null,"e":1297,"s":1279,"text":"Getting the data."},{"code":null,"e":1315,"s":1297,"text":"Cleaning the data"},{"code":null,"e":1334,"s":1315,"text":"Exploring the data"},{"code":null,"e":1352,"s":1334,"text":"Building the data"},{"code":null,"e":1372,"s":1352,"text":"Presenting the data"},{"code":null,"e":1588,"s":1372,"text":"Now, these steps are designed based on my experience, don’t fall into the assumption that this is the universal answer, but when you sit down and think about the problem, then these steps will make a lot more sense."},{"code":null,"e":2102,"s":1588,"text":"This is one of the most important steps for solving a data science problem because you have to think of a problem and then eventually think of solving it. One of the best ways to get the data is scraping the data from the internet or download the data set from Kaggle. Now it depends on you how and where to get the data from. I found that Kaggle is one of the best ways to get the data from. Below is the link which leads you to the official website of Kaggle, I need you guys to spend some time in using Kaggle."},{"code":null,"e":2117,"s":2102,"text":"www.kaggle.com"},{"code":null,"e":2318,"s":2117,"text":"Alternatively, you can scrape the data from the websites, to scrape the data you need specific ways and tools to do so. Below is my article where I have shown how to scrape the data from the websites."},{"code":null,"e":2341,"s":2318,"text":"towardsdatascience.com"},{"code":null,"e":2456,"s":2341,"text":"Some of the most important libraries that are used to get or scrape the data from the internet are as shown below:"},{"code":null,"e":2485,"s":2456,"text":"Beautiful SoupRequestsPandas"},{"code":null,"e":2500,"s":2485,"text":"Beautiful Soup"},{"code":null,"e":2509,"s":2500,"text":"Requests"},{"code":null,"e":2516,"s":2509,"text":"Pandas"},{"code":null,"e":2730,"s":2516,"text":"Beautiful Soup: It is a python library that is used to extract or get the data from HTML or the XML files. Below is the official documentation of the Beautiful Soup library, I recommend you to go through the link."},{"code":null,"e":2745,"s":2730,"text":"www.crummy.com"},{"code":null,"e":3177,"s":2745,"text":"To manually install Beautiful Soup just type the command below, here I have given you how to manually install all the libraries too, and make sure first you have python installed, but I recommend you guys to use Google Colab to type and practice your code, because in google colab you don’t need to install any libraries, you just have to just tell “import library_name” and the Colab will automatically import the library for you."},{"code":null,"e":3204,"s":3177,"text":"pip install beautifulsoup4"},{"code":null,"e":3265,"s":3204,"text":"To use Beautiful Soup, you need to import it as shown below:"},{"code":null,"e":3347,"s":3265,"text":"from bs4 import BeautifulSoupSoup = BeautifulSoup(page_name.text, ‘html.parser’) "},{"code":null,"e":3750,"s":3347,"text":"Requests: The Requests library in python is used to send HTTP requests in an easy and more friendly way. There are so many methods in request library one of the most commonly used methods is the request.get() which returns the status of the URL passed whether it is a success or failure. Below is the documentation of the requests library, I recommend you go through the documentation for more details."},{"code":null,"e":3765,"s":3750,"text":"realpython.com"},{"code":null,"e":3821,"s":3765,"text":"To manually install request type the following command:"},{"code":null,"e":3842,"s":3821,"text":"pip install requests"},{"code":null,"e":3890,"s":3842,"text":"To import the requests library you need to use:"},{"code":null,"e":3942,"s":3890,"text":"import requestspaga_name = requests.get('url_name')"},{"code":null,"e":4213,"s":3942,"text":"Pandas: Pandas is a high performance, easy-to-use and convenient data structure and an analysis tool for python programming language. Pandas provide us a data frame to store the data in a clear and concise way. Below is the official documentation of the panda's library."},{"code":null,"e":4231,"s":4213,"text":"pandas.pydata.org"},{"code":null,"e":4278,"s":4231,"text":"To manually install pandas just type the code:"},{"code":null,"e":4298,"s":4278,"text":"pip install pandas "},{"code":null,"e":4346,"s":4298,"text":"To import pandas library all you have to do is:"},{"code":null,"e":4366,"s":4346,"text":"import pandas as pd"},{"code":null,"e":4716,"s":4366,"text":"Cleaning the data involves removing the duplicate rows, removing the outliers, finding the missing or null values, converting the object values into null values, and plotting them using graphs, these are some steps that are necessarily performed during cleaning the data. To read more about the cleaning process go through my article is shown below:"},{"code":null,"e":4739,"s":4716,"text":"towardsdatascience.com"},{"code":null,"e":4826,"s":4739,"text":"Some main libraries that are involved in the data cleaning process are as shown below:"},{"code":null,"e":4838,"s":4826,"text":"PandasNumPy"},{"code":null,"e":4845,"s":4838,"text":"Pandas"},{"code":null,"e":4851,"s":4845,"text":"NumPy"},{"code":null,"e":5026,"s":4851,"text":"Pandas: Yes we use pandas library everywhere in data science, Again I don’t have to give insight about the panda's library, you can refer to the context in the above section."},{"code":null,"e":5384,"s":5026,"text":"NumPy: NumPy is a python library also known as Numeric python which can perform scientific computing. You all must know that python never provides an array data structure, only with the help of a numpy library you can create and perform manipulations on an array. To read the official documentation of numpy library please go through the website down below:"},{"code":null,"e":5394,"s":5384,"text":"numpy.org"},{"code":null,"e":5519,"s":5394,"text":"Also to download the numpy, just run the following command on your command line (make sure you have python installed first):"},{"code":null,"e":5605,"s":5519,"text":"python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose"},{"code":null,"e":5660,"s":5605,"text":"To import numpy in python, all you have to do is just:"},{"code":null,"e":5679,"s":5660,"text":"import numpy as np"},{"code":null,"e":6149,"s":5679,"text":"Exploratory Data Analysis or (EDA) is understanding the informational indexes by abridging their fundamental attributes regularly plotting them outwardly. In other words, you are exploring the data in a deeper and concise (clear) way. Through the procedure of EDA, we can request to characterize the issue proclamation or definition of our informational collection which is significant. To read more about the EDA process go through please my article showed down below:"},{"code":null,"e":6172,"s":6149,"text":"towardsdatascience.com"},{"code":null,"e":6247,"s":6172,"text":"Some main libraries that are used while performing EDA are as shown below:"},{"code":null,"e":6278,"s":6247,"text":"PandasSeabornMatplotlib.pyplot"},{"code":null,"e":6285,"s":6278,"text":"Pandas"},{"code":null,"e":6293,"s":6285,"text":"Seaborn"},{"code":null,"e":6311,"s":6293,"text":"Matplotlib.pyplot"},{"code":null,"e":6484,"s":6311,"text":"Pandas: Like I said pandas library is very important we use this library throughout Data Science, for more details of the pandas library go through the first section above."},{"code":null,"e":6687,"s":6484,"text":"Seaborn: Seaborn is a python data visualization library, which provides a high-level interface for drawing graphs with the statistical information. In order to install the latest version of seaborn use:"},{"code":null,"e":6707,"s":6687,"text":"pip install seaborn"},{"code":null,"e":6795,"s":6707,"text":"I recommend you go through the official documentation of seaborn, which is shown below:"},{"code":null,"e":6814,"s":6795,"text":"seaborn.pydata.org"},{"code":null,"e":6965,"s":6814,"text":"With the help of seaborn various plots such as bar plot, scatterplot, heat maps and many more can be plotted. To import seaborn all you have to do is:"},{"code":null,"e":6987,"s":6965,"text":"import seaborn as sns"},{"code":null,"e":7238,"s":6987,"text":"Matplotlib.pyplot: Matplotlib is a 2D plotting python library, with which we can plot various plots in python across various environments. It is an alternate to seaborn, and seaborn is based on matplotlib. To install matplotlib all you have to do is:"},{"code":null,"e":7274,"s":7238,"text":"python -m pip install -U matplotlib"},{"code":null,"e":7355,"s":7274,"text":"To read the official documentation of matplotlib go through the link down below:"},{"code":null,"e":7370,"s":7355,"text":"matplotlib.org"},{"code":null,"e":7434,"s":7370,"text":"To import the matplotlib.pyplot library use the following code:"},{"code":null,"e":7466,"s":7434,"text":"import matplotlib.pyplot as plt"},{"code":null,"e":8264,"s":7466,"text":"This is one of the most important steps in data science and this is step is significantly harder than the rest of the steps because in this step you will build a machine learning model based on your problem statement and your data. Now the problem statement is very important because it is where which leads you to define a problem and think about different solutions. Many of the dataset available on the internet is based on a problem so here your problem-solving skills are very important. Also, there is no one algorithm that fits the best for your solution, you gotta think whether your data falls under regression, classification, clustering or dimension reduction all there are different categories of algorithms. To know more about building a model please go through my article down below:"},{"code":null,"e":8275,"s":8264,"text":"medium.com"},{"code":null,"e":8530,"s":8275,"text":"Most of the time, it's a really confusing task to choose the best algorithm, so what I used the SciKit learn algorithms cheat sheet with the help of this you can trace down to see which algorithm fits the best. Below is the cheat sheet from Scikit learn."},{"code":null,"e":8597,"s":8530,"text":"The important library that is used in building a model is obvious:"},{"code":null,"e":8610,"s":8597,"text":"SciKit learn"},{"code":null,"e":8623,"s":8610,"text":"SciKit learn"},{"code":null,"e":8832,"s":8623,"text":"SciKit learn: It is an easy-to-use Python library that is used to build a machine learning model. It is built on NumPy, SciPy, and matplotlib. Below is the official documentation for the scikit learn library."},{"code":null,"e":8849,"s":8832,"text":"scikit-learn.org"},{"code":null,"e":8905,"s":8849,"text":"In order to import scikit learn, all you have to do is:"},{"code":null,"e":8920,"s":8905,"text":"import sklearn"},{"code":null,"e":8971,"s":8920,"text":"To manually install it, use the following command:"},{"code":null,"e":8999,"s":8971,"text":"pip install -U scikit-learn"},{"code":null,"e":9522,"s":8999,"text":"This is one of the last tasks that most of them don’t want to do. This is because no one wants to publicly speak about their finding on their data. There is a way of presenting the data. This is vital because at the end of the day you should have the skill to explain your findings to people, make this really small because people are not interested in your algorithms, they are only interested in what is the outcome. So in order to do a presentation of your findings, you need to install Jupyter notebook as shown below:"},{"code":null,"e":9534,"s":9522,"text":"jupyter.org"},{"code":null,"e":9627,"s":9534,"text":"And also install one more command which helps your notebook to enable a presentation option:"},{"code":null,"e":9644,"s":9627,"text":"pip install RISE"},{"code":null,"e":9913,"s":9644,"text":"More instructions on making your notebook into a completely amazing presentation can be found in the article down here. Make sure that you follow each and every line of the tutorial. Also, you can watch a YouTube video for how to do presentations on Jupyter notebooks:"}],"string":"[\n {\n \"code\": null,\n \"e\": 279,\n \"s\": 171,\n \"text\": \"Let us understand what are the most important and useful python libraries that can be used in data science.\"\n },\n {\n \"code\": null,\n \"e\": 1179,\n \"s\": 279,\n \"text\": \"Data Science, as you all know, it is the process involved in studying the data. Yes, all you got to do is study the data and get new insights from the data. Here there is no need to focus on applying from scratch or learning new algorithms, all you need to know is learn how to approach the data and solve the problem. One of the key things that you need to know is using appropriate libraries to solve a data science problem. This article is all about providing the context to the important libraries used in Data Science. Before dwelling into the topic I would like to introduce the 5 primitive steps involved in solving a data science problem. Now I have sat down and designed these steps from scratch, so there is no right or wrong answer, the correct answer depends on how you approach the data. You can find more tutorials and code for data science, python on my GitHub Repository shown below:\"\n },\n {\n \"code\": null,\n \"e\": 1190,\n \"s\": 1179,\n \"text\": \"github.com\"\n },\n {\n \"code\": null,\n \"e\": 1279,\n \"s\": 1190,\n \"text\": \"Getting the data.Cleaning the dataExploring the dataBuilding the dataPresenting the data\"\n },\n {\n \"code\": null,\n \"e\": 1297,\n \"s\": 1279,\n \"text\": \"Getting the data.\"\n },\n {\n \"code\": null,\n \"e\": 1315,\n \"s\": 1297,\n \"text\": \"Cleaning the data\"\n },\n {\n \"code\": null,\n \"e\": 1334,\n \"s\": 1315,\n \"text\": \"Exploring the data\"\n },\n {\n \"code\": null,\n \"e\": 1352,\n \"s\": 1334,\n \"text\": \"Building the data\"\n },\n {\n \"code\": null,\n \"e\": 1372,\n \"s\": 1352,\n \"text\": \"Presenting the data\"\n },\n {\n \"code\": null,\n \"e\": 1588,\n \"s\": 1372,\n \"text\": \"Now, these steps are designed based on my experience, don’t fall into the assumption that this is the universal answer, but when you sit down and think about the problem, then these steps will make a lot more sense.\"\n },\n {\n \"code\": null,\n \"e\": 2102,\n \"s\": 1588,\n \"text\": \"This is one of the most important steps for solving a data science problem because you have to think of a problem and then eventually think of solving it. One of the best ways to get the data is scraping the data from the internet or download the data set from Kaggle. Now it depends on you how and where to get the data from. I found that Kaggle is one of the best ways to get the data from. Below is the link which leads you to the official website of Kaggle, I need you guys to spend some time in using Kaggle.\"\n },\n {\n \"code\": null,\n \"e\": 2117,\n \"s\": 2102,\n \"text\": \"www.kaggle.com\"\n },\n {\n \"code\": null,\n \"e\": 2318,\n \"s\": 2117,\n \"text\": \"Alternatively, you can scrape the data from the websites, to scrape the data you need specific ways and tools to do so. Below is my article where I have shown how to scrape the data from the websites.\"\n },\n {\n \"code\": null,\n \"e\": 2341,\n \"s\": 2318,\n \"text\": \"towardsdatascience.com\"\n },\n {\n \"code\": null,\n \"e\": 2456,\n \"s\": 2341,\n \"text\": \"Some of the most important libraries that are used to get or scrape the data from the internet are as shown below:\"\n },\n {\n \"code\": null,\n \"e\": 2485,\n \"s\": 2456,\n \"text\": \"Beautiful SoupRequestsPandas\"\n },\n {\n \"code\": null,\n \"e\": 2500,\n \"s\": 2485,\n \"text\": \"Beautiful Soup\"\n },\n {\n \"code\": null,\n \"e\": 2509,\n \"s\": 2500,\n \"text\": \"Requests\"\n },\n {\n \"code\": null,\n \"e\": 2516,\n \"s\": 2509,\n \"text\": \"Pandas\"\n },\n {\n \"code\": null,\n \"e\": 2730,\n \"s\": 2516,\n \"text\": \"Beautiful Soup: It is a python library that is used to extract or get the data from HTML or the XML files. Below is the official documentation of the Beautiful Soup library, I recommend you to go through the link.\"\n },\n {\n \"code\": null,\n \"e\": 2745,\n \"s\": 2730,\n \"text\": \"www.crummy.com\"\n },\n {\n \"code\": null,\n \"e\": 3177,\n \"s\": 2745,\n \"text\": \"To manually install Beautiful Soup just type the command below, here I have given you how to manually install all the libraries too, and make sure first you have python installed, but I recommend you guys to use Google Colab to type and practice your code, because in google colab you don’t need to install any libraries, you just have to just tell “import library_name” and the Colab will automatically import the library for you.\"\n },\n {\n \"code\": null,\n \"e\": 3204,\n \"s\": 3177,\n \"text\": \"pip install beautifulsoup4\"\n },\n {\n \"code\": null,\n \"e\": 3265,\n \"s\": 3204,\n \"text\": \"To use Beautiful Soup, you need to import it as shown below:\"\n },\n {\n \"code\": null,\n \"e\": 3347,\n \"s\": 3265,\n \"text\": \"from bs4 import BeautifulSoupSoup = BeautifulSoup(page_name.text, ‘html.parser’) \"\n },\n {\n \"code\": null,\n \"e\": 3750,\n \"s\": 3347,\n \"text\": \"Requests: The Requests library in python is used to send HTTP requests in an easy and more friendly way. There are so many methods in request library one of the most commonly used methods is the request.get() which returns the status of the URL passed whether it is a success or failure. Below is the documentation of the requests library, I recommend you go through the documentation for more details.\"\n },\n {\n \"code\": null,\n \"e\": 3765,\n \"s\": 3750,\n \"text\": \"realpython.com\"\n },\n {\n \"code\": null,\n \"e\": 3821,\n \"s\": 3765,\n \"text\": \"To manually install request type the following command:\"\n },\n {\n \"code\": null,\n \"e\": 3842,\n \"s\": 3821,\n \"text\": \"pip install requests\"\n },\n {\n \"code\": null,\n \"e\": 3890,\n \"s\": 3842,\n \"text\": \"To import the requests library you need to use:\"\n },\n {\n \"code\": null,\n \"e\": 3942,\n \"s\": 3890,\n \"text\": \"import requestspaga_name = requests.get('url_name')\"\n },\n {\n \"code\": null,\n \"e\": 4213,\n \"s\": 3942,\n \"text\": \"Pandas: Pandas is a high performance, easy-to-use and convenient data structure and an analysis tool for python programming language. Pandas provide us a data frame to store the data in a clear and concise way. Below is the official documentation of the panda's library.\"\n },\n {\n \"code\": null,\n \"e\": 4231,\n \"s\": 4213,\n \"text\": \"pandas.pydata.org\"\n },\n {\n \"code\": null,\n \"e\": 4278,\n \"s\": 4231,\n \"text\": \"To manually install pandas just type the code:\"\n },\n {\n \"code\": null,\n \"e\": 4298,\n \"s\": 4278,\n \"text\": \"pip install pandas \"\n },\n {\n \"code\": null,\n \"e\": 4346,\n \"s\": 4298,\n \"text\": \"To import pandas library all you have to do is:\"\n },\n {\n \"code\": null,\n \"e\": 4366,\n \"s\": 4346,\n \"text\": \"import pandas as pd\"\n },\n {\n \"code\": null,\n \"e\": 4716,\n \"s\": 4366,\n \"text\": \"Cleaning the data involves removing the duplicate rows, removing the outliers, finding the missing or null values, converting the object values into null values, and plotting them using graphs, these are some steps that are necessarily performed during cleaning the data. To read more about the cleaning process go through my article is shown below:\"\n },\n {\n \"code\": null,\n \"e\": 4739,\n \"s\": 4716,\n \"text\": \"towardsdatascience.com\"\n },\n {\n \"code\": null,\n \"e\": 4826,\n \"s\": 4739,\n \"text\": \"Some main libraries that are involved in the data cleaning process are as shown below:\"\n },\n {\n \"code\": null,\n \"e\": 4838,\n \"s\": 4826,\n \"text\": \"PandasNumPy\"\n },\n {\n \"code\": null,\n \"e\": 4845,\n \"s\": 4838,\n \"text\": \"Pandas\"\n },\n {\n \"code\": null,\n \"e\": 4851,\n \"s\": 4845,\n \"text\": \"NumPy\"\n },\n {\n \"code\": null,\n \"e\": 5026,\n \"s\": 4851,\n \"text\": \"Pandas: Yes we use pandas library everywhere in data science, Again I don’t have to give insight about the panda's library, you can refer to the context in the above section.\"\n },\n {\n \"code\": null,\n \"e\": 5384,\n \"s\": 5026,\n \"text\": \"NumPy: NumPy is a python library also known as Numeric python which can perform scientific computing. You all must know that python never provides an array data structure, only with the help of a numpy library you can create and perform manipulations on an array. To read the official documentation of numpy library please go through the website down below:\"\n },\n {\n \"code\": null,\n \"e\": 5394,\n \"s\": 5384,\n \"text\": \"numpy.org\"\n },\n {\n \"code\": null,\n \"e\": 5519,\n \"s\": 5394,\n \"text\": \"Also to download the numpy, just run the following command on your command line (make sure you have python installed first):\"\n },\n {\n \"code\": null,\n \"e\": 5605,\n \"s\": 5519,\n \"text\": \"python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose\"\n },\n {\n \"code\": null,\n \"e\": 5660,\n \"s\": 5605,\n \"text\": \"To import numpy in python, all you have to do is just:\"\n },\n {\n \"code\": null,\n \"e\": 5679,\n \"s\": 5660,\n \"text\": \"import numpy as np\"\n },\n {\n \"code\": null,\n \"e\": 6149,\n \"s\": 5679,\n \"text\": \"Exploratory Data Analysis or (EDA) is understanding the informational indexes by abridging their fundamental attributes regularly plotting them outwardly. In other words, you are exploring the data in a deeper and concise (clear) way. Through the procedure of EDA, we can request to characterize the issue proclamation or definition of our informational collection which is significant. To read more about the EDA process go through please my article showed down below:\"\n },\n {\n \"code\": null,\n \"e\": 6172,\n \"s\": 6149,\n \"text\": \"towardsdatascience.com\"\n },\n {\n \"code\": null,\n \"e\": 6247,\n \"s\": 6172,\n \"text\": \"Some main libraries that are used while performing EDA are as shown below:\"\n },\n {\n \"code\": null,\n \"e\": 6278,\n \"s\": 6247,\n \"text\": \"PandasSeabornMatplotlib.pyplot\"\n },\n {\n \"code\": null,\n \"e\": 6285,\n \"s\": 6278,\n \"text\": \"Pandas\"\n },\n {\n \"code\": null,\n \"e\": 6293,\n \"s\": 6285,\n \"text\": \"Seaborn\"\n },\n {\n \"code\": null,\n \"e\": 6311,\n \"s\": 6293,\n \"text\": \"Matplotlib.pyplot\"\n },\n {\n \"code\": null,\n \"e\": 6484,\n \"s\": 6311,\n \"text\": \"Pandas: Like I said pandas library is very important we use this library throughout Data Science, for more details of the pandas library go through the first section above.\"\n },\n {\n \"code\": null,\n \"e\": 6687,\n \"s\": 6484,\n \"text\": \"Seaborn: Seaborn is a python data visualization library, which provides a high-level interface for drawing graphs with the statistical information. In order to install the latest version of seaborn use:\"\n },\n {\n \"code\": null,\n \"e\": 6707,\n \"s\": 6687,\n \"text\": \"pip install seaborn\"\n },\n {\n \"code\": null,\n \"e\": 6795,\n \"s\": 6707,\n \"text\": \"I recommend you go through the official documentation of seaborn, which is shown below:\"\n },\n {\n \"code\": null,\n \"e\": 6814,\n \"s\": 6795,\n \"text\": \"seaborn.pydata.org\"\n },\n {\n \"code\": null,\n \"e\": 6965,\n \"s\": 6814,\n \"text\": \"With the help of seaborn various plots such as bar plot, scatterplot, heat maps and many more can be plotted. To import seaborn all you have to do is:\"\n },\n {\n \"code\": null,\n \"e\": 6987,\n \"s\": 6965,\n \"text\": \"import seaborn as sns\"\n },\n {\n \"code\": null,\n \"e\": 7238,\n \"s\": 6987,\n \"text\": \"Matplotlib.pyplot: Matplotlib is a 2D plotting python library, with which we can plot various plots in python across various environments. It is an alternate to seaborn, and seaborn is based on matplotlib. To install matplotlib all you have to do is:\"\n },\n {\n \"code\": null,\n \"e\": 7274,\n \"s\": 7238,\n \"text\": \"python -m pip install -U matplotlib\"\n },\n {\n \"code\": null,\n \"e\": 7355,\n \"s\": 7274,\n \"text\": \"To read the official documentation of matplotlib go through the link down below:\"\n },\n {\n \"code\": null,\n \"e\": 7370,\n \"s\": 7355,\n \"text\": \"matplotlib.org\"\n },\n {\n \"code\": null,\n \"e\": 7434,\n \"s\": 7370,\n \"text\": \"To import the matplotlib.pyplot library use the following code:\"\n },\n {\n \"code\": null,\n \"e\": 7466,\n \"s\": 7434,\n \"text\": \"import matplotlib.pyplot as plt\"\n },\n {\n \"code\": null,\n \"e\": 8264,\n \"s\": 7466,\n \"text\": \"This is one of the most important steps in data science and this is step is significantly harder than the rest of the steps because in this step you will build a machine learning model based on your problem statement and your data. Now the problem statement is very important because it is where which leads you to define a problem and think about different solutions. Many of the dataset available on the internet is based on a problem so here your problem-solving skills are very important. Also, there is no one algorithm that fits the best for your solution, you gotta think whether your data falls under regression, classification, clustering or dimension reduction all there are different categories of algorithms. To know more about building a model please go through my article down below:\"\n },\n {\n \"code\": null,\n \"e\": 8275,\n \"s\": 8264,\n \"text\": \"medium.com\"\n },\n {\n \"code\": null,\n \"e\": 8530,\n \"s\": 8275,\n \"text\": \"Most of the time, it's a really confusing task to choose the best algorithm, so what I used the SciKit learn algorithms cheat sheet with the help of this you can trace down to see which algorithm fits the best. Below is the cheat sheet from Scikit learn.\"\n },\n {\n \"code\": null,\n \"e\": 8597,\n \"s\": 8530,\n \"text\": \"The important library that is used in building a model is obvious:\"\n },\n {\n \"code\": null,\n \"e\": 8610,\n \"s\": 8597,\n \"text\": \"SciKit learn\"\n },\n {\n \"code\": null,\n \"e\": 8623,\n \"s\": 8610,\n \"text\": \"SciKit learn\"\n },\n {\n \"code\": null,\n \"e\": 8832,\n \"s\": 8623,\n \"text\": \"SciKit learn: It is an easy-to-use Python library that is used to build a machine learning model. It is built on NumPy, SciPy, and matplotlib. Below is the official documentation for the scikit learn library.\"\n },\n {\n \"code\": null,\n \"e\": 8849,\n \"s\": 8832,\n \"text\": \"scikit-learn.org\"\n },\n {\n \"code\": null,\n \"e\": 8905,\n \"s\": 8849,\n \"text\": \"In order to import scikit learn, all you have to do is:\"\n },\n {\n \"code\": null,\n \"e\": 8920,\n \"s\": 8905,\n \"text\": \"import sklearn\"\n },\n {\n \"code\": null,\n \"e\": 8971,\n \"s\": 8920,\n \"text\": \"To manually install it, use the following command:\"\n },\n {\n \"code\": null,\n \"e\": 8999,\n \"s\": 8971,\n \"text\": \"pip install -U scikit-learn\"\n },\n {\n \"code\": null,\n \"e\": 9522,\n \"s\": 8999,\n \"text\": \"This is one of the last tasks that most of them don’t want to do. This is because no one wants to publicly speak about their finding on their data. There is a way of presenting the data. This is vital because at the end of the day you should have the skill to explain your findings to people, make this really small because people are not interested in your algorithms, they are only interested in what is the outcome. So in order to do a presentation of your findings, you need to install Jupyter notebook as shown below:\"\n },\n {\n \"code\": null,\n \"e\": 9534,\n \"s\": 9522,\n \"text\": \"jupyter.org\"\n },\n {\n \"code\": null,\n \"e\": 9627,\n \"s\": 9534,\n \"text\": \"And also install one more command which helps your notebook to enable a presentation option:\"\n },\n {\n \"code\": null,\n \"e\": 9644,\n \"s\": 9627,\n \"text\": \"pip install RISE\"\n },\n {\n \"code\": null,\n \"e\": 9913,\n \"s\": 9644,\n \"text\": \"More instructions on making your notebook into a completely amazing presentation can be found in the article down here. Make sure that you follow each and every line of the tutorial. Also, you can watch a YouTube video for how to do presentations on Jupyter notebooks:\"\n }\n]"}}},{"rowIdx":76527,"cells":{"title":{"kind":"string","value":"Maximum prefix sum for a given range | Practice | GeeksforGeeks"},"text":{"kind":"string","value":"Given an array of N integers and Q queries, each query having a range from index L to R. Find the maximum prefix-sum for the range L to R.\nNote: Assume 0 based indexing.\nExample 1:\nInput: \na[ ] = {-1, 2, 3, -5} \nQ = 2\nL1 = 0, R1 = 3\nL2 = 1, R2 = 3\nOutput:\n4 5\nExplanation:\nThe range (0, 3) in the 1st query is {-1, 2, 3, -5}, hence, \nthe max prefix-sum will be -1 + 2 + 3 = 4. The range (1, 3) \nin the 2nd query is {2, 3, -5}, hence, the max prefix-sum \nwill be 2 + 3 = 5.\nYour Task: \nYou don't need to read input or print anything. Your task is to complete the function maxPrefixes() which takes the array A[], its size N, array L[] and R[] and their size Q as input parameters and returns a vector storing the required answer for every query.\nExpected Time Complexity: O(N*Q)\nExpected Auxiliary Space: O(1)\nConstraints: \n1 ≤ N, A[i] ≤ 104\n1 ≤ Q ≤ 104\n0 ≤ L[i] ≤ R[i] < N\n0\ngaurav119087902 weeks ago\nfor 0 to 3 range why it isn't 5 ?\n \n0\nharshrajvanshi16 months ago\npeople using python do have feelings bruh.....please dont hurt us with ur faulty drivers every time :'( \n+1\nshaanrattan127 months ago\nvector maxPrefixes(int a[], int L[], int R[], int n, int Q) {\n vector res;\n //prefix array\n int pfx[n], ind = 0;\n pfx[0]=a[0];\n for(int i=1;i maxPrefixes(int a[], int L[], int R[], int n, int Q) { int prefixSum[n]; prefixSum[0]=a[0]; vector vec; for(int i=1;i\n0\naditya anand1 year ago\naditya anand\nWhy python has more driver faults, C'mon python folkes.please fix this errorprint(Solution().*maxPrefixes(a, l, r, n, q))\n0\nsachin chandela1 year ago\nsachin chandela\nSimple Java Solution ;https://uploads.disquscdn.c...\n0\nShubhankit Bansal2 years ago\nShubhankit Bansal\nhttps://ide.geeksforgeeks.o...\nThis code work properly with execution time: 0.15\n0\nG Vishal2 years ago\nG Vishal\njava using segment tree https://ide.geeksforgeeks.o... https://uploads.disquscdn.c... https://uploads.disquscdn.c...\n0\nG Vishal2 years ago\nG Vishal\n@GeeksForGeeks what is wrong with you i wrote entire python code to get tle whyhttps://ide.geeksforgeeks.o... https://uploads.disquscdn.c...\n0\nBicky2 years ago\nBicky\nsimple cpp soln 0.1s\nhttps://ide.geeksforgeeks.o...\nWe strongly recommend solving this problem on your own before viewing its editorial. Do you still\n want to view the editorial?\n Login to access your submissions. \n\nProblem\n\n\nContest\n\nReset the IDE using the second button on the top right corner.\nAvoid using static/global variables in your code as your code is tested against multiple test cases and these tend to retain their previous values.\nPassing the Sample/Custom Test cases does not guarantee the correctness of code. On submission, your code is tested against multiple test cases consisting of all possible corner cases and stress constraints.\nYou can access the hints to get an idea about what is expected of you as well as the final solution code.\nYou can view the solutions submitted by other users from the submission tab."},"parsed":{"kind":"list like","value":[{"code":null,"e":408,"s":238,"text":"Given an array of N integers and Q queries, each query having a range from index L to R. Find the maximum prefix-sum for the range L to R.\nNote: Assume 0 based indexing."},{"code":null,"e":419,"s":408,"text":"Example 1:"},{"code":null,"e":711,"s":419,"text":"Input: \na[ ] = {-1, 2, 3, -5} \nQ = 2\nL1 = 0, R1 = 3\nL2 = 1, R2 = 3\nOutput:\n4 5\nExplanation:\nThe range (0, 3) in the 1st query is {-1, 2, 3, -5}, hence, \nthe max prefix-sum will be -1 + 2 + 3 = 4. The range (1, 3) \nin the 2nd query is {2, 3, -5}, hence, the max prefix-sum \nwill be 2 + 3 = 5."},{"code":null,"e":984,"s":711,"text":"Your Task: \nYou don't need to read input or print anything. Your task is to complete the function maxPrefixes() which takes the array A[], its size N, array L[] and R[] and their size Q as input parameters and returns a vector storing the required answer for every query."},{"code":null,"e":1048,"s":984,"text":"Expected Time Complexity: O(N*Q)\nExpected Auxiliary Space: O(1)"},{"code":null,"e":1112,"s":1048,"text":"Constraints: \n1 ≤ N, A[i] ≤ 104\n1 ≤ Q ≤ 104\n0 ≤ L[i] ≤ R[i] < N"},{"code":null,"e":1114,"s":1112,"text":"0"},{"code":null,"e":1140,"s":1114,"text":"gaurav119087902 weeks ago"},{"code":null,"e":1174,"s":1140,"text":"for 0 to 3 range why it isn't 5 ?"},{"code":null,"e":1178,"s":1176,"text":"0"},{"code":null,"e":1206,"s":1178,"text":"harshrajvanshi16 months ago"},{"code":null,"e":1311,"s":1206,"text":"people using python do have feelings bruh.....please dont hurt us with ur faulty drivers every time :'( "},{"code":null,"e":1314,"s":1311,"text":"+1"},{"code":null,"e":1340,"s":1314,"text":"shaanrattan127 months ago"},{"code":null,"e":1864,"s":1340,"text":"vector maxPrefixes(int a[], int L[], int R[], int n, int Q) {\n vector res;\n //prefix array\n int pfx[n], ind = 0;\n pfx[0]=a[0];\n for(int i=1;i maxPrefixes(int a[], int L[], int R[], int n, int Q) { int prefixSum[n]; prefixSum[0]=a[0]; vector vec; for(int i=1;i"},{"code":null,"e":2365,"s":2363,"text":"0"},{"code":null,"e":2388,"s":2365,"text":"aditya anand1 year ago"},{"code":null,"e":2401,"s":2388,"text":"aditya anand"},{"code":null,"e":2523,"s":2401,"text":"Why python has more driver faults, C'mon python folkes.please fix this errorprint(Solution().*maxPrefixes(a, l, r, n, q))"},{"code":null,"e":2525,"s":2523,"text":"0"},{"code":null,"e":2551,"s":2525,"text":"sachin chandela1 year ago"},{"code":null,"e":2567,"s":2551,"text":"sachin chandela"},{"code":null,"e":2620,"s":2567,"text":"Simple Java Solution ;https://uploads.disquscdn.c..."},{"code":null,"e":2622,"s":2620,"text":"0"},{"code":null,"e":2651,"s":2622,"text":"Shubhankit Bansal2 years ago"},{"code":null,"e":2669,"s":2651,"text":"Shubhankit Bansal"},{"code":null,"e":2700,"s":2669,"text":"https://ide.geeksforgeeks.o..."},{"code":null,"e":2750,"s":2700,"text":"This code work properly with execution time: 0.15"},{"code":null,"e":2752,"s":2750,"text":"0"},{"code":null,"e":2772,"s":2752,"text":"G Vishal2 years ago"},{"code":null,"e":2781,"s":2772,"text":"G Vishal"},{"code":null,"e":2898,"s":2781,"text":"java using segment tree https://ide.geeksforgeeks.o... https://uploads.disquscdn.c... https://uploads.disquscdn.c..."},{"code":null,"e":2900,"s":2898,"text":"0"},{"code":null,"e":2920,"s":2900,"text":"G Vishal2 years ago"},{"code":null,"e":2929,"s":2920,"text":"G Vishal"},{"code":null,"e":3070,"s":2929,"text":"@GeeksForGeeks what is wrong with you i wrote entire python code to get tle whyhttps://ide.geeksforgeeks.o... https://uploads.disquscdn.c..."},{"code":null,"e":3072,"s":3070,"text":"0"},{"code":null,"e":3089,"s":3072,"text":"Bicky2 years ago"},{"code":null,"e":3095,"s":3089,"text":"Bicky"},{"code":null,"e":3116,"s":3095,"text":"simple cpp soln 0.1s"},{"code":null,"e":3147,"s":3116,"text":"https://ide.geeksforgeeks.o..."},{"code":null,"e":3293,"s":3147,"text":"We strongly recommend solving this problem on your own before viewing its editorial. Do you still\n want to view the editorial?"},{"code":null,"e":3329,"s":3293,"text":" Login to access your submissions. "},{"code":null,"e":3339,"s":3329,"text":"\nProblem\n"},{"code":null,"e":3349,"s":3339,"text":"\nContest\n"},{"code":null,"e":3412,"s":3349,"text":"Reset the IDE using the second button on the top right corner."},{"code":null,"e":3560,"s":3412,"text":"Avoid using static/global variables in your code as your code is tested against multiple test cases and these tend to retain their previous values."},{"code":null,"e":3768,"s":3560,"text":"Passing the Sample/Custom Test cases does not guarantee the correctness of code. On submission, your code is tested against multiple test cases consisting of all possible corner cases and stress constraints."},{"code":null,"e":3874,"s":3768,"text":"You can access the hints to get an idea about what is expected of you as well as the final solution code."}],"string":"[\n {\n \"code\": null,\n \"e\": 408,\n \"s\": 238,\n \"text\": \"Given an array of N integers and Q queries, each query having a range from index L to R. Find the maximum prefix-sum for the range L to R.\\nNote: Assume 0 based indexing.\"\n },\n {\n \"code\": null,\n \"e\": 419,\n \"s\": 408,\n \"text\": \"Example 1:\"\n },\n {\n \"code\": null,\n \"e\": 711,\n \"s\": 419,\n \"text\": \"Input: \\na[ ] = {-1, 2, 3, -5} \\nQ = 2\\nL1 = 0, R1 = 3\\nL2 = 1, R2 = 3\\nOutput:\\n4 5\\nExplanation:\\nThe range (0, 3) in the 1st query is {-1, 2, 3, -5}, hence, \\nthe max prefix-sum will be -1 + 2 + 3 = 4. The range (1, 3) \\nin the 2nd query is {2, 3, -5}, hence, the max prefix-sum \\nwill be 2 + 3 = 5.\"\n },\n {\n \"code\": null,\n \"e\": 984,\n \"s\": 711,\n \"text\": \"Your Task: \\nYou don't need to read input or print anything. Your task is to complete the function maxPrefixes() which takes the array A[], its size N, array L[] and R[] and their size Q as input parameters and returns a vector storing the required answer for every query.\"\n },\n {\n \"code\": null,\n \"e\": 1048,\n \"s\": 984,\n \"text\": \"Expected Time Complexity: O(N*Q)\\nExpected Auxiliary Space: O(1)\"\n },\n {\n \"code\": null,\n \"e\": 1112,\n \"s\": 1048,\n \"text\": \"Constraints: \\n1 ≤ N, A[i] ≤ 104\\n1 ≤ Q ≤ 104\\n0 ≤ L[i] ≤ R[i] < N\"\n },\n {\n \"code\": null,\n \"e\": 1114,\n \"s\": 1112,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 1140,\n \"s\": 1114,\n \"text\": \"gaurav119087902 weeks ago\"\n },\n {\n \"code\": null,\n \"e\": 1174,\n \"s\": 1140,\n \"text\": \"for 0 to 3 range why it isn't 5 ?\"\n },\n {\n \"code\": null,\n \"e\": 1178,\n \"s\": 1176,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 1206,\n \"s\": 1178,\n \"text\": \"harshrajvanshi16 months ago\"\n },\n {\n \"code\": null,\n \"e\": 1311,\n \"s\": 1206,\n \"text\": \"people using python do have feelings bruh.....please dont hurt us with ur faulty drivers every time :'( \"\n },\n {\n \"code\": null,\n \"e\": 1314,\n \"s\": 1311,\n \"text\": \"+1\"\n },\n {\n \"code\": null,\n \"e\": 1340,\n \"s\": 1314,\n \"text\": \"shaanrattan127 months ago\"\n },\n {\n \"code\": null,\n \"e\": 1864,\n \"s\": 1340,\n \"text\": \"vector maxPrefixes(int a[], int L[], int R[], int n, int Q) {\\n vector res;\\n //prefix array\\n int pfx[n], ind = 0;\\n pfx[0]=a[0];\\n for(int i=1;i maxPrefixes(int a[], int L[], int R[], int n, int Q) { int prefixSum[n]; prefixSum[0]=a[0]; vector vec; for(int i=1;i\"\n },\n {\n \"code\": null,\n \"e\": 2365,\n \"s\": 2363,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 2388,\n \"s\": 2365,\n \"text\": \"aditya anand1 year ago\"\n },\n {\n \"code\": null,\n \"e\": 2401,\n \"s\": 2388,\n \"text\": \"aditya anand\"\n },\n {\n \"code\": null,\n \"e\": 2523,\n \"s\": 2401,\n \"text\": \"Why python has more driver faults, C'mon python folkes.please fix this errorprint(Solution().*maxPrefixes(a, l, r, n, q))\"\n },\n {\n \"code\": null,\n \"e\": 2525,\n \"s\": 2523,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 2551,\n \"s\": 2525,\n \"text\": \"sachin chandela1 year ago\"\n },\n {\n \"code\": null,\n \"e\": 2567,\n \"s\": 2551,\n \"text\": \"sachin chandela\"\n },\n {\n \"code\": null,\n \"e\": 2620,\n \"s\": 2567,\n \"text\": \"Simple Java Solution ;https://uploads.disquscdn.c...\"\n },\n {\n \"code\": null,\n \"e\": 2622,\n \"s\": 2620,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 2651,\n \"s\": 2622,\n \"text\": \"Shubhankit Bansal2 years ago\"\n },\n {\n \"code\": null,\n \"e\": 2669,\n \"s\": 2651,\n \"text\": \"Shubhankit Bansal\"\n },\n {\n \"code\": null,\n \"e\": 2700,\n \"s\": 2669,\n \"text\": \"https://ide.geeksforgeeks.o...\"\n },\n {\n \"code\": null,\n \"e\": 2750,\n \"s\": 2700,\n \"text\": \"This code work properly with execution time: 0.15\"\n },\n {\n \"code\": null,\n \"e\": 2752,\n \"s\": 2750,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 2772,\n \"s\": 2752,\n \"text\": \"G Vishal2 years ago\"\n },\n {\n \"code\": null,\n \"e\": 2781,\n \"s\": 2772,\n \"text\": \"G Vishal\"\n },\n {\n \"code\": null,\n \"e\": 2898,\n \"s\": 2781,\n \"text\": \"java using segment tree https://ide.geeksforgeeks.o... https://uploads.disquscdn.c... https://uploads.disquscdn.c...\"\n },\n {\n \"code\": null,\n \"e\": 2900,\n \"s\": 2898,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 2920,\n \"s\": 2900,\n \"text\": \"G Vishal2 years ago\"\n },\n {\n \"code\": null,\n \"e\": 2929,\n \"s\": 2920,\n \"text\": \"G Vishal\"\n },\n {\n \"code\": null,\n \"e\": 3070,\n \"s\": 2929,\n \"text\": \"@GeeksForGeeks what is wrong with you i wrote entire python code to get tle whyhttps://ide.geeksforgeeks.o... https://uploads.disquscdn.c...\"\n },\n {\n \"code\": null,\n \"e\": 3072,\n \"s\": 3070,\n \"text\": \"0\"\n },\n {\n \"code\": null,\n \"e\": 3089,\n \"s\": 3072,\n \"text\": \"Bicky2 years ago\"\n },\n {\n \"code\": null,\n \"e\": 3095,\n \"s\": 3089,\n \"text\": \"Bicky\"\n },\n {\n \"code\": null,\n \"e\": 3116,\n \"s\": 3095,\n \"text\": \"simple cpp soln 0.1s\"\n },\n {\n \"code\": null,\n \"e\": 3147,\n \"s\": 3116,\n \"text\": \"https://ide.geeksforgeeks.o...\"\n },\n {\n \"code\": null,\n \"e\": 3293,\n \"s\": 3147,\n \"text\": \"We strongly recommend solving this problem on your own before viewing its editorial. Do you still\\n want to view the editorial?\"\n },\n {\n \"code\": null,\n \"e\": 3329,\n \"s\": 3293,\n \"text\": \" Login to access your submissions. \"\n },\n {\n \"code\": null,\n \"e\": 3339,\n \"s\": 3329,\n \"text\": \"\\nProblem\\n\"\n },\n {\n \"code\": null,\n \"e\": 3349,\n \"s\": 3339,\n \"text\": \"\\nContest\\n\"\n },\n {\n \"code\": null,\n \"e\": 3412,\n \"s\": 3349,\n \"text\": \"Reset the IDE using the second button on the top right corner.\"\n },\n {\n \"code\": null,\n \"e\": 3560,\n \"s\": 3412,\n \"text\": \"Avoid using static/global variables in your code as your code is tested against multiple test cases and these tend to retain their previous values.\"\n },\n {\n \"code\": null,\n \"e\": 3768,\n \"s\": 3560,\n \"text\": \"Passing the Sample/Custom Test cases does not guarantee the correctness of code. On submission, your code is tested against multiple test cases consisting of all possible corner cases and stress constraints.\"\n },\n {\n \"code\": null,\n \"e\": 3874,\n \"s\": 3768,\n \"text\": \"You can access the hints to get an idea about what is expected of you as well as the final solution code.\"\n }\n]"}}},{"rowIdx":76528,"cells":{"title":{"kind":"string","value":"Django model data to JSON data in 2 lines"},"text":{"kind":"string","value":"In this article, we are going to learn a handy trick to convert Django model data directly to JSON data. Sometimes, we need to return model data in JSON format; it can also be used in making API or just showing simple data to our frontend in JSON format. JSON is easy to access so it is really handful.\nCreate a Django project and an app.\nIn settings.py, add the app name in INSTALLED_APPS.\nIn urls.py of the Project main directory, add the following lines −\nfrom django.contrib import admin\nfrom django.urls import path,include\n\nurlpatterns = [\n path('admin/', admin.site.urls),\n path('',include('modeltojson.urls'))\n]\nHere we added our app's urls.py.\nIn the App's urls.py, add the following lines −\nfrom django.urls import path\nfrom . import views\nurlpatterns = [\n path('',views.home,name=\"home\")\n]\nHere we rendered our home view, which is simple.\nIn models.py, add the following lines −\nfrom django.db import models\n\n# Create your models here.\nclass EmployeeData(models.Model):\n name=models.CharField(max_length=100)\n Salary=models.CharField(max_length=100)\n department=models.CharField(max_length=100)\nHere, we created our model and add some dummy data for testing and trying.\nIn admin.py, add the following lines −\nfrom django.contrib import admin\nfrom .models import EmployeeData\n\n# Register your models here.\nadmin.site.register(EmployeeData)\nHere, we simply registered our EmployeeData model in admin page.\nIn views.py, add the following lines\nfrom django.http import JsonResponse\nfrom .models import EmployeeData\n# Create your views here.\ndef home(request):\n data=list(EmployeeData.objects.values())\n return JsonResponse(data,safe=False)\nHere, we created a list of all key-values using .value() function of our model data and then we rendered it as a JSON response.\nNow it is all done, don't forget to add some random data.\n[\n {\n \"id\": 1,\n \"name\": \"Ross Taylor\",\n \"Salary\": \"1 lakh\",\n \"department\": \"Technical\"\n },\n {\n \"id\": 2,\n \"name\": \"Rohit Sharma\",\n \"Salary\": \"2 lakh\",\n \"department\": \"Sales\"\n },\n {\n \"id\": 3,\n \"name\": \"Steve Smith\",\n \"Salary\": \"3 lakh\",\n \"department\": \"Sales\"\n }\n]"},"parsed":{"kind":"list like","value":[{"code":null,"e":1365,"s":1062,"text":"In this article, we are going to learn a handy trick to convert Django model data directly to JSON data. Sometimes, we need to return model data in JSON format; it can also be used in making API or just showing simple data to our frontend in JSON format. JSON is easy to access so it is really handful."},{"code":null,"e":1401,"s":1365,"text":"Create a Django project and an app."},{"code":null,"e":1453,"s":1401,"text":"In settings.py, add the app name in INSTALLED_APPS."},{"code":null,"e":1521,"s":1453,"text":"In urls.py of the Project main directory, add the following lines −"},{"code":null,"e":1686,"s":1521,"text":"from django.contrib import admin\nfrom django.urls import path,include\n\nurlpatterns = [\n path('admin/', admin.site.urls),\n path('',include('modeltojson.urls'))\n]"},{"code":null,"e":1719,"s":1686,"text":"Here we added our app's urls.py."},{"code":null,"e":1767,"s":1719,"text":"In the App's urls.py, add the following lines −"},{"code":null,"e":1869,"s":1767,"text":"from django.urls import path\nfrom . import views\nurlpatterns = [\n path('',views.home,name=\"home\")\n]"},{"code":null,"e":1918,"s":1869,"text":"Here we rendered our home view, which is simple."},{"code":null,"e":1958,"s":1918,"text":"In models.py, add the following lines −"},{"code":null,"e":2180,"s":1958,"text":"from django.db import models\n\n# Create your models here.\nclass EmployeeData(models.Model):\n name=models.CharField(max_length=100)\n Salary=models.CharField(max_length=100)\n department=models.CharField(max_length=100)"},{"code":null,"e":2255,"s":2180,"text":"Here, we created our model and add some dummy data for testing and trying."},{"code":null,"e":2294,"s":2255,"text":"In admin.py, add the following lines −"},{"code":null,"e":2424,"s":2294,"text":"from django.contrib import admin\nfrom .models import EmployeeData\n\n# Register your models here.\nadmin.site.register(EmployeeData)"},{"code":null,"e":2489,"s":2424,"text":"Here, we simply registered our EmployeeData model in admin page."},{"code":null,"e":2526,"s":2489,"text":"In views.py, add the following lines"},{"code":null,"e":2725,"s":2526,"text":"from django.http import JsonResponse\nfrom .models import EmployeeData\n# Create your views here.\ndef home(request):\n data=list(EmployeeData.objects.values())\n return JsonResponse(data,safe=False)"},{"code":null,"e":2853,"s":2725,"text":"Here, we created a list of all key-values using .value() function of our model data and then we rendered it as a JSON response."},{"code":null,"e":2911,"s":2853,"text":"Now it is all done, don't forget to add some random data."},{"code":null,"e":3246,"s":2911,"text":"[\n {\n \"id\": 1,\n \"name\": \"Ross Taylor\",\n \"Salary\": \"1 lakh\",\n \"department\": \"Technical\"\n },\n {\n \"id\": 2,\n \"name\": \"Rohit Sharma\",\n \"Salary\": \"2 lakh\",\n \"department\": \"Sales\"\n },\n {\n \"id\": 3,\n \"name\": \"Steve Smith\",\n \"Salary\": \"3 lakh\",\n \"department\": \"Sales\"\n }\n]"}],"string":"[\n {\n \"code\": null,\n \"e\": 1365,\n \"s\": 1062,\n \"text\": \"In this article, we are going to learn a handy trick to convert Django model data directly to JSON data. Sometimes, we need to return model data in JSON format; it can also be used in making API or just showing simple data to our frontend in JSON format. JSON is easy to access so it is really handful.\"\n },\n {\n \"code\": null,\n \"e\": 1401,\n \"s\": 1365,\n \"text\": \"Create a Django project and an app.\"\n },\n {\n \"code\": null,\n \"e\": 1453,\n \"s\": 1401,\n \"text\": \"In settings.py, add the app name in INSTALLED_APPS.\"\n },\n {\n \"code\": null,\n \"e\": 1521,\n \"s\": 1453,\n \"text\": \"In urls.py of the Project main directory, add the following lines −\"\n },\n {\n \"code\": null,\n \"e\": 1686,\n \"s\": 1521,\n \"text\": \"from django.contrib import admin\\nfrom django.urls import path,include\\n\\nurlpatterns = [\\n path('admin/', admin.site.urls),\\n path('',include('modeltojson.urls'))\\n]\"\n },\n {\n \"code\": null,\n \"e\": 1719,\n \"s\": 1686,\n \"text\": \"Here we added our app's urls.py.\"\n },\n {\n \"code\": null,\n \"e\": 1767,\n \"s\": 1719,\n \"text\": \"In the App's urls.py, add the following lines −\"\n },\n {\n \"code\": null,\n \"e\": 1869,\n \"s\": 1767,\n \"text\": \"from django.urls import path\\nfrom . import views\\nurlpatterns = [\\n path('',views.home,name=\\\"home\\\")\\n]\"\n },\n {\n \"code\": null,\n \"e\": 1918,\n \"s\": 1869,\n \"text\": \"Here we rendered our home view, which is simple.\"\n },\n {\n \"code\": null,\n \"e\": 1958,\n \"s\": 1918,\n \"text\": \"In models.py, add the following lines −\"\n },\n {\n \"code\": null,\n \"e\": 2180,\n \"s\": 1958,\n \"text\": \"from django.db import models\\n\\n# Create your models here.\\nclass EmployeeData(models.Model):\\n name=models.CharField(max_length=100)\\n Salary=models.CharField(max_length=100)\\n department=models.CharField(max_length=100)\"\n },\n {\n \"code\": null,\n \"e\": 2255,\n \"s\": 2180,\n \"text\": \"Here, we created our model and add some dummy data for testing and trying.\"\n },\n {\n \"code\": null,\n \"e\": 2294,\n \"s\": 2255,\n \"text\": \"In admin.py, add the following lines −\"\n },\n {\n \"code\": null,\n \"e\": 2424,\n \"s\": 2294,\n \"text\": \"from django.contrib import admin\\nfrom .models import EmployeeData\\n\\n# Register your models here.\\nadmin.site.register(EmployeeData)\"\n },\n {\n \"code\": null,\n \"e\": 2489,\n \"s\": 2424,\n \"text\": \"Here, we simply registered our EmployeeData model in admin page.\"\n },\n {\n \"code\": null,\n \"e\": 2526,\n \"s\": 2489,\n \"text\": \"In views.py, add the following lines\"\n },\n {\n \"code\": null,\n \"e\": 2725,\n \"s\": 2526,\n \"text\": \"from django.http import JsonResponse\\nfrom .models import EmployeeData\\n# Create your views here.\\ndef home(request):\\n data=list(EmployeeData.objects.values())\\n return JsonResponse(data,safe=False)\"\n },\n {\n \"code\": null,\n \"e\": 2853,\n \"s\": 2725,\n \"text\": \"Here, we created a list of all key-values using .value() function of our model data and then we rendered it as a JSON response.\"\n },\n {\n \"code\": null,\n \"e\": 2911,\n \"s\": 2853,\n \"text\": \"Now it is all done, don't forget to add some random data.\"\n },\n {\n \"code\": null,\n \"e\": 3246,\n \"s\": 2911,\n \"text\": \"[\\n {\\n \\\"id\\\": 1,\\n \\\"name\\\": \\\"Ross Taylor\\\",\\n \\\"Salary\\\": \\\"1 lakh\\\",\\n \\\"department\\\": \\\"Technical\\\"\\n },\\n {\\n \\\"id\\\": 2,\\n \\\"name\\\": \\\"Rohit Sharma\\\",\\n \\\"Salary\\\": \\\"2 lakh\\\",\\n \\\"department\\\": \\\"Sales\\\"\\n },\\n {\\n \\\"id\\\": 3,\\n \\\"name\\\": \\\"Steve Smith\\\",\\n \\\"Salary\\\": \\\"3 lakh\\\",\\n \\\"department\\\": \\\"Sales\\\"\\n }\\n]\"\n }\n]"}}},{"rowIdx":76529,"cells":{"title":{"kind":"string","value":"XSLT