Pre-reads

PRE-READS

Sets-1

Set Operations 1. What is a Set? Pseudocode: Initialize a set with elements:     set_name = {elements}  // Duplicates are removed…

December 12, 2024
PRE-READS

Arrays & Strings-2

Manipulating Strings and Arrays Together 1. Converting 2D Arrays to Strings Convert a matrix into a string for display or…

December 12, 2024
PRE-READS

Arrays & Strings-1

1. 2D Arrays (Matrices) 2. Declaring a 2D Array Steps: 1.Initialize an array of arrays. 2.Example: Create a 3×3 matrix:…

December 12, 2024
PRE-READS

Strings-4

String Compression and Decompression 1. String Compression Compress a string by replacing consecutive repeating characters with the character followed by…

December 12, 2024
PRE-READS

Strings-3

Strings-Palindrome Checking What is a Palindrome? A palindrome is a sequence that reads the same forward and backward, disregarding spaces,…

December 12, 2024
PRE-READS

Strings-2

Introduction to String Reversal Reversing a string changes the order of characters to be in reverse. It is a simple…

December 12, 2024
PRE-READS

Strings-1

1. Introduction to String Matching String matching involves finding occurrences of a “pattern” (substring) within a larger “text” string. It’s…

December 12, 2024
PRE-READS

Arrays-3

1. Space and Time Tradeoffs in Arrays Tradeoffs: Optimizing for time or space often involves a balance. Example: Merging two…

December 12, 2024
PRE-READS

Arrays-2

1. Prefix Sum Prefix Sum technique allows efficient computation of subarray sums in constant time after preprocessing. Algorithm: 1. Compute…

December 12, 2024