Skip to content
View ArnavTomar18's full-sized avatar

Highlights

  • Pro

Block or report ArnavTomar18

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please donโ€™t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this userโ€™s behavior. Learn more about reporting abuse.

Report abuse
Arnavtomar18/README.md

๐Ÿ’ซ About Me:

๐Ÿ’ป I'm currently working on:
Building AI-powered applications including a Sentiment Intelligence Engine with 18+ ML models and real-time recommendation systems.

๐Ÿค I'm looking to collaborate on:
Open-source AI/ML projects, data-driven applications, and full-stack ML systems using FastAPI + React.

๐Ÿ› ๏ธ I'm looking for help with:
Scaling ML models, improving deployment pipelines, and optimizing recommendation systems.

๐ŸŒฑ I'm currently learning:
Advanced Machine Learning, NLP, and system design for AI applications.

๐Ÿ’ฌ Ask me about:
Machine Learning, Data Analysis, Sentiment Analysis, and building AI projects from scratch.

โšก Fun fact:
I built a multi-domain AI platform before finishing my first year of engineering.

๐ŸŒ Socials:

Instagram LinkedIn Reddit X email

๐Ÿ’ป Tech Stack:

C C++ Python AWS Anaconda Django FastAPI React TailwindCSS MySQL SQLite Canva Figma Matplotlib NumPy scikit-learn Pandas Plotly GitHub Git

๐Ÿ“Š GitHub Stats:



๐Ÿ† GitHub Trophies

๐Ÿ” Top Contributed Repo


Youโ€™ve got a full DAA lab chunk here. Iโ€™ll give you clean C++ code + sample output for each (Lab 9โ€“15). No fluff.


โœ… Lab 9: Longest Common Subsequence (LCS)

Code

#include #include using namespace std;

int lcs(string X, string Y) { int m = X.length(), n = Y.length(); vector<vector> dp(m+1, vector(n+1, 0));

for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
        if(X[i-1]==Y[j-1])
            dp[i][j]=1+dp[i-1][j-1];
        else
            dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
    }
}
return dp[m][n];

}

int main() { string X = "ABCBDAB", Y = "BDCAB"; cout << "LCS Length: " << lcs(X,Y); }

Output

LCS Length: 4


โœ… Lab 10: N-Queens Problem

Code

#include using namespace std;

#define N 4

bool isSafe(int board[N][N], int row, int col) { for(int i=0;i<col;i++) if(board[row][i]) return false;

for(int i=row,j=col;i>=0 && j>=0;i--,j--)
    if(board[i][j]) return false;

for(int i=row,j=col;j>=0 && i<N;i++,j--)
    if(board[i][j]) return false;

return true;

}

bool solve(int board[N][N], int col) { if(col>=N) return true;

for(int i=0;i<N;i++){
    if(isSafe(board,i,col)){
        board[i][col]=1;
        if(solve(board,col+1)) return true;
        board[i][col]=0;
    }
}
return false;

}

int main(){ int board[N][N]={0};

if(solve(board,0)){
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++)
            cout<<board[i][j]<<" ";
        cout<<endl;
    }
}

}

Output

0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0


โœ… Lab 11: Travelling Salesman Problem (TSP - brute force)

Code

#include #include using namespace std;

#define N 4

int tsp(int graph[N][N], bool visited[], int curr, int count, int cost, int &ans) { if(count == N && graph[curr][0]) { ans = min(ans, cost + graph[curr][0]); return ans; }

for(int i=0;i<N;i++){
    if(!visited[i] && graph[curr][i]){
        visited[i]=true;
        tsp(graph,visited,i,count+1,cost+graph[curr][i],ans);
        visited[i]=false;
    }
}
return ans;

}

int main(){ int graph[N][N]={ {0,10,15,20}, {10,0,35,25}, {15,35,0,30}, {20,25,30,0} };

bool visited[N]={false};
visited[0]=true;

int ans = INT_MAX;
cout<<"Minimum cost: "<<tsp(graph,visited,0,1,0,ans);

}

Output

Minimum cost: 80


โœ… Lab 12: BFS and DFS

Code

#include #include #include using namespace std;

void BFS(vector<vector>& adj, int start) { vector visited(adj.size(), false); queue q;

q.push(start);
visited[start] = true;

while(!q.empty()){
    int node = q.front(); q.pop();
    cout << node << " ";

    for(int i: adj[node]){
        if(!visited[i]){
            visited[i]=true;
            q.push(i);
        }
    }
}

}

void DFS(vector<vector>& adj, int node, vector& visited){ visited[node]=true; cout<<node<<" ";

for(int i: adj[node]){
    if(!visited[i])
        DFS(adj,i,visited);
}

}

int main(){ vector<vector> adj = { {1,2}, {0,3}, {0,3}, {1,2} };

cout<<"BFS: ";
BFS(adj,0);

cout<<"\nDFS: ";
vector<bool> visited(4,false);
DFS(adj,0,visited);

}

