0
100% Satisfaction Guarantee
Amazing Value
Fast Shipping
Expert Customer Service
JavaScript算法:基本原理与代码实现
$48.35
1.由JavaScript魔术师司徒正美和快手前端开发人员李晓晨合作撰写,具备全面的理论知识和丰富的实践经验,前端大神司徒正美撰写的后一本作品。2.采用JavaScript作为演示代码,比较系统地涉及各种数据结构和常见的算法面试题,内容丰富可靠。3.书中没有数学公式和复杂度证明,而是详细列出解题步骤,给出可以套用的算法模板,非科班出身的读者也能轻松上手。4.涵盖了常见排序算法、树的相关算法、字符串算法、回溯算法、动态规划问题等多个领域,是一本实用的算法入门指南。5.以简单易懂的语言讲解算法原理,同时配有代码实现,让读者能够深入理解和掌握各种算法,并成功通过前端面试。6.快手研发总监方超、《深入浅出Vue.js》作者刘博文(玖五)、《TypeScript入门实战笔记》作者乾元、独立开发者&讲师花果山大圣联袂推荐
本书以JavaScript作为演示代码,比较系统地涉及各种数据结构和常见的算法面试题:常见排序算法(如冒泡排序、选择排序、插入排序、希尔排序、归并排序、堆排序、快速排序、计数排序、桶排序、基数排序等)、树的相关算法、字符串算法、回溯算法、动态规划问题等。本书中没有可怕的数学公式与复杂度证明,而是详细列出解题步骤,给出可以套用的算法模板。为了方便记忆,每种算法都会给出多种解,读者只需从中选取适合自己的解即可。本书旨在要让非科班出身的、没有算法基础的前端人士能够对各种数据结构及相关算法快速上手、顺利通过面试。
司徒正美(真名钟钦成) 著名的JavaScript专家,曾在去哪儿网担任前端架构师,立志做考古学家的日语系工程师,穿梭于二次元与二进制间的“魔法师”,做过陶艺,写过小说,涉猎Java、Ruby、JavaScript,常年活跃在开源社区,曾出版《JavaScript框架设计》一书。 李晓晨 资深前端工程师,曾在美团、快手任职,对算法、基础框架、互动技术、DX有一定研究,近对Web 3产生了浓厚的兴趣。
前言 6第 1 章 时间复杂度与空间复杂度 101.1 时间复杂度 101.2 空间复杂度 151.3 总结 171. 时间复杂度 172. 空间复杂度 18第 2 章 排序算法 192.1 冒泡排序 202.2 选择排序 272.3 插入排序 292.4 希尔排序 332.5 归并排序 392.6 堆排序 472.7 快速排序 472.7.1 快速排序的常用方法 472.7.2 快速排序的优化 522.7.3 非递归实现 542.7.4 算法比较 552.7.5 快速排序的一些应用 552.8 计数排序 562.9 桶排序 582.10 基数排序 612.10.1 LSD 基数排序 612.10.2 MSD 基数排序 642.10.3 字符串使用基数排序实现字典排序 662.11 总结 682.11.1 算法使用场景 69第 3 章 线性结构 713.1 数据结构的分类 713.2 数组 733.3 链表 753.3.1 单向链表 753.3.2 双向链表 783.3.3 有序链表 803.3.4 循环双向链表 833.3.5 链表排序 883.4 栈 963.4.1 栈的特点和相关概念 963.4.2 栈相关的方法 983.4.3 栈的应用场景 993.5 队列 1063.5.1 队列的常用方法 1073.5.2 队列的典型应用 1083.6 散列简述 1093.6.1 散列函数 1093.6.2 散列冲突的解决方案 1123.6.3 散列的应用 1213.7 位图 1243.7.1 位图简述 1243.7.2 位图的应用 1273.8 块状链表 1293.8.1 块状链表简介 1293.8.2 块状链表的操作 1303.9 总结 136第 4 章 散列详谈 1394.1 散列的定义 1394.2 常见的散列算法 1394.3 散列冲突的解决方案 1414.3.1 开散列方法 1424.3.2 闭散列方法 1444.4 散列的应用 1464.4.1 数组去重 1464.4.2 求只出现一次的数字 1474.4.3 两数之和 1474.5 小结 148第 5 章 树与二叉树 1495.1 树的简介 1495.1.1 树的常用术语 1495.1.2 树的表示方式 1515.2 二叉树 1525.2.2 树的查找操作 1575.2.3 树的删除操作 1585.2.4 获得树的结点数 1605.2.5 获得树的高度 1615.2.6 树的深度优先遍历 1615.2.7 深度优先遍历的递归实现 1635.2.8 深度优先遍历的非递归实现 1675.2.9 深度优先遍历的非递归实现的优化 1735.2.10 树的广度优先遍历 1765.2.11 树的打印 1775.3 二叉查找树 1865.3.1 BST 的插入与查找操作 1875.3.2 前驱结点与后继结点 1885.3.3 BST 的移除操作 1905.4 总结 192第 6 章堆与优先队列 1946.1 二叉堆 1946.2 堆排序 1966.3 topK 问题 2036.4 优先队列 2056.5 丑数 2086.6 小结 210第 7 章 并查集 2107.1 没有优化的并查集 2107.2 快速合并,慢查找 2147.3 基于重量的快速合并,快速查找 2187.4 基于深度的快速合并,快速查找 2207.5 基于深度与路径压缩的快速合并,快速查找 2237.6 相关问题 2267.6.1 朋友圈 2267.6.2 岛屿的数量 2287.6.3 账户合并 2297.6.4 团伙问题 2327.6.5 食物链 2337.7 总结 235第 8 章 线段树 2378.1 普通线段树 2378.1.1 构建 2378.1.2 单点查询 2408.1.3 单点修改 2408.1.4 区间查询 2428.1.5 区间修改 2438.1.6 延迟标记 2448.2 ZKW 线段树 2478.2.1 构建 2478.2.2 单点查询 2488.2.3 单点修改 2498.2.4 区间查询 2498.3 标记永久化技巧 2518.3.1 基于标记永久化的区间修改 2518.3.2 基于标记永久化的区间查询 2528.4 差分思想 2538.4.1 基于差分思想的区间修改 2548.4.2 基于差分思想的区间查询 2558.5 总结 255第 9 章 树状数组 2569.1 原理 2569.2 构建 2629.3 单点查询 2639.4 单点修改 2649.5 求前 n 项之和 2659.6 求 a~b 项之和 2669.7 区间更新 2669.8 区间值 2669.9 求逆序数 2699.10 数组离散化 2699.11 总结 273第 10 章 前缀树 27410.1 原理 27410.2 插入字符串 27510.3 移除字符串 27710.4 是否包含某个字符串 27710.5 是否包含某个前缀 27810.6 统计某个字符串出现的次数 27810.7 统计某个前缀出现的次数 27910.8 优化 27910.9 排序 28010.10 求长公共前缀 28210.11 模糊搜索 28310.12 总结 284第 11 章 跳表 28611.1 跳表的结构 28611.2 跳表的性质 28611.3 插入 28711.4 查找 28911.5 删除 29011.6 得到排序数组 29111.7 总结 291第 12 章 简单平衡树 29312.1 有旋 Treap 29312.1.1 旋转 29412.1.2 插入 29712.1.3 查找 29912.1.4 删除 29912.1.5 各种遍历 30112.1.6 获取 value 的排名 30212.1.7 根据排名找对应的数 30212.2 无旋 Treap 30412.2.1 合并 30512.2.2 拆分 30912.2.3 添加 31312.2.4 移除 31412.2.5 查找 31412.2.6 获取 value 的排名 31412.2.7 根据排名找对应的数 31512.2.8 求前驱后继 31512.2.9 求小值 31612.3 伸展树 31712.3.2 查找 32312.3.3 插入 32312.3.4 删除 32512.3.5 区间删除 32612.3.6 获取 value 的排名 32712.3.7 根据排名找对应的数 32712.3.8 求小值 32712.3.9 求前驱后继 32812.3.10 合并 32812.3.11 拆分 32812.4 SBT 33012.4.1 插入 33212.4.2 删除 33412.4.3 平衡 33512.5 替罪羊树 34112.5.1 插入 34312.5.2 重构 34512.5.3 查找 34812.5.4 删除 348第 13 章 字符串算法 35013.1 匹配算法 35013.1.1 Brute‐Force 算法 35013.1.2 KMP 算法 35013.1.3 多模式匹配算法 36113.2 回文算法 36713.2.1 中央扩展法 36813.2.2 马拉车算法 36913.2.3 回文自动机 37513.2.4 后缀自动机 38213.3 总结 397第 14 章 回溯算法 39814.1 回溯算法的格式 39814.2 子集问题的相关例题 40014.2.1 没重复元素的子集问题 40014.2.2 有重复元素的子集问题 40114.2.3 有重复元素的组合总和 40214.2.4 无重复元素的组合总和 40314.2.5 背包问题 40414.2.6 装载问题 40514.2.7 火柴拼棍摆正方形 40614.3 排列问题的相关例题 40814.3.1 全排列问题 40814.3.2 素数环 40914.3.3 批作业调度问题 41114.3.4 八皇后问题 41314.4 总结 415第 15 章 动态规划 41615.1 斐波那契数列 41615.1.1 暴力法 41715.1.2 记忆化搜索 41715.1.3 动态规划法 41815.2 找零钱 41915.3 长不下降子序列 42115.4 长公共子序列 42315.5 爬楼梯 42615.6 背包问题 42715.7 总结 428
本书是一本非常友好的算法书,适合前端工程师学习。书中讲解了许多常见的数据结构和算法,并使用 JavaScript 作为演示语言,讲解浅显易懂,对于算法的应用场景也解释得非常清楚。——方超,快手研发总监当下越来越多的企业会用算法题来面试前端工程师,本书是前端大神司徒正美撰写的面向前端工程师面试的算法书,也是他的后一本书,如果你有需求,可以读一读。 ——刘博文(玖五),《深入浅出Vue.js》作者,阿里巴巴大淘宝前端技术专家记得在2017年左右,司徒正美便开始勤于背单词和做
Shipping Overview:
• Shipping: Standard Domestic Shipping within the United States charges USD 4.99. Standard International Shipping from United Kingdom, Germany and Japan to the United States charges 14.99.
• Order Processing: Please allow 1-2 business days for order processing and preparation before shipment.
• Domestic Shipping: Orders within the U.S. are shipped via USPS or FedEx, depending on the origin of the product. The average transit time is 3-7 business days.
• International Shipping: Currently, we only ship within the USA.
• Tracking Information: Every order is trackable. You will receive a tracking number once your order has been shipped. Products may be shipped from various global fulfillment centers.
Shipping Delays:
Please note that shipping times may vary due to factors beyond our control, such as weather conditions, natural disasters, or peak holiday periods. While we strive to ensure timely delivery, the exact arrival time cannot be guaranteed and is managed by the shipping carrier.
Shipping Options:
Standard Delivery: Most orders are shipped within 3-7 business days. Larger items may utilize LTL shipping for safe handling.
Handling Time: We handle shipments on business days (Monday - Friday), with a preparation time of 1-2 days.
Additional Charges: Some items require additional shipping charges due to their size, weight, or special handling. These charges are specified on the product pages and are not eligible for shipping discounts.
Exclusions: Gift cards, packaging, taxes, and prior purchases do not count toward the minimum purchase requirement for free shipping. This offer is valid only for shipments to U.S. addresses, including Puerto Rico.
Delivery Details:
Estimates: Standard shipping within the US typically takes 3-7 business days. These are estimates and not guarantees.
Shipping Restrictions: We ship to all 50 states, Washington, DC, U.S. territories, and APO/FPO/DPO addresses. Shipping options vary based on the delivery address.
Remote Areas: Shipments to remote areas may incur additional charges or require pickup from a nearby shipping partner’s location.
Shipping Confirmation:
You will receive a shipping confirmation email with a tracking number as soon as your order is dispatched. If you do not receive this email immediately, please be assured that your items will arrive within the estimated delivery window provided at checkout.
Order Modifications:
If you need to cancel or modify your order, please contact our customer support immediately.
Issues with Delivery:
If your order shows as delivered but you have not received it, please contact the shipping carrier directly to resolve the issue. For persistent problems, contact our customer service at cs@everymarket.com.
Customer Support:
Our team is available 24/7 to assist you with any questions or concerns regarding your order. We are committed to ensuring a smooth shopping experience.
Return & Refund Policy Overview
Please review our return and refund policies below to ensure a smooth transaction process.
Return Policy
Duration: You have 30 days from receiving your item to initiate a return.
Condition: Items must be unworn, unwashed, with original tags and packaging intact.
Shipping Costs: Customers are responsible for return shipping costs.
Packaging: Ensure returned items are well-packaged to avoid damage during transit.
Tracking: Use a trackable and insured shipping method as we are not liable for items lost or damaged on return.
Initiating a Return: Contact us at cs@everymarket.com to start your return. We will provide a return shipping label and instructions upon approval. Returns without prior approval will not be accepted.
How to Return
Method: Returns must be sent back by mail to the address provided in the return instructions.
Return Label
Defective Products: Return labels are provided for defective items.
Non-Defective Returns: Customers are responsible for obtaining their return shipping label.
Product Conditions for Return
Eligible Products: Returns are only accepted for items in new condition.
Nonreturnable Items
Certain items are not eligible for return:
Electronic devices after 30 days (e.g., computers, laptops, Kindles)
Gift cards, prepaid game cards
Perishable goods, live insects, some jewelry, some health and personal care items
Customized or personalized products
Items with special shipping restrictions
Refund Policy
Window: Eligible products may be returned within 30 days of delivery for a refund.
Refund Method: Refunds are processed to the original payment method or as store credit for items purchased with gift cards.
Processing Time: Refunds are processed within 3-5 business days after we receive the return; please allow additional time for shipping and bank processing.
Claims
Inspect your order upon arrival and report any defects, damages, or incorrect items immediately to allow us to address the issue. For claims, contact our support team with details of the issue.
Exchange Policy
For the quickest service, return your original item and place a new order for the desired product once your return is accepted.
Return Address
EveryMarket Customer Service 2101 E Terra Ln, O'Fallon, MO 63366
Customer Support
Available 24/7 for any questions or assistance needed:
Phone: +1 636-312-5925
Email: cs@everymarket.com
Oops!
Sorry, it looks like some products are not available in selected quantity.
OK