Click here to Skip to main content
15,848,692 members
Home / Discussions / Java
   

Java

 
GeneralRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
Richard MacCutchan5-Sep-23 1:21
mveRichard MacCutchan5-Sep-23 1:21 
AnswerRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
jschell5-Sep-23 3:34
jschell5-Sep-23 3:34 
GeneralRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
Member 160852745-Sep-23 6:11
Member 160852745-Sep-23 6:11 
GeneralRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
Richard Deeming5-Sep-23 22:23
mveRichard Deeming5-Sep-23 22:23 
GeneralRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
Richard MacCutchan5-Sep-23 23:43
mveRichard MacCutchan5-Sep-23 23:43 
QuestionWhat is the difference between a static and an instance variable in Java? Pin
Ashley OP8-Aug-23 0:31
Ashley OP8-Aug-23 0:31 
AnswerRe: What is the difference between a static and an instance variable in Java? Pin
Richard MacCutchan8-Aug-23 0:33
mveRichard MacCutchan8-Aug-23 0:33 
QuestionJavaFX multithreading operation changing GUI elements Pin
JohnCodding21-Jul-23 7:37
JohnCodding21-Jul-23 7:37 
AnswerRe: JavaFX multithreading operation changing GUI elements Pin
JudyL_MD21-Jul-23 10:01
JudyL_MD21-Jul-23 10:01 
GeneralRe: JavaFX multithreading operation changing GUI elements Pin
JohnCodding21-Jul-23 10:44
JohnCodding21-Jul-23 10:44 
GeneralRe: JavaFX multithreading operation changing GUI elements Pin
JudyL_MD21-Jul-23 11:46
JudyL_MD21-Jul-23 11:46 
AnswerRe: JavaFX multithreading operation changing GUI elements Pin
JohnCodding21-Jul-23 10:49
JohnCodding21-Jul-23 10:49 
QuestionOperator precedence Pin
darek2902198812-Jul-23 6:41
darek2902198812-Jul-23 6:41 
AnswerRe: Operator precedence Pin
Dave Kreskowiak12-Jul-23 7:11
mveDave Kreskowiak12-Jul-23 7:11 
QuestionOperator precedence Pin
darek2902198811-Jul-23 4:06
darek2902198811-Jul-23 4:06 
AnswerRe: Operator precedence Pin
Richard Deeming11-Jul-23 4:30
mveRichard Deeming11-Jul-23 4:30 
GeneralRe: Operator precedence Pin
darek2902198812-Jul-23 6:44
darek2902198812-Jul-23 6:44 
GeneralRe: Operator precedence Pin
jeron112-Jul-23 7:15
jeron112-Jul-23 7:15 
AnswerRe: Operator precedence Pin
Richard MacCutchan11-Jul-23 6:24
mveRichard MacCutchan11-Jul-23 6:24 
GeneralRe: Operator precedence Pin
darek2902198812-Jul-23 6:46
darek2902198812-Jul-23 6:46 
QuestionRe: Operator precedence Pin
Richard MacCutchan12-Jul-23 7:15
mveRichard MacCutchan12-Jul-23 7:15 
AnswerRe: Operator precedence Pin
Andre Oosthuizen14-Jul-23 2:36
mveAndre Oosthuizen14-Jul-23 2:36 
GeneralRe: Operator precedence Pin
Richard MacCutchan14-Jul-23 2:52
mveRichard MacCutchan14-Jul-23 2:52 
QuestionSign a PDF document in PAdeS format using a CNS (National Services Card) or a SmartCard. Pin
Antonio20238-Jul-23 20:45
Antonio20238-Jul-23 20:45 
QuestionRelative Sorting Pin
Harriet Muduwa26-Jun-23 7:42
Harriet Muduwa26-Jun-23 7:42 
Relative Sorting
Ramesh is given two arrays, arr1 and arr2. He wants to sort arr1 in such a way that the relative order of arr2 is maintained in arr1. For elements that are not present in arr2, he wants to add the these elements at the end of the array in sorted fashion.

Can you help Ramesh achieve this task?

Input Format
First line contains two integers n and m denoting size of arrays arr1 and arr2 respectively.

Second line contains n space separated integers denoting the array arr1.

Third line contains m space separated integers denoting the array arr2.

Output Format
Print the relatively sorted arr1

Example 1
Input

11 4
2 1 2 5 7 1 9 3 6 8 8
2 1 8 3
Ramesh is given two arrays, arr1 and arr2. He wants to sort arr1 in such a way that the relative order of arr2 is maintained in arr1. For elements that are not present in arr2, he wants to add the these elements at the end of the array in sorted fashion.

Can you help Ramesh achieve this task?

Input Format
First line contains two integers n and m denoting size of arrays arr1 and arr2 respectively.

Second line contains n space separated integers denoting the array arr1.

Third line contains m space separated integers denoting the array arr2.

Output Format
Print the relatively sorted arr1

Example 1
Input

11 4
2 1 2 5 7 1 9 3 6 8 8
2 1 8 3

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.