Lesson 15 of 34
Array Algorithms: Reverse, Search, Sort
10 min 30 XP
java.util.Arrays class में काम के helpers हैं: Arrays.toString() array को साफ़-सुथरा print करता है और Arrays.sort() उसे sort करता है।
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Interviews में अक्सर library की मदद के बिना करने को कहा जाता है। Array को उलटने के लिए दोनों सिरों से swap करते हुए बीच में मिलें (two-pointer technique)।
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.दो values को swap करने के लिए एक को रखने वाला temp variable चाहिए।