ARRAY PRACTICE PROBLEMS | Must do Array Questions | DSA Problems | GeeksforGeeks

  Рет қаралды 27,567

GeeksforGeeks

GeeksforGeeks

Күн бұрын

Пікірлер: 16
@GeeksforGeeksVideos
@GeeksforGeeksVideos 9 ай бұрын
🔴 What is Queue? Watch Now!: kzbin.info/www/bejne/gGiomYuso86riK8si=Swnh_wOAgvdRVXmX 🔴 Check out the Full DSA Course: kzbin.info/aero/PLqM7alHXFySHWUSBXUW9eq-ajb2JLoFNS&si=m_4B8bdS8dSJ9W6m
@misy_code
@misy_code 4 ай бұрын
Leaders in an array:- brute force approach:- my_array = list(map(int, input("Enter comma seperated values").split(","))) n = len(my_array) ans = [] for i in range(n): leader = True for j in range(i+1, n): if my_array[j] > my_array[i]: leader = False if leader == True: ans.append(my_array[i]) print(ans) optimal approach:- my_array = list(map(int, input("Enter comma separated values").split(","))) n = len(my_array) ans = [] maxi = 0 for i in reversed(range(n)): if my_array[i] >= maxi: ans.append(my_array[i]) maxi = max(my_array[i], maxi) ans.reverse() print(ans)
@pritamdavis
@pritamdavis 2 ай бұрын
nice
@GeeksforGeeksVideos
@GeeksforGeeksVideos Жыл бұрын
Suggest some more practice question here!
@jithendhar8817
@jithendhar8817 Жыл бұрын
Hey sir, if possible, try to explain implementation of recursion problems with more than 2 recursion calls & explain how to build logic in the first place to write such recursion functions.
@GeeksforGeeksVideos
@GeeksforGeeksVideos Жыл бұрын
Thank you for the suggestion. We will definitely try to make a video on the same. Till then, you can search for the same on: www.geeksforgeeks.org/
@AnjaneyuluGadelaRamanjaneyulu
@AnjaneyuluGadelaRamanjaneyulu 4 ай бұрын
Sir where is the code of the problems ur just explaining
@pritamdavis
@pritamdavis 2 ай бұрын
In the 3rd problem we use an hashmap?
@roshanbhaskar9804
@roshanbhaskar9804 Ай бұрын
lst=[] for i in range(0,6): x=int(input(" ")) lst.append(x) max_of_array=lst[-1] print(max_of_array) for j in range(len(lst)-2,0,-1): if lst[j]>max_of_array: print(lst[j]) max_of_array=lst[j] i think this is question 1 answer
@misy_code
@misy_code 4 ай бұрын
Sort an array of 0s 1s 2a using DNF Algorithm my_array = list(map(int, input("Enter space separated elements with 0s 1s 2s").split())) n = len(my_array) low = 0 mid = 0 high = n-1 while mid
@akshatakorgaonkar7379
@akshatakorgaonkar7379 6 ай бұрын
where can i find solution to these problems?
@3dDigitalArtToday
@3dDigitalArtToday 6 ай бұрын
public static void main (String [] args){ int [] arr={16, 17, 4, 3, 5, 2}; int n= arr.length; int max= arr[n-1]; System.out.println("Leader of the array is "+ max); for(int i=n-2;i>=0; i--){ if(arr[i]>max){ max= arr[i]; System.out.println("Leaders of the array "+ max); } } }
@akshatakorgaonkar7379
@akshatakorgaonkar7379 5 ай бұрын
thanks@@3dDigitalArtToday
@r.kgamer5501
@r.kgamer5501 Жыл бұрын
Bhai hacking so jata hai
@vandnajaiswal3254
@vandnajaiswal3254 4 ай бұрын
Bakwaas
@misy_code
@misy_code 4 ай бұрын
@vandnajaiswal3254 If you can't speak well then don't speak anything at all. You don't know how much courage, practice, and hard work it takes to become a mentor in geeks for geeks. If you cannot encourage something good out there, stay quiet and don't speak badly.
Longest Span with same Sum in two Binary arrays | GeeksforGeeks
20:26
GeeksforGeeks
Рет қаралды 303 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 220 М.
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 69 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 205 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 40 МЛН
Solve Any Pattern Question With This Trick!
57:20
Kunal Kushwaha
Рет қаралды 2,4 МЛН
The Last Algorithms Course You'll Need by ThePrimeagen | Preview
16:44
Frontend Masters
Рет қаралды 320 М.
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 364 М.
WHAT IS ARRAY? | Array Data Structures | DSA Course | GeeksforGeeks
9:48
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 652 М.
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 69 МЛН