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. 


Queue

In Java, a Queue is an interface, which means you cannot construct a Queue directly. The best option is to construct off a class that already implements the Queue interface, like LinkedList, PriorityQueue, etc.
In python, there is built in module for python. 


Set

I wasn't able to find python set that can maintain elements in an ascending order. If you find one, please comment below, thanks 


Map

I haven't found the insertion order maintainable map in C/C++. These are some map data structures. 

Priority_queue 


Comments

Popular posts from this blog

Structures of JAVA

What is URI(URN, URL)

Spring Boot JPA - Pagination

Spring Boot JPA - What is JPA, Entity, Repository

Design Pattern - Proxy