-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex1.html
More file actions
805 lines (736 loc) · 35.6 KB
/
Copy pathindex1.html
File metadata and controls
805 lines (736 loc) · 35.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>DSA Supreme Batch - Course Content</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: white;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
overflow: hidden;
}
.header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px;
text-align: center;
}
.header h1 {
font-size: 2.5em;
margin-bottom: 10px;
}
.header p {
font-size: 1.1em;
opacity: 0.9;
}
.content {
padding: 30px;
}
.section {
margin-bottom: 15px;
border: 1px solid #e0e0e0;
border-radius: 8px;
overflow: hidden;
transition: all 0.3s ease;
}
.section:hover {
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.section-header {
background: linear-gradient(to right, #f8f9fa, #e9ecef);
padding: 18px 20px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
user-select: none;
transition: all 0.3s ease;
}
.section-header:hover {
background: linear-gradient(to right, #e9ecef, #dee2e6);
}
.section-header.active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.section-title {
display: flex;
align-items: center;
gap: 12px;
font-size: 1.1em;
font-weight: 600;
}
.section-number {
background: white;
color: #667eea;
width: 35px;
height: 35px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 0.9em;
}
.section-header.active .section-number {
background: rgba(255,255,255,0.2);
color: white;
}
.arrow {
transition: transform 0.3s ease;
font-size: 1.2em;
}
.arrow.active {
transform: rotate(180deg);
}
.section-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.4s ease;
background: #fafafa;
}
.section-content.active {
/* fallback max height; JS will set explicit heights for animation */
max-height: 2000px;
}
.content-inner {
padding: 20px 25px;
}
.lecture-item {
padding: 12px 15px;
margin: 8px 0;
background: white;
border-left: 4px solid #667eea;
border-radius: 6px;
display: flex;
align-items: center;
gap: 12px;
transition: all 0.3s ease;
}
.lecture-item:hover {
transform: translateX(5px);
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.lecture-badge {
background: #667eea;
color: white;
padding: 4px 10px;
border-radius: 12px;
font-size: 0.85em;
font-weight: 600;
}
.lecture-badge.debug {
background: #f59e0b;
}
.lecture-badge.mega {
background: #10b981;
}
.key-topics {
margin-top: 15px;
padding: 15px;
background: white;
border-radius: 6px;
border-left: 4px solid #10b981;
}
.key-topics h4 {
color: #10b981;
margin-bottom: 10px;
font-size: 1em;
}
.key-topics ul {
list-style: none;
padding-left: 0;
}
.key-topics li {
padding: 5px 0;
padding-left: 20px;
position: relative;
}
.key-topics li:before {
content: "✓";
position: absolute;
left: 0;
color: #10b981;
font-weight: bold;
}
.legend {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
}
.progress-bar {
background: #e9ecef;
height: 8px;
border-radius: 10px;
margin: 20px 0;
overflow: hidden;
}
.progress-fill {
background: linear-gradient(to right, #667eea, #764ba2);
height: 100%;
width: 0%;
transition: width 0.3s ease;
}
/* Table of Contents navigation */
.toc-nav {
background: #ffffff;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 12px 16px;
margin: 0 30px 20px 30px;
display: flex;
flex-wrap: wrap;
gap: 10px 16px;
}
.toc-nav a {
color: #333;
text-decoration: none;
background: #f8f9fa;
border: 1px solid #e0e0e0;
padding: 6px 10px;
border-radius: 14px;
font-size: 0.9em;
}
.toc-nav a:hover {
background: #e9ecef;
}
@media (max-width: 768px) {
.header h1 {
font-size: 1.8em;
}
.content {
padding: 15px;
}
.section-title {
font-size: 1em;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>🎓 DSA Supreme Batch</h1>
<p>Master Data Structures & Algorithms</p>
<div class="progress-bar">
<div class="progress-fill" id="progressBar"></div>
</div>
</div>
<div class="content">
<div class="legend">
<div class="legend-item">
<span class="lecture-badge">L</span>
<span>Lecture</span>
</div>
<div class="legend-item">
<span class="lecture-badge debug">DS</span>
<span>Debug Session</span>
</div>
<div class="legend-item">
<span class="lecture-badge mega">MS</span>
<span>Mega Session</span>
</div>
</div>
<nav class="toc-nav" aria-label="Quick navigation">
<a href="#intro">Introduction</a>
<a href="#basics">Basics of Programming</a>
<a href="#patterns">Pattern Printing</a>
<a href="#arrays">Arrays</a>
<a href="#sns">Searching & Sorting</a>
<a href="#strings">Strings</a>
<a href="#pointers">Maths & Pointers</a>
<a href="#recursion">Recursion</a>
<a href="#backtracking">Backtracking</a>
<a href="#stacks">Stacks</a>
<a href="#queues">Queues</a>
<a href="#trees">Trees</a>
<a href="#bst">Binary Search Trees</a>
<a href="#heaps">Heaps</a>
<a href="#tries">Tries</a>
<a href="#dp">Dynamic Programming</a>
<a href="#graphs">Graphs</a>
<a href="#misc">Miscellaneous</a>
</nav>
<!-- Section 1: Introduction -->
<div class="section" id="intro">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">1</span>
<span>Introduction to Data Structures & Algorithms [Supreme Batch]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item">
<span class="lecture-badge">L</span>
<span>Welcome to DSA - RED</span>
</div>
<div class="lecture-item">
<span class="lecture-badge">L</span>
<span><a href="#" rel="noopener noreferrer">Go to RED Dashboard</a></span>
</div>
<div class="lecture-item">
<span class="lecture-badge">L</span>
<span>Orientation Class Rescheduled</span>
</div>
<div class="lecture-item">
<span class="lecture-badge">L</span>
<span><a href="#" rel="noopener noreferrer">More Information here</a></span>
</div>
<div class="lecture-item">
<span class="lecture-badge mega">MS</span>
<span>Orientation Session - 31st March</span>
</div>
</div>
</div>
</div>
<!-- Section 2: Basics of Programming -->
<div class="section" id="basics">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">2</span>
<span>Basics of Programming - Language + Maths [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Basics of Programming</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Basics of Programming</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Basics of Programming</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DC - Basics of Programming</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Basics of Programming</span></div>
</div>
</div>
</div>
<!-- Section 3: Pattern Printing -->
<div class="section" id="patterns">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">3</span>
<span>Pattern Printing [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Pattern Printing</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Pattern Printing</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Pattern Printing</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Pattern Printing</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Pattern Printing</span></div>
</div>
</div>
</div>
<!-- Section 4: Arrays -->
<div class="section" id="arrays">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">4</span>
<span>Arrays [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Basic Maths Problems</span></div>
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Arrays</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Maths + Array Basics</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Maths Basics</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Arrays</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Arrays</span></div>
<div class="lecture-item"><span class="lecture-badge">L4</span><span>L4 - Arrays</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Arrays</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Arrays</span></div>
</div>
</div>
</div>
<!-- Section 5: Searching & Sorting -->
<div class="section" id="sns">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">5</span>
<span>Searching & Sorting [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Binary Search</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Binary Search</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Binary Search</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Searching & Sorting</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - SnS</span></div>
</div>
</div>
</div>
<!-- Section 6: Strings -->
<div class="section" id="strings">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">6</span>
<span>Strings [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Strings</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Strings</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Strings</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Strings</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Strings</span></div>
</div>
</div>
</div>
<!-- Section 7: Needed Maths & Pointers -->
<div class="section" id="pointers">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">7</span>
<span>Needed Maths & Pointers [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Pointers</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Pointers</span></div>
</div>
</div>
</div>
<!-- Section 8: Recursion -->
<div class="section" id="recursion">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">8</span>
<span>Recursion [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Recursion</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Recursion</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Recursion</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Recursion</span></div>
</div>
</div>
</div>
<!-- Section 9: Backtracking -->
<div class="section" id="backtracking">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">9</span>
<span>Backtracking [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - BT and DnC</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - BT and DnC</span></div>
</div>
</div>
</div>
<!-- Section 10: Stacks -->
<div class="section" id="stacks">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">10</span>
<span>Stacks [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Stacks</span></div>
</div>
</div>
</div>
<!-- Section 11: Queues -->
<div class="section" id="queues">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">11</span>
<span>Queues [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Queues</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Queues</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Queues</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Queue</span></div>
</div>
</div>
</div>
<!-- Section 12: Generic/Binary Trees -->
<div class="section" id="trees">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">12</span>
<span>Generic or Binary Trees [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Trees</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Trees</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Trees</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Trees</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Trees</span></div>
</div>
</div>
</div>
<!-- Section 13: Binary Search Trees -->
<div class="section" id="bst">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">13</span>
<span>Binary Search Trees [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - BST</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - BST</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - BST</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - BST</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - BST</span></div>
</div>
</div>
</div>
<!-- Section 14: Dynamic Programming -->
<div class="section" id="dp">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">14</span>
<span>Dynamic Programming [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - DP</span></div>
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - DP</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - DP</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - DP</span></div>
<div class="lecture-item"><span class="lecture-badge">L4</span><span>L4 - DP</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - DP L1</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - DP L2</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - DP</span></div>
<div class="key-topics">
<h4>📚 Key Topics Covered:</h4>
<ul>
<li>Memoization vs Tabulation</li>
<li>Common DP patterns (Knapsack, LIS, Partition)</li>
<li>Optimization techniques & state reduction</li>
<li>Complexity trade-offs and problem decomposition</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Section 15: Graphs -->
<div class="section" id="graphs">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">15</span>
<span>Graphs [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Graphs</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Graphs</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Graphs</span></div>
<div class="lecture-item"><span class="lecture-badge">L8</span><span>L8 - Graphs</span></div>
<div class="lecture-item"><span class="lecture-badge">L9</span><span>L9 - Graphs</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Graphs [Concepts]</span></div>
<div class="lecture-item"><span class="lecture-badge">L11</span><span>L11 - Graphs</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Graphs - 2</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Graph</span></div>
</div>
</div>
</div>
<!-- Section 16: Heaps -->
<div class="section" id="heaps">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">16</span>
<span>Heaps [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L1</span><span>L1 - Heaps</span></div>
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Heaps</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Heaps</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Heap</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Heap</span></div>
</div>
</div>
</div>
<!-- Section 17: Tries & Maps -->
<div class="section" id="tries">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">17</span>
<span>Tries & Maps [Live Lectures]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge">L2</span><span>L2 - Maps n Tries</span></div>
<div class="lecture-item"><span class="lecture-badge">L3</span><span>L3 - Maps n Tries</span></div>
<div class="lecture-item"><span class="lecture-badge debug">DS</span><span>DS - Maps n Tries</span></div>
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>MS - Maps n Tries</span></div>
</div>
</div>
</div>
<!-- Section 18: Miscellaneous -->
<div class="section" id="misc">
<div class="section-header" onclick="toggleSection(this)" aria-expanded="false">
<div class="section-title">
<span class="section-number">18</span>
<span>Miscellaneous [LIVE Sessions]</span>
</div>
<span class="arrow">▼</span>
</div>
<div class="section-content" aria-hidden="true">
<div class="content-inner">
<div class="lecture-item"><span class="lecture-badge mega">MS</span><span>The LAST LIVE Class</span></div>
</div>
</div>
</div>
<!-- End of sections -->
</div>
</div>
<script>
/**
* Toggle a section open/closed with smooth height animation.
* Includes basic validation, localStorage persistence, and ARIA updates.
* @param {HTMLElement} headerEl - The clickable header element of a section.
*/
function toggleSection(headerEl) {
if (!(headerEl instanceof HTMLElement)) return;
var section = headerEl.parentElement;
if (!section) return;
var content = section.querySelector('.section-content');
var arrow = headerEl.querySelector('.arrow');
if (!content || !arrow) return;
var sections = document.querySelectorAll('.section');
var index = Array.prototype.indexOf.call(sections, section);
var isOpen = content.classList.contains('active');
if (isOpen) {
// Close: set current height for transition, then collapse
content.style.maxHeight = content.scrollHeight + 'px';
void content.offsetHeight; // force reflow
content.style.maxHeight = null;
content.classList.remove('active');
headerEl.classList.remove('active');
arrow.classList.remove('active');
headerEl.setAttribute('aria-expanded', 'false');
content.setAttribute('aria-hidden', 'true');
try { localStorage.removeItem('open-section-' + index); } catch (e) { /* storage unavailable */ }
} else {
// Open: expand and persist
content.classList.add('active');
headerEl.classList.add('active');
arrow.classList.add('active');
content.style.maxHeight = content.scrollHeight + 'px';
headerEl.setAttribute('aria-expanded', 'true');
content.setAttribute('aria-hidden', 'false');
try { localStorage.setItem('open-section-' + index, '1'); } catch (e) { /* storage unavailable */ }
}
updateProgress();
}
/**
* Update progress bar to reflect number of open sections.
*/
function updateProgress() {
var total = document.querySelectorAll('.section').length;
var open = document.querySelectorAll('.section-content.active').length;
var pct = total ? Math.round((open / total) * 100) : 0;
var bar = document.getElementById('progressBar');
if (bar) bar.style.width = pct + '%';
}
// Initialize persisted open sections on load
document.addEventListener('DOMContentLoaded', function () {
var sections = document.querySelectorAll('.section');
sections.forEach(function (sec, idx) {
try {
if (localStorage.getItem('open-section-' + idx)) {
var header = sec.querySelector('.section-header');
var content = sec.querySelector('.section-content');
var arrow = header && header.querySelector('.arrow');
if (header && content && arrow) {
content.classList.add('active');
header.classList.add('active');
arrow.classList.add('active');
header.setAttribute('aria-expanded', 'true');
content.setAttribute('aria-hidden', 'false');
requestAnimationFrame(function () {
content.style.maxHeight = content.scrollHeight + 'px';
});
}
}
} catch (e) {
// storage not available, skip persistence
}
});
updateProgress();
// Recompute open heights on resize for accurate heights
window.addEventListener('resize', function () {
document.querySelectorAll('.section-content.active').forEach(function (c) {
c.style.maxHeight = c.scrollHeight + 'px';
});
});
// Smooth scroll for toc nav
document.querySelectorAll('.toc-nav a').forEach(function (a) {
a.addEventListener('click', function (evt) {
evt.preventDefault();
var id = a.getAttribute('href');
var target = id ? document.querySelector(id) : null;
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
});
});
});
</script>
</body>
</html>