• Home
  • About
    • Thoughts To Pen photo

      Thoughts To Pen

      My thoughts on Computer Programming || Psychology || Personal Finances || & much more...

    • Learn More
    • Twitter
    • Instagram
    • Github
    • StackOverflow
  • Posts
    • All Posts
    • All Tags
  • Projects
  • Portfolio
  • Resources
  • About

All Posts

  • Tries (Prefix Trees)

    Discover the Trie, a specialised tree for string operations. Learn how Auto-Complete works and how to search a dictionary of words in O(L) time.

    Tags: programming, algorithms, strings, trees, trie
    Read More
  • A* Search Algorithm

    The crown jewel of pathfinding. Learn how A* combines Dijkstra's guaranteed accuracy with a Greedy Best-First Search heuristic to find the shortest path lightning-fast.

    Tags: programming, algorithms, graphs, heuristic, pathfinding
    Read More
  • Bit Manipulation

    Zoom down to the 1s and 0s. Master Bitwise AND, OR, XOR, and Shifts to solve problems with brutal efficiency and zero memory overhead.

    Tags: programming, algorithms, bit-manipulation
    Read More
  • Recursion Patterns — Base Cases & Unwinding

    Demystify Recursion. Learn how functions call themselves, how the Call Stack unwinds, and the difference between Head Recursion and Tail Recursion.

    Tags: programming, algorithms, recursion
    Read More
  • Backtracking

    Learn how to solve Sudoku, N-Queens, and combination puzzles using Backtracking. We cover the core template that solves almost all combinatorial search problems.

    Tags: programming, algorithms, backtracking
    Read More
  • Greedy Algorithms

    Why look at the big picture when you can just make the best immediate choice? Learn when Greedy Algorithms work, and more importantly, when they fail.

    Tags: programming, algorithms, greedy
    Read More
  • Dynamic Programming — Tabulation

    Master Bottom-Up Dynamic Programming. Learn how to replace recursive Memoization with iterative Tabulation to eliminate StackOverflows and optimise memory.

    Tags: programming, algorithms, dynamic-programming, tabulation
    Read More
  • Dynamic Programming — Memoization

    Unlock the power of Top-Down Dynamic Programming. Learn how Memoization turns slow $O(2^n)$ recursive algorithms into lightning-fast $O(n)$ solutions.

    Tags: programming, algorithms, dynamic-programming, memoization
    Read More
  • Dijkstra's Shortest Path

    Master Dijkstra's algorithm to find the absolute shortest path on weighted graphs. Learn how it combines BFS and a Priority Queue to work its magic.

    Tags: programming, algorithms, graphs, shortest-path
    Read More
  • Depth-First Search (DFS) & Applications

    Master Depth-First Search for graphs. Learn how to implement DFS recursively and iteratively to detect cycles, find connected components, and solve mazes.

    Tags: programming, algorithms, graphs, dfs
    Read More
  • Graph Representation & BFS

    Enter the world of Graphs. Learn how to represent graphs using Adjacency Lists and Matrices, and master Breadth-First Search (BFS) to find the shortest paths.

    Tags: programming, algorithms, graphs, bfs
    Read More
  • Heaps & Priority Queues

    Master Heaps and Priority Queues. Discover how an array can represent a perfect binary tree, and how to get the maximum or minimum element in O(1) time.

    Tags: programming, algorithms, data-structures, heaps
    Read More
  • Binary Search Trees (BST)

    Learn how Binary Search Trees achieve O(log n) lookups by enforcing strict ordering rules. Includes Java implementation of insert, search, and delete operations.

    Tags: programming, algorithms, trees, bst
    Read More
  • Binary Trees — Traversals & Operations

    Discover the anatomy of Binary Trees. Learn the four main traversal methods (In-order, Pre-order, Post-order, Level-order) with clear diagrams and Java code.

    Tags: programming, algorithms, trees
    Read More
  • Linked Lists — Singly, Doubly & Circular

    Everything you need to know about Linked Lists. Learn how nodes connect via pointers, difference between Singly and Doubly linked lists, and Java implementation.

    Tags: programming, algorithms, data-structures, linked-lists
    Read More
  • Hash Tables & Hashing

    Understand the magic behind O(1) lookups. We explain Hash Tables, Hash Functions, and collision resolution techniques with Java's HashMap.

    Tags: programming, algorithms, data-structures, hashing
    Read More
  • Stacks & Queues — Core Operations

    Learn the core concepts of Stacks (LIFO) and Queues (FIFO). Understand their operations, time complexities, and see them implemented in Java using Deque.

    Tags: programming, algorithms, data-structures, stacks, queues
    Read More
  • Sliding Window Technique

    Master the Sliding Window technique to solve contiguous sub-array and sub-string problems efficiently. Covers fixed-size and dynamic window patterns with Java examples.

    Tags: programming, algorithms, sliding-window
    Read More
  • Two Pointer Technique

    Learn the Two Pointer technique to solve array and string problems efficiently. Covers opposite-direction and same-direction patterns with Java examples.

    Tags: programming, algorithms, two-pointer
    Read More
  • Linear Search & Binary Search

    Master the two fundamental search algorithms. From the brute-force scan of Linear Search to the elegant halving strategy of Binary Search, with Java code and traced examples.

    Tags: programming, algorithms, searching
    Read More
  • Counting Sort, Radix Sort & Bucket Sort

    Break the O(n log n) barrier with linear-time sorting algorithms. Learn how Counting Sort, Radix Sort, and Bucket Sort work with detailed examples and Java code.

    Tags: programming, algorithms, sorting
    Read More
  • Quick Sort — The Versatile Performer

    Discover how Quick Sort partitions arrays around a pivot to achieve O(n log n) average performance in-place. Full Java code, traced example, and pivot strategy discussion.

    Tags: programming, algorithms, sorting, divide-and-conquer
    Read More
  • Merge Sort — Divide and Conquer

    Master Merge Sort with a visual divide-and-conquer walkthrough, complete Java implementation, and a deep dive into why it guarantees O(n log n) performance.

    Tags: programming, algorithms, sorting, divide-and-conquer
    Read More
  • Selection Sort & Insertion Sort

    Understand Selection Sort and Insertion Sort with intuitive analogies, traced examples, Java code, and a side-by-side comparison of when to use each.

    Tags: programming, algorithms, sorting
    Read More
  • Bubble Sort — The Simplest Sort

    Learn how Bubble Sort works with a detailed step-by-step walkthrough, Java implementation, and Big-O analysis. The easiest sorting algorithm to understand for beginners.

    Tags: programming, algorithms, sorting
    Read More
  • Introduction to Algorithms & Big-O Notation

    Learn what algorithms are, why they matter, and how Big-O notation helps us measure their efficiency. Includes easy-to-follow examples, Java code, and a complexity cheat sheet.

    Tags: programming, algorithms, big-o
    Read More
  • Algorithms & Data Structures — Complete Guide

    A complete, beginner-friendly guide to algorithms and data structures. Learn sorting, searching, trees, graphs, dynamic programming, and more — with Java examples.

    Tags: programming, algorithms
    Read More
  • The New Date/Time API (Java 8)

    Master the thread-safe and intuitive java.time API introduced in Java 8. Learn how to handle dates, times, and time zones correctly.

    Tags: programming, java, java8
    Read More
  • The Optional API (Java 8)

    Stop chasing NullPointerExceptions. Learn how to use Java 8's Optional class to build safer, more resilient applications.

    Tags: programming, java, java8
    Read More
  • The Streams API (Java 8)

    Learn how to process data declaratively with the Java 8 Streams API. Master filter, map, and collect to write cleaner loops.

    Tags: programming, java, java8
    Read More
  • Functional Interfaces & Default Methods (Java 8)

    Deep dive into Java 8's interface enhancements. Learn about Default Methods, Functional Interfaces, and the foundational built-in functions like Predicate, Consumer, Supplier, and Function.

    Tags: programming, java, java8
    Read More
  • Lambda Expressions (Java 8)

    Master Lambda Expressions in Java 8. Learn how to write concise, functional code and eliminate anonymous inner class boilerplate.

    Tags: programming, java, java8
    Read More
  • Java 8 Features

    Revisit the revolutionary changes introduced in Java 8, the release that brought functional programming to Java with Lambdas, Streams, and the Optional API.

    Tags: programming, java, java8
    Read More
  • Predicate::not and More Enhancements (Java 11)

    Explore the smaller but impactful features of Java 11, including Predicate.not(), simpler Collection to Array conversion, and single-file execution.

    Tags: programming, java, java11
    Read More
  • Local-Variable Syntax for Lambda Parameters (Java 11)

    Understand how to use the 'var' keyword in lambda expressions in Java 11 and why it's useful for annotations.

    Tags: programming, java, java11
    Read More
  • String & Files API Enhancements (Java 11)

    Discover the new utility methods in String and Files classes introduced in Java 11. Write cleaner code for common text and I/O tasks.

    Tags: programming, java, java11
    Read More
  • Standard HTTP Client API (Java 11)

    Master the modern HTTP Client in Java 11. Learn how to perform synchronous and asynchronous requests with support for HTTP/2.

    Tags: programming, java, java11
    Read More
  • Java 11 Features

    Explore the landmark features introduced in Java 11 LTS, including the new HTTP Client, Local-Variable Syntax for Lambda Parameters, and key String and File API enhancements.

    Tags: programming, java, java11
    Read More
  • Enhanced Pseudo-Random Number Generators (Java 17)

    Explore Java 17's new random number generator interfaces and algorithms for better performance and flexibility.

    Tags: programming, java, java17
    Read More
  • Records (Java 17)

    Eliminate boilerplate with Records in Java 17 - the perfect solution for immutable data carrier classes.

    Tags: programming, java, java17
    Read More
  • Text Blocks (Java 17)

    Write cleaner multi-line strings in Java 17 with Text Blocks, perfect for JSON, SQL, HTML, and more.

    Tags: programming, java, java17
    Read More
  • Pattern Matching for instanceof (Java 17)

    Simplify type checking and casting in Java 17 with Pattern Matching for instanceof, eliminating boilerplate code.

    Tags: programming, java, java17
    Read More
  • Sealed Classes (Java 17)

    Master Sealed Classes in Java 17 to control inheritance hierarchies and build more maintainable, secure domain models.

    Tags: programming, java, java17
    Read More
  • Java 17 Features

    Explore the powerful features introduced in Java 17 LTS, including Sealed Classes, Pattern Matching, Text Blocks, Records, and enhanced random number generators.

    Tags: programming, java, java17
    Read More
  • Primitive Types in Patterns (Java 25)

    Java 25 extends pattern matching to primitive types like int and long, unifying the type system.

    Tags: programming, java, java25
    Read More
  • Module Import Declarations (Java 25)

    Say goodbye to import clutter with Module Import Declarations in Java 25.

    Tags: programming, java, java25
    Read More
  • Flexible Constructor Bodies (Java 25)

    Flexible Constructor Bodies in Java 25 allow statements before super(), giving you more control over object initialization.

    Tags: programming, java, java25
    Read More
  • Compact Source Files (Java 25)

    Java 25 introduces Compact Source Files to reduce boilerplate and make the language more beginner-friendly.

    Tags: programming, java, java25
    Read More
  • Java 25 Features

    A comprehensive overview of the new features in Java 25, including Compact Source Files, Flexible Constructors, and Primitive Patterns.

    Tags: programming, java, java25
    Read More
  • Unnamed Patterns & Variables (Java 21)

    Discover how Unnamed Patterns (_) in Java 21 help you write cleaner code by ignoring unused variables.

    Tags: programming, java, java21
    Read More
  • Structured Concurrency (Java 21)

    Explore Structured Concurrency in Java 21 for more robust, readable, and maintainable concurrent code.

    Tags: programming, java, java21
    Read More
  • Unnamed Classes & Instance Main Methods (Java 21)

    Simplify your Java learning layout with Unnamed Classes and Instance Main Methods in Java 21.

    Tags: programming, java, java21
    Read More
  • Pattern Matching for switch (Java 21)

    Pattern Matching for switch in Java 21 revolutionizes control flow with type testing and complex case logic.

    Tags: programming, java, java21
    Read More
  • Record Patterns (Java 21)

    Learn how Record Patterns in Java 21 allow for powerful and concise data navigation and processing.

    Tags: programming, java, java21
    Read More
  • Sequenced Collections (Java 21)

    Sequenced Collections introduced in Java 21

    Tags: programming, java, java21
    Read More
  • Virtual Threads (Java 21)

    Virtual Threads NOTE: This is a preview feature NOT enabled by-default in JDK-21.

    Tags: programming, java, java21
    Read More
  • String Templates (Java 21)

    String Templates introduced in Java 21

    Tags: programming, java, java21
    Read More
  • Java 21 Features

    All new features introduced in Java 21

    Tags: programming, java, java21
    Read More
  • U$A ਕੈਫੇਟੇਰੀਆ

    ਅਧੂਰੀ ਕਹਾਣੀ।

    Tags: literature, punjabi
    Read More
  • ਮੁੜਦੇ ਪਰਿੰਦੇ

    ਇਕ ਕਹਾਣੀ ਕਦੇ ਨਾ ਪੂਰੀ ਹੋਣ ਵਾਲੀ ਉਮੀਦ ਦੀ।

    Tags: literature, punjabi
    Read More
  • Welcome to Thoughts To Pen!

    Tags:
    Read More