![]() Create an empty MutableList val list1 = mutableListOf() // Create a MutableList with elements val list2 = mutableListOf(0, 1, 2, 3, 4) I want to point out that you can easily use it as a Stack or a Queue if you encounter a problem that requires one I usually use a MutableList to represent the queue in breadth first search. This is the data structure I ended up using the most often, and you’re probably already familiar with it. You can find Part 2 here, Part 3 here, 4 - here and Part 5 - here. In Part 1, I’ll cover a few common data types that appear often in algorithms and data structures questions - how to initialize them, how to do some common operations on them, and some use cases. I decided to compile an overview of code snippets that came up often during my interview prep into a cheatsheet, then do a deep dive into the code snippets in a series of 5 Medium posts. ![]() ![]() I decided to tackle most of the problems in Kotlin since I was applying to Android positions, and noticed that the Kotlin I was writing was very different from the Kotlin I use at work. ![]() I spent most of May and June preparing for interviews, and by preparing for interviews I mean doing a lot of Leetcode. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |