JavaScript DOM Manipulation & DSA with Count Inversion Pair Problem

Day 19 :-JavaScript + DSA (Java) After a short health break, I’m back again with full focus and energy to continue my daily learning journey. Consistency is the key, and today the journey continues stronger than before. 💪 📌 Today’s Learning JavaScript – DOM Manipulation 🔹 Creating Nodes ->createElement() – Create a new HTML element ->createTextNode() – Create a text node ->createAttribute() – Create an attribute node 🔹Accessing Attributes ->getAttribute() – Get the value of an attribute ->setAttribute() – Set or update an attribute ->removeAttribute() – Remove an attribute 🔹Adding Nodes to the DOM ->appendChild(node) – Adds a node as the last child ->append(node1, node2, …) – Adds multiple nodes ->insertBefore(newNode, referenceNode) – Insert before a specific node ->prepend() – Adds a node at the beginning ->replaceChild() – Replace an existing child node 🔹Other DOM Methods ->innerHTML – Directly set or update HTML content ->insertAdjacentHTML() / insertAdjacentElement() with positions: ->beforebegin ->afterbegin ->beforeend ->afterend ->removeChild(node) – Remove a child node ->element.remove() – Remove the element directly from the DOM 📌 DSA Learning ->Today I studied the Count Inversion Pair problem. Brute Force Approach: ->Time Complexity → O(n²) Optimized Approach (Using Merge Sort): vTime Complexity → O(n log n) #100DaysOfCode #JavaScript #WebDevelopment #DSA #LearningInPublic #Consistency

To view or add a comment, sign in

Explore content categories