Absolute Beginner's Guide to Algorithms: A Practical Introduction to Data Structures and Algorithms in JavaScript

Book description

A hands-on, easy-to-comprehend guide that is perfect for anyone who needs to understand algorithms.

With the explosive growth in the amount of data and the diversity of computing applications, efficient algorithms are needed now more than ever. Programming languages come and go, but the core of programming--algorithms and data structures--remains the same.

Absolute Beginner's Guide to Algorithms is the fastest way to learn algorithms and data structures. Using helpful diagrams and fully annotated code samples in Javascript, you will start with the basics and gradually go deeper and broader into all the techniques you need to organize your data.

  • Start fast with data structures basics: arrays, stacks, queues, trees, heaps, and more

  • Walk through popular search, sort, and graph algorithms

  • Understand Big-O notation and why some algorithms are fast and why others are slow

  • Balance theory with practice by playing with the fully functional JavaScript implementations of all covered data structures and algorithms

Table of contents

  1. Cover Page
  2. About This eBook
  3. Title Page
  4. Copyright Page
  5. Pearson’s Commitment to Diversity, Equity, and Inclusion
  6. Figure Credits
  7. Contents at a Glance
  8. Table of Contents
  9. Acknowledgments
  10. Dedication
  11. About the Author
  12. Tech Editors
  13. Part I: Data Structures
    1. 1. Introduction to Data Structures
      1. Right Tool for the Right Job
      2. Back to Data Structures
      3. Conclusion
      4. Some Additional Resources
    2. 2. Big-O Notation and Complexity Analysis
      1. It’s Example Time
      2. It’s Big-O Notation Time!
      3. Conclusion
      4. Some Additional Resources
    3. 3. Arrays
      1. What Is an Array?
      2. Array Implementation / Use Cases
      3. Arrays and Memory
      4. Performance Considerations
      5. Conclusion
      6. Some Additional Resources
    4. 4. Linked Lists
      1. Meet the Linked List
      2. Linked List: Time and Space Complexity
      3. Linked List Variations
      4. Implementation
      5. Conclusion
      6. Some Additional Resources
    5. 5. Stacks
      1. Meet the Stack
      2. A JavaScript Implementation
      3. Stacks: Time and Space Complexity
      4. Conclusion
      5. Some Additional Resources
    6. 6. Queues
      1. Meet the Queue
      2. A JavaScript Implementation
      3. Queues: Time and Space Complexity
      4. Conclusion
      5. Some Additional Resources
    7. 7. Trees
      1. Trees 101
      2. Height and Depth
      3. Conclusion
      4. Some Additional Resources
    8. 8. Binary Trees
      1. Meet the Binary Tree
      2. A Simple Binary Tree Implementation
      3. Conclusion
      4. Some Additional Resources
    9. 9. Binary Search Trees
      1. It’s Just a Data Structure
      2. Implementing a Binary Search Tree
      3. Performance and Memory Characteristics
      4. Conclusion
      5. Some Additional Resources
    10. 10. Heaps
      1. Meet the Heap
      2. Heap Implementation
      3. Performance Characteristics
      4. Conclusion
      5. Some Additional Resources
    11. 11. Hashtable (aka Hashmap or Dictionary)
      1. A Very Efficient Robot
      2. From Robots to Hashing Functions
      3. From Hashing Functions to Hashtables
      4. JavaScript Implementation/Usage
      5. Dealing with Collisions
      6. Performance and Memory
      7. Conclusion
      8. Some Additional Resources
    12. 12. Trie (aka Prefix Tree)
      1. What Is a Trie?
      2. Diving Deeper into Tries
      3. Many More Examples Abound!
      4. Implementation Time
      5. Performance
      6. Conclusion
      7. Some Additional Resources
    13. 13. Graphs
      1. What Is a Graph?
      2. Graph Implementation
      3. Conclusion
      4. Some Additional Resources
  14. Part II: Algorithms
    1. 14. Introduction to Recursion
      1. Our Giant Cookie Problem
      2. Recursion in Programming
      3. Conclusion
      4. Some Additional Resources
    2. 15. Fibonacci and Going Beyond Recursion
      1. Recursively Solving the Fibonacci Sequence
      2. Recursion with Memoization
      3. Taking an Iteration-Based Approach
      4. Going Deeper on the Speed
      5. Conclusion
      6. Some Additional Resources
    3. 16. Towers of Hanoi
      1. How Towers of Hanoi Is Played
      2. The Single Disk Case
      3. It’s Two Disk Time
      4. Three Disks
      5. The Algorithm
      6. The Code Solution
      7. Check Out the Recursiveness!
      8. It’s Math Time
      9. Conclusion
      10. Some Additional Resources
    4. 17. Search Algorithms and Linear Search
      1. Linear Search
      2. Conclusion
      3. Some Additional Resources
    5. 18. Faster Searching with Binary Search
      1. Binary Search in Action
      2. The JavaScript Implementation
      3. Runtime Performance
      4. Conclusion
      5. Some Additional Resources
    6. 19. Binary Tree Traversal
      1. Breadth-First Traversal
      2. Depth-First Traversal
      3. Implementing Our Traversal Approaches
      4. Performance of Our Traversal Approaches
      5. Conclusion
      6. Some Additional Resources
    7. 20. Depth-First Search (DFS) and Breadth-First Search (BFS)
      1. A Tale of Two Exploration Approaches
      2. It’s Example Time
      3. When to Use DFS? When to Use BFS?
      4. A JavaScript Implementation
      5. Performance Details
      6. Conclusion
      7. Some Additional Resources
    8. 21. Quicksort
      1. A Look at How Quicksort Works
      2. Another Simple Look
      3. It’s Implementation Time
      4. Performance Characteristics
      5. Conclusion
      6. Some Additional Resources
    9. 22. Bubblesort
      1. How Bubblesort Works
      2. Walkthrough
      3. The Code
      4. Conclusion
      5. Some Additional Resources
    10. 23. Insertion Sort
      1. How Insertion Sort Works
      2. One More Example
      3. Algorithm Overview and Implementation
      4. Performance Analysis
      5. Conclusion
      6. Some Additional Resources
    11. 24. Selection Sort
      1. Selection Sort Walkthrough
      2. Algorithm Deep Dive
      3. The JavaScript Implementation
      4. Conclusion
      5. Some Additional Resources
    12. 25. Mergesort
      1. How Mergesort Works
      2. Mergesort: The Algorithm Details
      3. Looking at the Code
      4. Conclusion
      5. Some Additional Resources
    13. 26. Conclusion
      1. How this Book Came About
      2. One more thing!
  15. Index
  16. Code Snippets

Product information

  • Title: Absolute Beginner's Guide to Algorithms: A Practical Introduction to Data Structures and Algorithms in JavaScript
  • Author(s): Kirupa Chinnathambi
  • Release date: December 2023
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780138222598