thank goodness all your examples are in java, because there are so many videos show algo in c++, and luckily I found you, thank god your a life saviour
@shankar74354 ай бұрын
Thinking the same here..😂😂😂
@kaushik10018 күн бұрын
Content is absolute gem.
@Alex-de7rz2 жыл бұрын
This channel is a hidden gem.
@AbhishekZambre4 жыл бұрын
I think the check at line 48 should have OR condition rather than AND. if(rm_index >= len || rm_index < 0) throw new IndexOutOfBoundsException();
@karuneshpal89083 жыл бұрын
u r right Abhishek
@sandeepharidasula31915 жыл бұрын
Thank you so much for sharing your knowledge.
@Colstonewall8 жыл бұрын
Thanks, William!
@superoxidedismutase57575 жыл бұрын
your voice is so relaxing
@rahulgawale3 жыл бұрын
Thank you very much for the detailed video.
@CoolCoder_2 жыл бұрын
Good job on the implementation but I would love to see better code comments! :D
@JayPatel129283 жыл бұрын
In clear(), why do we loop through the array and explicitly set each element to null? Can't we just reassign `arr` to a brand new list? assuming the detached old array would be garbage collected automatically? I want to understand the reasoning behind this decision.
@yahyafati4 жыл бұрын
Thanks for this great course. It is an amazing course, and I have learnt a lot so far. I have done an hour of the course so far and I have a question. In the implementation of the Dynamic Array why is the capacity of the array changed after removal of an element. I get that it's size(len) changes, but why is the capacity reset aswell?
@jakenguyen25842 жыл бұрын
I was wondering the same thing about setting the capacity to len--. I think it should be len-- instead of capacity = len--;
@rusticExploration4 жыл бұрын
removeAt might give undesired result , if index is equal to 0 and previously length was one, at line 50
@I_dont_want_an_id4 жыл бұрын
May this encourage your faith facebook.com/esther.chester77/videos/1029971633787995/ kzbin.info/www/bejne/o3rbfJ9vgL6qhLc m.facebook.com/story.php?story_fbid=2582272895211292&id=490097534428849 m.kzbin.info/www/bejne/e3aVpH1jjK6ZqtU kzbin.info/www/bejne/h6iVmaqZpMiJrK8 m.facebook.com/story.php?story_fbid=777934336005747&id=100013675634259
@bharpursingh3 жыл бұрын
2.11 What is the meaning of balanced check, that he is not doing?
@amanbhatia74425 жыл бұрын
Hi William, I dont understand why have you set capacity to len - 1 in removeAt. Couldnt we just do away with decrementing length?
@jovanpetrovic1684 жыл бұрын
I agree with you
@MrManUnited12314 жыл бұрын
Shouldn't the operator on line 48 be a logical or "||" instead of logical and?
@blairbass842 жыл бұрын
I caught this as well. Definitely || instead of &&
@arhamshafiqexplains6 ай бұрын
Why have you used Object instead of Generics T as arguments in the remove(), indexOf(), and contains() methods?
@saschion3 жыл бұрын
how would i create a array like this and how i use the methods?
@brayaon6 жыл бұрын
what editor is that?? Thank you for share your knowledge
@WilliamFiset-videos6 жыл бұрын
sublime text
@mjaesthetics93007 ай бұрын
this looks like implementation of ArrayList in java. Is that right?
@ppchavan0014 жыл бұрын
4:50 is'nt that code going crash if you remove indexAt 0?
@buihung3704 Жыл бұрын
Also, why T arr = (T[]) new Object[capacity] ? Why don't u write T arr = new T[capacity]?
@alexanderten54975 жыл бұрын
i did not understand anything here
@Debianguy3110 ай бұрын
There are many prerequisites like OOps,Generics, functions 😅
@shankar74354 ай бұрын
@@Debianguy31I would have been in his position had I not been fairly proficient in Java Generics. Now at least I do not get stuck reading that code. I understand every bit of the code but difficult to reproduce with the same ease when its required due to too many conditions to consider.
@scottzeta30672 жыл бұрын
removeAt is not correct, line 52 should be i++ instead of j--
@劉宗旻-k9l2 жыл бұрын
Thank you! I was confusing for a long time until I saw your comment.
@buihung3704 Жыл бұрын
You're wrong. If i++, you will be skipping an element which is rm_index + 1 right in that iteration, making new_arr lost that value, looks closely it's an if-else, not if + a line that always run on each iteration :v
@indranishome90033 жыл бұрын
What ide is this ?
@buihung3704 Жыл бұрын
Wtf is wrong with this code? In removeAt(), you didn't consider the AND condition on line 48? How about rm_index = 0 and len = 1, how are u gonna initialize a static array with 0 space on line 50? P.s: Okay i understand the capacity reset, since this is a new array not the old array anymore, the new array have been placed on different memory pointer than the old one. Old capacity don't mean shjt after changing array. So why don't we make the capacity x2 the length after call removeAt()? Well this is what I called uncertainty, u don't know what u gonna do next right? Wait until u call add() method again and then u can allocate more capacity. P.s 2: I study the continuous mechanism of array in memory context :3
@patricksile7 жыл бұрын
Everything was nice till I saw your examples were in `Java`. :smile:
@ayeshabashir57856 жыл бұрын
same!
@alaetouba90494 жыл бұрын
haha whats wrong with java?
@alizafari87294 жыл бұрын
Python and C++ implementations could be found here: github.com/akzare/Algorithms
@SantoshKumar-lz2ti2 жыл бұрын
why java??? why not c++🥲
@mikaeltofvesson18827 жыл бұрын
public T remove(int idx){ T removeItem = theItems[idx]; for(int i = idx; i < size()-1; i++ ){ theItems[i] = theItems[i+1]; } theSize--; return removeItem; }