万本电子书0元读

万本电子书0元读

顶部广告

PHP 7 Data Structures and Algorithms电子书

售       价:¥

7人正在读 | 0人评论 9.8

作       者:Mizanur Rahman

出  版  社:Packt Publishing

出版时间:2017-05-26

字       数:39.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Increase your productivity by implementing data structures About This Book ? Gain a complete understanding of data structures using a simple approach ? Analyze algorithms and learn when you should apply each solution ? Explore the true potential of functional data structures Who This Book Is For This book is for those who want to learn data structures and algorithms with PHP for better control over application-solution, efficiency, and optimization. A basic understanding of PHP data types, control structures, and other basic features is required What You Will Learn ? Gain a better understanding of PHP arrays as a basic data structure and their hidden power ? Grasp how to analyze algorithms and the Big O Notation ? Implement linked lists, double linked lists, stack, queues, and priority queues using PHP ? Work with sorting, searching, and recursive algorithms ? Make use of greedy, dynamic, and pattern matching algorithms ? Implement tree, heaps, and graph algorithms ? Apply PHP functional data structures and built-in data structures and algorithms In Detail PHP has always been the the go-to language for web based application development, but there are materials and resources you can refer to to see how it works. Data structures and algorithms help you to code and execute them effectively, cutting down on processing time significantly. If you want to explore data structures and algorithms in a practical way with real-life projects, then this book is for you. The book begins by introducing you to data structures and algorithms and how to solve a problem from beginning to end using them. Once you are well aware of the basics, it covers the core aspects like arrays, listed lists, stacks and queues. It will take you through several methods of finding efficient algorithms and show you which ones you should implement in each scenario. In addition to this, you will explore the possibilities of functional data structures using PHP and go through advanced algorithms and graphs as well as dynamic programming. By the end, you will be confident enough to tackle both basic and advanced data structures, understand how they work, and know when to use them in your day-to-day work Style and approach An easy-to-follow guide full of examples of implementation of data structures and real world examples to solve the problems faced. Each topic is first explained in general terms and then implemented using step by step explanation so that developers can understand each part of the discussion without any problem.
目录展开

Title Page

PHP 7 Data Structures and Algorithms

PHP 7 Data Structures and Algorithms

Credits

About the Author

About the Reviewer

www.PacktPub.com

Customer Feedback

Dedication

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

Introduction to Data Structures and Algorithms

Importance of data structures and algorithms

Understanding Abstract Data Type (ADT)

Different data structures

Struct

Array

Linked list

Doubly linked list

Stack

Queue

Set

Map

Tree

Graph

Heap

Solving a problem - algorithmic approach

Writing pseudocode

Converting pseudocode to actual code

Algorithm analysis

Calculating the complexity

Understanding the big O (big oh) notation

Standard PHP Library (SPL) and data structures

Summary

Understanding PHP Arrays

Understanding PHP arrays in a better way

Numeric array

Associative array

Multidimensional array

Using an array as flexible storage

Use of multi-dimensional arrays to represent data structures

Creating fixed size arrays with the SplFixedArray method

Performance comparison between a regular PHP array and SplFixedArray

More examples using SplFixedArray

Changing from a PHP array to SplFixedArray

Converting a SplFixedArray to a PHP array

Changing the SplFixedArray size after declaration

Creating a multidimensional array using SplFixedArray

Understanding hash tables

Implementing struct using a PHP array

Implementing sets using a PHP array

Best usage of a PHP array

PHP array, is it a performance killer?

Summary

Using Linked Lists

What is a linked list?

Different types of linked list

Doubly linked lists

Circular linked lists

Multi-linked lists

Inserting, deleting, and searching for an item

Inserting at the first node

Searching for a node

Inserting before a specific node

Inserting after a specific node

Deleting the first node

Deleting the last node

Searching for and deleting a node

Reversing a list

Getting the Nth position element

Understanding complexity for linked lists

Making the linked list iterable

Building circular linked list

Implementing a doubly linked list in PHP

Doubly linked list operations

Inserting at first the node

Inserting at the last node

Inserting before a specific node

Inserting after a specific node

Deleting the first node

Deleting the last node

Searching for and deleting one node

Displaying the list forward

Displaying the list backward

Complexity for doubly linked lists

Using PHP SplDoublyLinkedList

Summary

Constructing Stacks and Queues

Understanding stack

Implementing a stack using PHP array

Understanding complexity of stack operations

