Arrays, strings और hash maps
Arrays, strings और hash maps से counting, lookup और grouping वाले problems एक ही pass में हल कर पाओगे, और interview के वो patterns पहचान पाओगे जहाँ ये काम आते हैं।
Beginner 3 · Data and toolsabout 2 hours5 sections
सीधा जवाब
Array में items क्रम से रखे होते हैं और position से O(1) में पढ़े जाते हैं। Python dict जैसे hash map में key से value औसतन O(1) में मिल जाती है, इसलिए कई O(n²) problems O(n) में बदल जाते हैं।
ये क्यों ज़रूरी है
रोज़ के ज़्यादातर data problems, जैसे orders गिनना या records match करना, arrays और hash maps से हल होते हैं। लगभग हर coding interview में ये पहला topic होता है, और O(n²) जवाब को O(n) बनाने का आम तरीका भी यही है।
Sign up free to read the whole lesson
The rest of this lesson: 5 parts, video lessons, the best course, practice and a quick check. It is free, takes a few seconds and needs no card.
Accounts are for learners aged 18 and over. Under 18? The quick answer and the first part of every lesson stay open: browse lessons by topic.
Related
Data structures and algorithmsBeginner 3: Data and toolsVideo lessonsArrayHash mapBig-O notation