Documente Academic
Documente Profesional
Documente Cultură
Program 1:
#include<iostream>
if (n == 0)
res.append(str);
return;
if (len <= n)
return;
int minIndex = 0;
minIndex = i;
res.push_back(str[minIndex]);
{
17SCSE101144 Ujjwal Singh 1713101137
buildLowestNumberRec(str, n, res);
return res;
int main()
int n = 3;
return 0;
Output:
Program 2:
#include<bits/stdc++.h>
stack<int> s;
17SCSE101144 Ujjwal Singh 1713101137
int max_area = 0;
int tp;
int area_with_top;
int i = 0;
while (i < n)
s.push(i++);
else
tp = s.top();
s.pop();
i - s.top() - 1);
max_area = area_with_top;
tp = s.top();
s.pop();
i - s.top() - 1);
max_area = area_with_top;
17SCSE101144 Ujjwal Singh 1713101137
return max_area;
int main()
int n = sizeof(hist)/sizeof(hist[0]);
return 0;
Output :