Implementing stack using linked list

Using SplStack class from SPL

Real life usage of stack

Nested parentheses matching

Understanding queue

Implementing a queue using PHP array

Implementing a queue using linked list

Using SplQueue class from SPL

Understanding priority queue

Ordered sequence

Unordered sequence

Implementing priority queue using linked list

Implement a priority queue using SplPriorityQueue

Implementing a circular queue

Creating a double - ended queue (deque)

Summary

Applying Recursive Algorithms - Recursion

Understanding recursion

Properties of recursive algorithms

Recursion versus iterative algorithms

Implementing Fibonacci numbers using recursion

Implementing GCD calculation using recursion

Different types of recursions

Linear recursion

Binary recursion

Tail recursion

Mutual recursion

Nested recursion

Building an N-level category tree using recursion

Building a nested comment reply system

Finding files and directories using recursion

Analyzing recursive algorithms

Maximum recursion depth in PHP

Using SPL recursive iterators

Using the PHP built-in function array_walk_recursive

Summary

Understanding and Implementing Trees

Tree definition and properties

Implementing a tree using PHP

Different types of tree structures

Binary tree

Binary search tree

Self-balanced binary search tree

AVL tree

Red-black tree

B-tree

N-ary Tree

Understanding a binary tree

Implementing a binary tree

Creating a binary tree using a PHP array

Understanding the binary search tree

Inserting a new node

Searching a node

Finding the minimum value

Finding the maximum value

Deleting a node

Constructing a binary search tree

Tree traversal

In-order

Pre-order

Post-order

Complexity of different tree data structures

Summary

Using Sorting Algorithms

Understanding sorting and their types

Understanding bubble sort

Implementing bubble sort using PHP

Complexity of bubble sort

Improving bubble sort algorithm

Understanding selection sort

Implementing selection sort

Complexity of selection sort

Understanding insertion Sort

Implementing insertion sort

Complexity of insertion sort

Understanding divide-and-conquer technique for sorting

Understanding merge sort

Implementing merge sort

Complexity of merge sort

Understanding quick sort

Implementing quick sort

Complexity of quick sort

Understanding bucket sort

Using PHP's built-in sorting function

Summary

Exploring Search Options

Linear searching

Binary search

Analysis of binary search algorithm

Repetitive binary search tree algorithm

Searching an unsorted array - should we sort first?

Interpolation search

Exponential search

Search using hash table

Tree searching

Breadth first search

Implementing breadth first search

Depth first search

Implementing depth first search

Summary

Putting Graphs into Action

Understanding graph properties

Vertex

Edge

Adjacent

Incident

Indegree and outdegree

Path

Types of graphs

Directed graphs

Undirected graphs

Weighted graphs

Directed acyclic graphs (DAG)

Representing graphs in PHP

Adjacency lists

Adjacency matrix

Revisiting BFS and DFS for graphs

Breadth first search

Depth first search

Topological sorting using Kahn's algorithm

Shortest path using the Floyd-Warshall algorithm

Single source shortest path using Dijkstra's algorithm

Finding the shortest path using the Bellman-Ford algorithm

Understanding the minimum spanning tree (MST)

Implementing Prim's spanning tree algorithm

Kruskal's algorithm for spanning tree

Summary

Understanding and Using Heaps

What is a heap?

Heap operations

Implementing a binary heap in PHP

Analyzing the complexity of heap operations

Using heaps as a priority queue

Using heap sort

Using SplHeap, SplMaxHeap, and SplMinHeap

Summary

Solving Problems with Advanced Techniques

Memoization

Pattern matching algorithms

Implementing Knuth-Morris-Pratt algorithm

Greedy algorithms

Implementing Huffman coding algorithm

Understanding dynamic programming

0 - 1 knapsack

Finding the longest common subsequence-LCS

DNA sequencing using dynamic programming

Backtracking to solve puzzle problem

Collaborative filtering recommendation system

Using bloom filters and sparse matrix

Summary

PHP Built-In Support for Data Structures and Algorithms

Built-in PHP features for data structure

Using PHP array

SPL classes

Built-in PHP algorithms

Hashing

Built-in support through PECL

Installation

Interfaces

Vector

Summary

Functional Data Structures with PHP

Understanding functional programming with PHP

First class functions

Higher order functions

Pure functions

Lambda functions

Closures

Currying

Partial applications

Getting started with Tarsana

Implementing stack

Implementing a queue

Implementing a tree

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部