手写实现ArrayList & LinkedList

微信公众号:程序媛的非程序人生

关注可了解更多资讯。问题或建议,请公众号留言;

1、手写实现ArrayList


 

 

2、手写实现 LinkedList


 

 

 

3、LinkedList的数据结构


 

   对于随机访问get和set,ArrayList优于LinkedList,因为LinkedList要移动指针。 

   对于新增和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动指针。


 

如果你觉得该篇对你有帮助,欢迎关注公众号

猜你喜欢

转载自www.cnblogs.com/nicole-star/p/10599782.html