Java Data Structures VS Python, C/C++ Data Structures
Data Structures (JAVA, PYTHON, C/C++)
Arrays
Arrays(fixed size)
As for python, we use list to store series of data, and by default it's size can be dynamically adjusted. But arrays in JAVA and C/C++ have fixed size.
Arrays(dynamic size)
We can use dynamically adjustable arrays by using importing java.util.ArrayList in Java.
In C/C++, we can #include <vectors>.
Linked List
In java.util.LinkedList, we can use LinkedList data structure (which is doubly linked list).
In python doesn't have built in linked list data type. We will have to make it by ourselves (and it is pretty easy)
In C/C++, we can use list to implement doubly linked list.
Stack
There is built libraries for stack in Java and C/C++. But there is no stack for python. We can just use the list for stack operation.
Comments
Post a Comment