Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i want to do inorder traversal not using recursive and to put the nodes in an array given the size of the BSTmap, it is easy to use recursive put i need to put the nodes in an array !!
Does it have to be an array? If not, you could use a linked list to add and remove the nodes without needing to know the size of the BSTmap.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 days ago.
Improve this question
while writing a code of bfs for graph we are using for each loop for extracting values from adjacency list, wanted to know how this int it is getting all the values of each and every element of 2d list?
this is code for bfs traversal of graph
I have tried to extract every element of adjacency list ans marking it as true if it is false in arr.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to check if a List of characters like {a,a,d,e} is contained in a list like {a,d,e} in java. I want the answer to be false but I have no idea how to go about doing this. All help would be appreciated :)
Try using the retainAll() method and check for the result. col1.retainAll(col2) leaves all elements in col1 that are also in col2. If the size of col1 is the same before and after the call, the whole col2 is contained.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need help with foreach method to LinkedList in Java 8.
I need to start from second element. I don't know how to do this.
You can skip the first element: list.stream().skip(1).forEach(...). Note that the skipped elements will still be traversed by the stream, so for a random access list such as ArrayList it is much more efficient to use a loop starting from the relevant index if this index is very large. In your case it doesn't matter because your starting index is small and your list doesn't support random access.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a fully working B-Tree, and I want to convert this into a B+tree.
Is there any way that I can achieve that without changing so much of my code? is it possible?
Is there any way that I can achieve that without changing so much of my code?
Nope. Significant amount of change is required. B+ tree doesn't store data pointer in non-leaf nodes.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have an array of strings but the values in array is changing continuously changing.
Is there any other way of managing the array except removing items and changing index locations?
public int[] deviceId=null;
deviceId=new String[deviceCount];
in my case deviceCount is changing as new device comes. so i continuously need to change array size and add or remove items
Java offers a really handy mechanism known as the ArrayList. It's a dynamic array that you can use to do what you're describing.
http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html