Fractional Knapsack - Greedy Algorithm | C++ Placement Course | Lecture 33.4

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

audio quality of the video while the programming console is shown in the video isn't good at all!!

amansrivastava
Автор

You Are Great Sir 🙏🙏🌹🌹🙏🙏गुरू ब्रह्मा गुरू विष्णु, गुरु देवो महेश्वरा गुरु साक्षात परब्रह्म, तस्मै श्री गुरुवे नमः

🙏🚩🚩🙏

amitkumarchoubey
Автор

Ur short tricks of competative programming is OP...learnt new things

pritishpattnaik
Автор

Please improve the audio quality. Bad audio quality is making it difficult to understand this video

divyamaheshwari
Автор

bhaiya is video me code karte time voice issue hai. Second last video me bhi voice issue tha. Please fix it

hustlewithVaibhav
Автор

earlier in the few videos i wasn't able to cope up but bro your cp tricks made me a big fan of you.

ADITYASHARMA-dnsi
Автор

U ppl are doin' great things for us clg students bro...it's helpful

ankushgupta
Автор

bhai mast explanation mja aa gya 2:50

shubhivdogra
Автор

Don't use competitive coding format because we have no idea about snippets or upload a video on snippets.

rksinha.
Автор

we should also take ans as double because value per weight can be a fraction

kumarivandana
Автор

vector pair ko decreasing order mai sort karne ke liye comparator ki jarrorat nahi hai. directly use :-
sort(v.rbegin(), v.rend());

nitigyajoshi
Автор

If someone wants to know when will be phase 1 is completing
So 168 th video is the last part of phase 1.. after that phase 2 nd starts ..

tejasjoshi
Автор

Hi bhaiya
Ye c++ ka corce kb tk pura hoga

AbhishekPandey-oqil
Автор

Sir please complet web development course series🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

priyaroy
Автор

A doubt... let say items are (160, 80), (85, 45), (85, 45) and weight capacity is then humko last 2 items uthane chiye .. pr is code code ke hisaab se 1st item uthao then baaki kuch uthane ka scope hi nhi hai

bhavishyatiwari
Автор

Why it doesn't work when value is less than weight of the knapsack ??

harshalphadtare
Автор

Bhaiya please ek Course graphic designing par Bana dijiye.

paryantkaushik
Автор

GFG CODE FOR REFERENCE
static bool compare(Item x, Item y){

double t1 = (double) x.value/ (double) x.weight;
double t2 = (double) y.value/ (double) y.weight;
return t1>t2;

}
double fractionalKnapsack(int W, Item arr[], int n)
{
// Your code here

sort(arr, arr+n, compare);
double ans=0;
for(int i=0;i<n;i++){
if(W>=arr[i].weight){
ans+=arr[i].value;
W-=arr[i].weight;
continue;
}

if(W<arr[i].weight){

double v_w= (double )arr[i].value / (double) arr[i].weight;

ans+=v_w*W;
W=0;
break;

}
}
return ans;
}

sauravchaudhary
Автор

Sir why are some videos private please check it aur delete them it is like something missing

aakashthakre
Автор

Sir web development ki vedios Kab aain gi

mariatahir