BK Algorithm Club
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.


BK Algorithm Practice Forum
 
Trang ChínhTrang Chính  Latest imagesLatest images  Tìm kiếmTìm kiếm  Đăng kýĐăng ký  Đăng NhậpĐăng Nhập  

 

 Power up C++ with the Standard Template Library

Go down 
2 posters
Tác giảThông điệp
ldt
dzào năm I
ldt


Tổng số bài gửi : 109
Join date : 25/11/2008

Power up C++ with the Standard Template Library Empty
Bài gửiTiêu đề: Power up C++ with the Standard Template Library   Power up C++ with the Standard Template Library I_icon_minitime29.11.08 1:01

STL là 1 thư viện rất mạnh trong C++, cho phép các bạn có thể tạo sẵn 1 số cấu trúc cơ bản như list, stack, queue, priority_queue,... và 1 số thuật toán như sort, search, merge,...

để tìm hiểu thêm, các bạn có thể tham khảo tại đây:

Power up C++ with the Standard Template Library: Part I

Power up C++ with the Standard Template Library: Part II: Advanced Uses

hoặc tra cứu thư viện về STL tại đây:
STL Containers http://www.cplusplus.com/reference/stl/
STL Algorithms http://www.cplusplus.com/reference/algorithm/
Về Đầu Trang Go down
intellhave
dzô THCS
dzô THCS
intellhave


Tổng số bài gửi : 57
Join date : 25/11/2008

Power up C++ with the Standard Template Library Empty
Bài gửiTiêu đề: Re: Power up C++ with the Standard Template Library   Power up C++ with the Standard Template Library I_icon_minitime29.11.08 6:22

Cái này hay quá mà đến giờ mới biết Sad Nhưng dù biết trễ còn hơn không biết Embarassed
Về Đầu Trang Go down
ldt
dzào năm I
ldt


Tổng số bài gửi : 109
Join date : 25/11/2008

Power up C++ with the Standard Template Library Empty
Bài gửiTiêu đề: Re: Power up C++ with the Standard Template Library   Power up C++ with the Standard Template Library I_icon_minitime04.12.08 21:15

STL còn rất hữu dụng với các bài đồ thị đỉnh lớn nhưng cạnh ít. Các cấu trúc vector dãn nở bộ nhớ theo ý mình, nên việc này không còn là nỗi khiếp đảm của anh em khi gặp phải vấn đề nữa (lười làm danh sách liên kết Smile )
Về Đầu Trang Go down
ldt
dzào năm I
ldt


Tổng số bài gửi : 109
Join date : 25/11/2008

Power up C++ with the Standard Template Library Empty
Bài gửiTiêu đề: Re: Power up C++ with the Standard Template Library   Power up C++ with the Standard Template Library I_icon_minitime16.12.08 16:01

Trích dẫn :
STL is evil. It's at least two times slower than your classes. (even if you reserve for space, not demand it during the runtime. Demanding it during the runtime makes it even slower than your classes)

Use your own classes. I know writing your own map class isn't so easy (not like std::vector or std::list), but STL's error-checkings will make your program slow.

By the way, std::map stores data in sorted order (sorted by a). So, [] operator must be logarithmic (both pushing and accessing data). But if you use an array of iterators, it might get faster (never tried it though, might be a crime for the mankind Very Happy). Don't forget that you have to declare < operator for class a.
http://ace.delos.com/bb/viewtopic.php?t=1588
Về Đầu Trang Go down
Sponsored content





Power up C++ with the Standard Template Library Empty
Bài gửiTiêu đề: Re: Power up C++ with the Standard Template Library   Power up C++ with the Standard Template Library I_icon_minitime

Về Đầu Trang Go down
 
Power up C++ with the Standard Template Library
Về Đầu Trang 
Trang 1 trong tổng số 1 trang

Permissions in this forum:Bạn không có quyền trả lời bài viết
BK Algorithm Club :: Thuật toán :: Các chủ đề khác-
Chuyển đến