Shift All Zero Elements to Right Side of the Array - Java interview Question

preview_player
Показать описание
In this video, I have explained how to Shift All Zero Element to Right Side of the Array - Java interview Question.
OR
Shift all non zero elements to left side of the array.

~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Naveen AutomationLabs Paid Courses:
Java & Selenium:

Java & API +POSTMAN + RestAssured + HttpClient:
Рекомендации по теме
Комментарии
Автор

Just 2 days back I was asked the same question in one of the top MNCs, I did it through arraylist using .add and . remove in one loop

SceneSnppets
Автор

Naveen Sir, I was asked this question recently. I was searching the logic but saw this video.. Thanks for helping people in the testing community.. you are a true blessing for us.. Thank you

rajatnegi
Автор

Thanks Naveen, gone through all 40 videos and with most of them learnt something new. Really appreciate your efforts. please keep going and keep growing 👍

MrPankajchakraborty
Автор

Thank you Naveen. Please continue to do these kinds of coding problems

sanketh
Автор

This series is really really helpful 👍

meghaagarwal
Автор

Really appreciate your efforts sir 👍 thanks 😊

amanjotkaur
Автор

Brother keep Doing... It's really helping

gopichinthagumpula
Автор

Thanks a lot sir. This trick is very helpful, its very handy in many other array operations too.

chetanurkudkar
Автор

Hi Naveen,
I was asked this question "how to Shift All Zero Element to Left Side of the Array" in my last interview. Can you please make a video of the same?

soumyajit
Автор

Hi Naveen...which tool/device/pad you are using to explain using pen (seems very smooth)...can you please share the details ?

sagarshrivastava
Автор

Please suggest any material to learn solve problems in leet code, hackerrank...

prakashbtw
Автор

Naveen, what FONT do you use in eclipse ?

shankumondal
Автор

Hey naveen,
Can you do a program regarding setting the custom date and time and getting the date & Time.
Take a custom class and set the date and get the salary details according to the year of joining.
#interviewquestion

storyteller_x
Автор

Please share the program for keeping all zeros to the left hand side of the array . This is being asked in interviews

soumyajit
Автор

Hii Naveen, can you please tell the logic for shift left without out using two new arrays

kishorekumar
Автор

Logic for shift left:

int count = 0;
for (int num : a) {
if(num == 0) {
newArray[count]=num;
count++;
}
}
for(int num : a) {
if(num !=0) {
newArray[count]=num;
count++;
}
}

subramanianr
Автор

What will be the time complexity of this programme as we are creating a new array here. Can we achieve it by single array only.

healthbeautytips