Output

BFS: 0 1 2 3 DFS: 0 1 3 2


โœ… Lab 13: Randomized Quick Sort

Code

#include #include using namespace std;

int partition(int arr[], int low, int high){ int pivot = arr[high]; int i = low - 1;

for(int j=low;j<high;j++){
    if(arr[j] < pivot){
        i++;
        swap(arr[i],arr[j]);
    }
}
swap(arr[i+1],arr[high]);
return i+1;

}

void quickSort(int arr[], int low, int high){ if(low < high){ int pi = partition(arr,low,high); quickSort(arr,low,pi-1); quickSort(arr,pi+1,high); } }

int main(){ int arr[]={10,7,8,9,1,5}; int n=6;

quickSort(arr,0,n-1);

for(int i=0;i<n;i++)
    cout<<arr[i]<<" ";

}

Output

1 5 7 8 9 10


โŒ Reality check (important)

This is NOT randomized quicksort. This is normal quicksort.

If examiner is strict โ†’ youโ€™ll lose marks.

Fix (true random pivot)

Replace:

int pivot = arr[high];

with:

int random = low + rand() % (high - low); swap(arr[random], arr[high]); int pivot = arr[high];


โœ… Lab 14: String Matching (Naive)

Code

#include using namespace std;

void search(string txt, string pat){ int n = txt.length(); int m = pat.length();

for(int i=0;i<=n-m;i++){
    int j;
    for(j=0;j<m;j++){
        if(txt[i+j]!=pat[j])
            break;
    }
    if(j==m)
        cout<<"Pattern found at index "<<i<<endl;
}

}

int main(){ string txt="AABAACAADAABAABA"; string pat="AABA";

search(txt,pat);

}

Output

Pattern found at index 0 Pattern found at index 9 Pattern found at index 12


โœ… Lab 15: Real-Time Problem Discussion (Example: Shortest Path)

You donโ€™t write theory only โ€” better show code example.

Code (Dijkstra)

#include #include #include using namespace std;

int minDist(vector& dist, vector& vis){ int min=INT_MAX, index; for(int i=0;i<dist.size();i++){ if(!vis[i] && dist[i]<=min){ min=dist[i]; index=i; } } return index; }

void dijkstra(vector<vector>& graph){ int V = graph.size(); vector dist(V, INT_MAX); vector vis(V,false);

dist[0]=0;

for(int i=0;i<V-1;i++){
    int u = minDist(dist,vis);
    vis[u]=true;

    for(int v=0;v<V;v++){
        if(!vis[v] && graph[u][v] && dist[u]!=INT_MAX &&
           dist[u]+graph[u][v] < dist[v]){
            dist[v] = dist[u]+graph[u][v];
        }
    }
}

for(int i=0;i<V;i++)
    cout<<"Distance "<<i<<": "<<dist[i]<<endl;

}

int main(){ vector<vector> graph={ {0,4,0,0,0,0,0,8,0}, {4,0,8,0,0,0,0,11,0}, {0,8,0,7,0,4,0,0,2}, {0,0,7,0,9,14,0,0,0}, {0,0,0,9,0,10,0,0,0}, {0,0,4,14,10,0,2,0,0}, {0,0,0,0,0,2,0,1,6}, {8,11,0,0,0,0,1,0,7}, {0,0,2,0,0,0,6,7,0} };

dijkstra(graph);

}

Output (shortened)

Distance 0: 0 Distance 1: 4 Distance 2: 12 ...


โš ๏ธ Final blunt advice

Donโ€™t just submit โ€” understand at least 3 properly (LCS, BFS/DFS, QuickSort)

Viva will destroy you if you canโ€™t explain:

Time complexity

Why DP used (LCS)

Difference BFS vs DFS

Why greedy fails in TSP


If you want, Iโ€™ll compress this into a single .cpp file or give viva answers + theory sheet.

Pinned Loading

  1. OTT-Show-Recommender OTT-Show-Recommender Public

    ๐Ÿ“บ OTT Show Recommendation & Trend Dashboard This project aims to create an intelligent dashboard for analyzing and visualizing content trends across popular OTT platforms (Netflix, Amazon Prime, Diโ€ฆ

    Jupyter Notebook 1

  2. Sentiment_analysis Sentiment_analysis Public

    Sentiment Analysis โ€“ NLP Project

    Jupyter Notebook 1

  3. 100_days_of_ML 100_days_of_ML Public

    100-day chronological machine learning journey covering data preprocessing, EDA, feature engineering, and core ML algorithms with hands-on notebooks and experiments.

    Jupyter Notebook 2

  4. Portfolio Portfolio Public

    Personal Portfolio Website showcasing my projects, skills, and contact information.

    CSS