Commit 6fbbc447 authored by Rohit Prasad's avatar Rohit Prasad

Use LinkedList instead of ArrayList

parent eee8b750
...@@ -2,8 +2,8 @@ import java.util.*; ...@@ -2,8 +2,8 @@ import java.util.*;
public class OrderMatching { public class OrderMatching {
ArrayList<SellOrder> sellOrderQueue = new ArrayList<>(); List<SellOrder> sellOrderQueue = new LinkedList<>();
ArrayList<BuyOrder> buyOrderQueue = new ArrayList<>(); List<BuyOrder> buyOrderQueue = new LinkedList<>();
/* /*
* Checks if the order is valid * Checks if the order is valid
...@@ -11,4 +11,5 @@ public class OrderMatching { ...@@ -11,4 +11,5 @@ public class OrderMatching {
boolean validate(Order order) { boolean validate(Order order) {
return order.getQty() > 0 && order.getPrice() > 0.0; return order.getQty() > 0 && order.getPrice() > 0.0;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment