1- <!DOCTYPE html>
1+ <!DOCTYPE html>
22< html lang ="en ">
33< head >
44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < title > Data Structures & Algorithms - Java Learning Hub</ title >
7- < link rel ="stylesheet " href ="../styles.css ">
7+ < link rel ="stylesheet " href ="../styles.css?v=1781361599 ">
88 < link rel ="stylesheet " href ="../java-basics/module.css ">
99</ head >
1010< body >
@@ -51,7 +51,7 @@ <h1>Data Structures & Algorithms</h1>
5151 < aside class ="sidebar ">
5252 < div class ="toc ">
5353 < h3 > Topics</ h3 >
54- < ul >
54+ < ul id =" tocList " >
5555 < li > < a href ="#arrays "> Arrays & Strings</ a > </ li >
5656 < li > < a href ="#linked-lists "> Linked Lists</ a > </ li >
5757 < li > < a href ="#stacks-queues "> Stacks & Queues</ a > </ li >
@@ -118,7 +118,7 @@ <h3>Big O Notation (Time Complexity)</h3>
118118 < td > Merge Sort, Quick Sort</ td >
119119 </ tr >
120120 < tr >
121- < td > < strong > O(n² )</ strong > </ td >
121+ < td > < strong > O(n² )</ strong > </ td >
122122 < td > Quadratic</ td >
123123 < td > Bubble Sort, Nested Loop</ td >
124124 </ tr >
@@ -141,24 +141,24 @@ <h2>Arrays & Strings</h2>
141141
142142 < h3 > Common Problems</ h3 >
143143 < div class ="practice-card ">
144- < h4 > 🔗 Two Sum | LeetCode #1</ h4 >
144+ < h4 > Two Sum | LeetCode #1</ h4 >
145145 < p > < strong > Problem:</ strong > Given an array, find two numbers that add up to a target.</ p >
146146 < p > < strong > Time: O(n), Space: O(n)</ strong > </ p >
147- < p > < a href ="https://leetcode.com/problems/two-sum/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
147+ < p > < a href ="https://leetcode.com/problems/two-sum/ " target ="_blank "> Practice on LeetCode</ a > </ p >
148148 </ div >
149149
150150 < div class ="practice-card ">
151- < h4 > 💧 Container With Most Water | LeetCode #11</ h4 >
151+ < h4 > Container With Most Water | LeetCode #11</ h4 >
152152 < p > < strong > Problem:</ strong > Find two lines that together with the x-axis form a container with maximum area.</ p >
153153 < p > < strong > Time: O(n), Space: O(1)</ strong > </ p >
154- < p > < a href ="https://leetcode.com/problems/container-with-most-water/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
154+ < p > < a href ="https://leetcode.com/problems/container-with-most-water/ " target ="_blank "> Practice on LeetCode</ a > </ p >
155155 </ div >
156156
157157 < div class ="practice-card ">
158- < h4 > 🔀 3Sum | LeetCode #15</ h4 >
158+ < h4 > 3Sum | LeetCode #15</ h4 >
159159 < p > < strong > Problem:</ strong > Find all unique triplets that sum to zero.</ p >
160160 < p > < strong > Time: O(n✓ Space: O(1)</ strong > </ p >
161- < p > < a href ="https://leetcode.com/problems/3sum/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
161+ < p > < a href ="https://leetcode.com/problems/3sum/ " target ="_blank "> Practice on LeetCode</ a > </ p >
162162 </ div >
163163 </ section >
164164
@@ -225,15 +225,15 @@ <h3>Basic Operations</h3>
225225
226226 < h3 > LeetCode Problems</ h3 >
227227 < div class ="practice-card ">
228- < h4 > 🎯 Reverse Linked List | LeetCode #206</ h4 >
228+ < h4 > Reverse Linked List | LeetCode #206</ h4 >
229229 < p > < strong > Time: O(n), Space: O(1)</ strong > </ p >
230- < p > < a href ="https://leetcode.com/problems/reverse-linked-list/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
230+ < p > < a href ="https://leetcode.com/problems/reverse-linked-list/ " target ="_blank "> Practice on LeetCode</ a > </ p >
231231 </ div >
232232
233233 < div class ="practice-card ">
234- < h4 > 🔠Detect Cycle | LeetCode #141</ h4 >
234+ < h4 > Detect Cycle | LeetCode #141</ h4 >
235235 < p > < strong > Time: O(n), Space: O(1)</ strong > - Use Floyd's algorithm</ p >
236- < p > < a href ="https://leetcode.com/problems/linked-list-cycle/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
236+ < p > < a href ="https://leetcode.com/problems/linked-list-cycle/ " target ="_blank "> Practice on LeetCode</ a > </ p >
237237 </ div >
238238 </ section >
239239
@@ -278,15 +278,15 @@ <h3>Queue Implementation</h3>
278278
279279 < h3 > Common Problems</ h3 >
280280 < div class ="practice-card ">
281- < h4 > 🎯 Valid Parentheses | LeetCode #20</ h4 >
281+ < h4 > Valid Parentheses | LeetCode #20</ h4 >
282282 < p > < strong > Time: O(n), Space: O(n)</ strong > </ p >
283- < p > < a href ="https://leetcode.com/problems/valid-parentheses/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
283+ < p > < a href ="https://leetcode.com/problems/valid-parentheses/ " target ="_blank "> Practice on LeetCode</ a > </ p >
284284 </ div >
285285
286286 < div class ="practice-card ">
287- < h4 > 👚 Implement Queue using Stacks | LeetCode #232</ h4 >
287+ < h4 > Implement Queue using Stacks | LeetCode #232</ h4 >
288288 < p > < strong > Amortized Time: O(1)</ strong > </ p >
289- < p > < a href ="https://leetcode.com/problems/implement-queue-using-stacks/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
289+ < p > < a href ="https://leetcode.com/problems/implement-queue-using-stacks/ " target ="_blank "> Practice on LeetCode</ a > </ p >
290290 </ div >
291291 </ section >
292292
@@ -385,15 +385,15 @@ <h3>Tree Traversals</h3>
385385
386386 < h3 > LeetCode Problems</ h3 >
387387 < div class ="practice-card ">
388- < h4 > 🌳 Validate Binary Search Tree | LeetCode #98</ h4 >
388+ < h4 > Validate Binary Search Tree | LeetCode #98</ h4 >
389389 < p > < strong > Time: O(n), Space: O(h)</ strong > </ p >
390- < p > < a href ="https://leetcode.com/problems/validate-binary-search-tree/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
390+ < p > < a href ="https://leetcode.com/problems/validate-binary-search-tree/ " target ="_blank "> Practice on LeetCode</ a > </ p >
391391 </ div >
392392
393393 < div class ="practice-card ">
394- < h4 > 📊 Lowest Common Ancestor | LeetCode #236</ h4 >
394+ < h4 > Lowest Common Ancestor | LeetCode #236</ h4 >
395395 < p > < strong > Time: O(n), Space: O(h)</ strong > </ p >
396- < p > < a href ="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
396+ < p > < a href ="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ " target ="_blank "> Practice on LeetCode</ a > </ p >
397397 </ div >
398398 </ section >
399399
@@ -445,9 +445,9 @@ <h3>Graph Traversal: DFS & BFS</h3>
445445 </ div >
446446
447447 < div class ="practice-card ">
448- < h4 > 🔗 Number of Islands | LeetCode #200</ h4 >
449- < p > < strong > Time: O(m×n ), Space: O(m×n )</ strong > </ p >
450- < p > < a href ="https://leetcode.com/problems/number-of-islands/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
448+ < h4 > Number of Islands | LeetCode #200</ h4 >
449+ < p > < strong > Time: O(mn ), Space: O(mn )</ strong > </ p >
450+ < p > < a href ="https://leetcode.com/problems/number-of-islands/ " target ="_blank "> Practice on LeetCode</ a > </ p >
451451 </ div >
452452 </ section >
453453
@@ -469,16 +469,16 @@ <h2>Sorting Algorithms</h2>
469469 < tr >
470470 < td > Bubble Sort</ td >
471471 < td > O(n)</ td >
472- < td > O(n² )</ td >
473- < td > O(n² )</ td >
472+ < td > O(n² )</ td >
473+ < td > O(n² )</ td >
474474 < td > O(1)</ td >
475475 < td > Yes</ td >
476476 </ tr >
477477 < tr >
478478 < td > Quick Sort</ td >
479479 < td > O(n log n)</ td >
480480 < td > O(n log n)</ td >
481- < td > O(n² )</ td >
481+ < td > O(n² )</ td >
482482 < td > O(log n)</ td >
483483 < td > No</ td >
484484 </ tr >
@@ -502,9 +502,9 @@ <h2>Sorting Algorithms</h2>
502502 </ table >
503503
504504 < div class ="practice-card ">
505- < h4 > 🔀 Sort an Array | LeetCode #912</ h4 >
505+ < h4 > Sort an Array | LeetCode #912</ h4 >
506506 < p > < strong > Challenge:</ strong > Implement multiple sorting algorithms</ p >
507- < p > < a href ="https://leetcode.com/problems/sort-an-array/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
507+ < p > < a href ="https://leetcode.com/problems/sort-an-array/ " target ="_blank "> Practice on LeetCode</ a > </ p >
508508 </ div >
509509 </ section >
510510
@@ -549,15 +549,15 @@ <h3>Bottom-Up (Tabulation)</h3>
549549 </ div >
550550
551551 < div class ="practice-card ">
552- < h4 > 💰 Coin Change | LeetCode #322</ h4 >
553- < p > < strong > Time: O(n×m ), Space: O(n)</ strong > where n=amount, m=coins</ p >
554- < p > < a href ="https://leetcode.com/problems/coin-change/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
552+ < h4 > ° Coin Change | LeetCode #322</ h4 >
553+ < p > < strong > Time: O(nm ), Space: O(n)</ strong > where n=amount, m=coins</ p >
554+ < p > < a href ="https://leetcode.com/problems/coin-change/ " target ="_blank "> Practice on LeetCode</ a > </ p >
555555 </ div >
556556
557557 < div class ="practice-card ">
558- < h4 > ðŸ˜ï¸ House Robber | LeetCode #198</ h4 >
558+ < h4 > House Robber | LeetCode #198</ h4 >
559559 < p > < strong > Time: O(n), Space: O(n)</ strong > </ p >
560- < p > < a href ="https://leetcode.com/problems/house-robber/ " target ="_blank "> 👉 Practice on LeetCode</ a > </ p >
560+ < p > < a href ="https://leetcode.com/problems/house-robber/ " target ="_blank "> Practice on LeetCode</ a > </ p >
561561 </ div >
562562 </ section >
563563
@@ -611,6 +611,18 @@ <h5>Resources</h5>
611611 </ footer >
612612
613613 < script >
614+ // TOC toggle (mobile)
615+ const tocToggle = document . getElementById ( 'tocToggle' ) ;
616+ const tocEl = tocToggle ? tocToggle . closest ( '.toc' ) : null ;
617+ if ( tocToggle && tocEl ) {
618+ tocToggle . addEventListener ( 'click' , function ( ) {
619+ tocEl . classList . toggle ( 'open' ) ;
620+ tocToggle . setAttribute ( 'aria-expanded' , tocEl . classList . contains ( 'open' ) ) ;
621+ const icon = tocToggle . querySelector ( '.toc-toggle-icon' ) ;
622+ if ( icon ) icon . textContent = tocEl . classList . contains ( 'open' ) ? '\u25B2' : '\u25BC' ;
623+ } ) ;
624+ }
625+
614626 // Hamburger toggle logic
615627 const hamburger = document . getElementById ( 'hamburger' ) ;
616628 const navLinks = document . querySelector ( '.nav-links' ) ;
0 commit comments