• 1 048
  • 17 229 841


Struct hack | GeeksforGeeks
Views 9554 months ago
Memory leak | GeeksforGeeks
Views 1.6K5 months ago


  • Rishi Yadav
    Rishi Yadav 16 minutes ago

    when we use fast and slow pointers why do we need to check the condition for both the pointers? if we check only for the fast pointer it causes a segmentation fault.

    REVANTH RAVIPUDI 2 hours ago

    How did u derive the recurence equation...

  • prince bargujar
    prince bargujar 6 hours ago

    another approach is like .. enqueue the root, taking a while loop(q is not empty), make count variable is q.size ; print- q.front ; print - q.rear ; taking another while loop(count >0), temp=q.front; pop-temp->data; push-root->left ; push-root->right ; count - - ;

  • Ismail abderrahman
    Ismail abderrahman 11 hours ago


  • kasthuri shravankumar

    Thank you.

  • bmuniraja reddy

    How to delete duplicate records in a column?

  • Moussa Sarr
    Moussa Sarr Day ago

    Your recursion/dfs will not pass on LeetCode

  • imran ahamed
    imran ahamed Day ago


  • Moussa Sarr
    Moussa Sarr Day ago

    You need an amplifier on your voice . I should design you a special one just for your voice. Otherwise, good job and thanks !

  • Shubham Kumar
    Shubham Kumar Day ago

    time complexity of the algorithm should also be discussed

  • Ganesh Kumar
    Ganesh Kumar Day ago

    I think no rows will return. Correct me if am wrong #GeeksForGeeks

  • Het Patel
    Het Patel 2 days ago

    k>n-k then k=n-k... why?

  • Increadible Angel
    Increadible Angel 2 days ago

    Perfect 👌

  • Harini Subramanian
    Harini Subramanian 2 days ago

    The entire banker's algorithm process in 4.18 minutes .Really great ! Need more videos like this!

  • swajan golder
    swajan golder 2 days ago

    Where is the use of stack here?????

  • Santhosh N
    Santhosh N 2 days ago

    Thank 🙏💕u so much sir

  • Raj Yadav
    Raj Yadav 2 days ago

    WORST explanation of code implementation. Also video uploaded quality is 360px. You are dropping the name and fame of Geeksforgeeks seriously

  • Suresh Shivarathri
    Suresh Shivarathri 2 days ago

    Nice. Please upload on faq SQL queries

  • AL- AMIN
    AL- AMIN 2 days ago

    why cant my pc get into geekforgeeks?

  • CgiScript
    CgiScript 2 days ago

    new_node->next = (*head_ref) (*head_ref) = new_node Why above two statements use parantheses around head_ref ???

  • Uday Narayan Mukherjee

    The last (efficient) algo is an iterative approach and not a recursive one

  • Crack CAT
    Crack CAT 3 days ago

    great mam

  • Shubham Papnai
    Shubham Papnai 3 days ago

    Keep it up!!!!

  • Akhil Reddy
    Akhil Reddy 3 days ago

    Why background music??????????

  • iamsumeet ___
    iamsumeet ___ 3 days ago

    Beautifully explained

  • Simon Besozzi
    Simon Besozzi 3 days ago

    When to use greedy algorithms: Others than the reasons you've mentioned, wouldn't it also be appropriate when working with NP-Complete problems?

  • malhar jadhav
    malhar jadhav 3 days ago

    """Josephus Problem """ n = 2 l = [] for i in range(0,n): l.append(i) j = 1 while len(l) != 1 : del l[j] j = j+1 if j > len(l): j = 1 elif j == len(l): j = 0 print(l[0]+1)

  • Dexter Aparicio
    Dexter Aparicio 3 days ago

    Given arr = {1,2,3}; is an invalid input because it contains the element 3. You said, 0 to n-1 only therefore the value of 3 is illegal. You cannot also allow element of 0 because you cannot negate it. So this algo assumes that at least there is a repeating element to satisfy the constraint. For example, arr = {1,2,1}; is valid input. So many constraint, and a-priori requirements. But the curious funny part is that the pre-condition that at least one element must repeat to make the input valid is also the problem that the algo is meant to determine.

  • Bok Woon Chua
    Bok Woon Chua 4 days ago

    dude, you're brilliant. About a minute in and I immediately understood the essence of merge sort, as compared to watching some other videos where they ramble on for 15 minutes...

  • Nidhi Tiwari
    Nidhi Tiwari 4 days ago

    where is the hashtable that she mentioned in the beginning :/

  • Sohan Nikam
    Sohan Nikam 4 days ago

    Audio is dub and video also

  • Bhavuk Garg
    Bhavuk Garg 4 days ago

    0:00 chai pee lo

    DHARANI T 5 days ago


  • Michael N
    Michael N 5 days ago

    Your example is a poor example because the median for the total array just happens to be the medians of each array.

  • ajourney
    ajourney 5 days ago

    why it will give the right answer?

  • Pranav Mohanty
    Pranav Mohanty 5 days ago

    void sortedInsert(Node** head, int x) { Node *temp=new Node(x); // temp->next=NULL; // temp->data=x; Node *l1=*head; Node *curr=l1->next; Node *prev=NULL; //cout<<curr->data; if(temp->data <curr->data) { temp->next=curr; l1->next=temp; // return head; } else { while(curr!=l1) { if(temp->data > curr->data) {prev=curr; curr=curr->next; } else { break; } } // cout<<" "<<curr->data<<endl; // cout<<" "<<prev->data; prev->next=temp; temp->next=curr; } //return head; }

  • Kamal M
    Kamal M 5 days ago

    What's the difference between highest salary and nth highest salary?

  • ♫♪Ludwig van Beethoven♪♫

    Im going to solve my life problems using recursion. Wish me luck!

  • Mahesh kumara
    Mahesh kumara 5 days ago

    No rows will be printed!

  • Anjali Shah
    Anjali Shah 6 days ago

    Any online good platform for sql command ?

  • Milad
    Milad 6 days ago

    Great explanation! THANKS

  • Ceez Geez
    Ceez Geez 6 days ago

    This need more step by step graphics showing what is happening imo lol I’m lost

  • himanshu chugh
    himanshu chugh 6 days ago

    as other fellows are asking i will ask it too, what if every goddamn element is negative

  • Simeon Dyankov
    Simeon Dyankov 6 days ago

    what if the array is { 1, 2147483647 }, does the INT_MAX count as the second smallest in this array? The smallest will become 1 but the second smallest won't update and therefore print out no second smallest.

  • Haquesm Rakibul
    Haquesm Rakibul 6 days ago

    please try to speak little bit slowly!!

  • Vikas Tomar
    Vikas Tomar 6 days ago

    Best Explanation Ever

  • Divyesh Bhartiya
    Divyesh Bhartiya 6 days ago

    When min_dist is equal to 1,can we break the loop there itself? Coz min_dist can not be less than 1.

  • rahul misra
    rahul misra 7 days ago

    very well explained.Thank you

  • Praveen j
    Praveen j 7 days ago

    It's very helpful

  • Praveen j
    Praveen j 7 days ago


  • jana anvesh
    jana anvesh 7 days ago

    sir binary equivalent of 11 is 1011 ryt then you wrote 1101 why sir

  • Andre Bemantoro
    Andre Bemantoro 7 days ago

    improve the audio quality please

  • SomnAth Pal
    SomnAth Pal 7 days ago

    This tune is copied ... it’s very similar to Audioslaves “Doesn’t remind me of anything” they copied Chris Cornell...

  • Vamsi Ksk
    Vamsi Ksk 7 days ago

    Can't we write rowno=3

  • Sachin kaushik
    Sachin kaushik 7 days ago

    # Python Code for tabulation def fib_tab(n): lookup_tab = [0]*(n+1) lookup_tab[1]=0 lookup_tab[2]=1 for i in range(3, len(lookup_tab)): lookup_tab[i]=lookup_tab[i-1]+lookup_tab[i-2] return lookup_tab[n] fib_tab(50)

  • Sachin kaushik
    Sachin kaushik 7 days ago

    import time # Memoization # initializing array with size atleast n+1 of fib you want to calculate list1= [0]*51 def fib_memo(n): #Checking if value is present or not in List if list1[n]==0: # Base Case if n<=2: list1[n]=n-1 # Storing Values in array else: list1[n]=fib_memo(n-1)+fib_memo(n-2) # returning Value at index n return list1[n] start = t.time() print(fib_memo(50)) end = t.time() time_taken = end - start print('Time: ',time_taken)

  • Jitesh Malipeddi
    Jitesh Malipeddi 7 days ago

    What is the time complexity of the solution? I suppose it is O(n*n) ?

  • Liem H
    Liem H 7 days ago

    Holy shit. Now I understand. There are many more move than I had thought in my head.

  • Vijendra Kumar Sharma


  • Chaehong Lee
    Chaehong Lee 7 days ago

    so how do you check if there is a cycle?

  • xu binhui
    xu binhui 8 days ago

    why the bgm so scary...

  • Christopher Bailey
    Christopher Bailey 8 days ago

    What if we can’t sort the array prior to searching?

  • Shubham Shingi
    Shubham Shingi 8 days ago

    Is level of topic covering is same in live class and DSA self paced course? Are these courses differ in quality of content?

  • CgiScript
    CgiScript 8 days ago

    &array is not an alias for &array[0]. If it were an alias for it, &array+1 would give the same output with &array[1]. &array just gives the whole array's adress. Not first element's adress of the array.

  • Ishita Gupta
    Ishita Gupta 8 days ago

    Even we can read what is written.. There is no point in publishing such videos

  • Vijeet Vergis
    Vijeet Vergis 8 days ago

    I don't thiink Moore's algorithm will work for the following case:- a[ ]={2,2,3,4,2,2,6,6,2} Here 2 is the majority element as it occurs more than n/2 times, but Moore's algorithm will return 6 as the candidate. Can someone testify?

  • CodeVary
    CodeVary 8 days ago

    Really Helpful, Thanks!

  • solimm4sks
    solimm4sks 8 days ago


  • meusing it
    meusing it 9 days ago

    Super Cool! Thanks!

  • Mạnh Đức Trần

    I read your articles and couldn't fully comprehend. Then I saw these videos and got those codes easily mastered. Thank you.

  • kasthuri shravankumar


  • Ravisankar Jampani
    Ravisankar Jampani 9 days ago

    Why both peek and pop are needed, Just pop is not enought ?

  • Tarun Kumar Gola
    Tarun Kumar Gola 10 days ago

    int a=scan.nextInt(); int b=scan.nextInt(); int c=a-b; while(c>=b){ c=c-b; } this should work

  • Jeevan Raajan
    Jeevan Raajan 10 days ago


  • yellow 7
    yellow 7 10 days ago


  • Seeethy
    Seeethy 10 days ago

    What will happen if i will write "ls -h" ?

  • Moh & Hau
    Moh & Hau 10 days ago

    what is it? you just read the code , no explanation how the loop works , nothing

  • kasthuri shravankumar

    good gfg

  • Aakriti Agarwal
    Aakriti Agarwal 10 days ago

    What is the difference between python and python 3?

  • Cryptohike
    Cryptohike 10 days ago

    didn't understand a word.

  • kasthuri shravankumar

    great gfg

  • Naman Gupta
    Naman Gupta 11 days ago

    Make more videos....

  • Shouvit Pradhan
    Shouvit Pradhan 11 days ago

    What is X in this?

  • Tarun Kumar Gola
    Tarun Kumar Gola 11 days ago

    Please explain how you get time complexity Θ (log(n)).

  • Tarun Kumar Gola
    Tarun Kumar Gola 11 days ago

    I don't know why my code is giving output 3 for input 23 .My code is same as yours.

  • Praveen j
    Praveen j 11 days ago

    Number of rows will be displayed 7

  • Praveen j
    Praveen j 11 days ago

    It will be filled null value in all associated employee tuples

  • Divya Gazinkar
    Divya Gazinkar 11 days ago

    For bucket dont confuse it with no. Of elements. Bucket size is fixed 10 ie 0 to 9. For complexity always consider the buckets also

  • vikas jain
    vikas jain 12 days ago

    below is much faster ... int get_pair_count(vector<int> v, int t) { unordered_map<int, int> um; int total_pairs = 0; for (int i : v) { um[i]++; if (um.find(t - i) != um.end()) total_pairs++; } return total_pairs; }

  • Desu West
    Desu West 12 days ago


    • Antonio dos Reis Feitosa Neto
      Antonio dos Reis Feitosa Neto 7 days ago

      You may not need this anymore, but on the link "Explanation.." there is, well, an explanation. And an implementation in Phyton...

  • Rajkumar S
    Rajkumar S 12 days ago

    Output: 0 rows m = 7 rows n = 0 rows (for d.deptno=50) So output should be 7*0 which is 0

  • kishan tiwari
    kishan tiwari 12 days ago

    thanks alot

  • Rahul Udaiwal
    Rahul Udaiwal 12 days ago

    Not a correct solution failed for : A = "YXX" B = "XY" C = "YXYXX"

  • Sangeet Kumar Mishra

    What's with the Taare Zameen Par background music ?

  • Bharti Chhatwani
    Bharti Chhatwani 12 days ago

    Why created two methods first and last. Looks to me both are same

  • Naman Gupta
    Naman Gupta 13 days ago

    Tnku... Please make more videos... Your videos are really helpful.... And geeks for geeks Sacha best sites for IT preparation exam and interviews...

    • Trishaank Kumar
      Trishaank Kumar 12 days ago

      Thanks for the support, it will be really helpful for us as well if u could share SQL interview questions

  • AkA RAZE
    AkA RAZE 13 days ago

    The solution is probably incorrect

  • Bharti Chhatwani
    Bharti Chhatwani 13 days ago

    There should be a pre condition : all element's value is less than n-1

  • Sukanta Ghosh
    Sukanta Ghosh 13 days ago

    Bhai sahab kya bak raho ho aap....

  • Praveen j
    Praveen j 13 days ago

    Thanks for making this video