PHP数据结构(类似Java)集合 [英] PHP Data Structures (Java-like) Collections

查看:173
本文介绍了PHP数据结构(类似Java)集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道创建一个小型库的好处,该库可能供个人使用,它指定了一些数据结构,例如链接列表,树(二进制,AVL等),哈希查找表等

I'm wondering about the merits of creating a small library, probably for personal use which specifies a few data structures such as Linked Lists, Trees (Binary, AVL, etc...), Hash Lookup Tables, and the like.

其中一些将建立在本机PHP数组的顶部,因为它可以充当许多此类类型,而某些则可能不会。

Some of these would be built on top of the native PHP array, as it acts as many of these types, and some potentially wouldn't.

我的问题确实是,构建任何这些类(特别是那些可能无法基于本机数组构建的类)是否有意义?我在这里谈论的是计算的实用性,特别不想涉及动态语言和打字语言的论点(我仍然很想听到关于该主题的任何有趣且相关的东西)。

My question is really, would it make sense to build any of these classes - especially those which may not build upon the native array? I'm talking here about the computational practicality, and don't especially want to get into the dynamic vs. typed language argument (I'm still interested in hearing anything interesting and relevant on that topic as an aside).

时它狂建立这些(可能更有效,逻辑上)使用类当我们有一个C实现的基本排列的?

Is it mad to build these (possibly more efficient, logically) data-structures using classes when we have a C implementation of a basic array?

谢谢..

推荐答案

已经有 http://php.net/manual/en/book.spl.php 可能涵盖了您想要的内容,但是如果构建这些内容将会很有趣对您来说,并提高您的PHP /通用编码技能,那么我认为这将是一个很好的主意。

There is already the http://php.net/manual/en/book.spl.php which may cover what you want but if building these would be interesting for you and improve your PHP/general coding skills then I think it would be a very good idea.

可能也是向更多读者发布内容的好库放入简历。

May also be a good library to release to a wider audience and something to put on your CV.

这篇关于PHP数据结构(类似Java)集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