Skip to content

Instantly share code, notes, and snippets.

View lakshyaraj2006's full-sized avatar
🏠
Working from home

Lakshyaraj Dash lakshyaraj2006

🏠
Working from home
  • 21:01 (UTC +05:30)
View GitHub Profile
@lakshyaraj2006
lakshyaraj2006 / patterns.cpp
Created January 21, 2026 17:31
These top 21 pattern printing questions which you will need to improve your logical thinking.
#include<bits/stdc++.h>
using namespace std;
void pattern1(int n) {
for (int i = 0; i < n; i++)
{
for (int j = 0; j < i+1; j++)
{
cout << "* ";
}
@lakshyaraj2006
lakshyaraj2006 / basic_calculator.cpp
Created January 20, 2026 10:37
This solution solves LeetCode Problems 224, 227 & 772
class Solution {
public:
bool isOperator(char c) {
return c == '+' || c == '-' || c == '*' || c == '/' || c == '^';
}
int precedence(char op) {
if (op == '+' || op == '-') return 1;
if (op == '*' || op == '/') return 2;
if (op == '^') return 3;
@lakshyaraj2006
lakshyaraj2006 / Main.java
Last active January 16, 2026 13:59
Connect jdbc to mysql
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
class Main {
public static void main(String[] args) {
String url = "jdbc:mysql://localhost:3306/<database_name>";
String user = "<username>"; // default: root
String password = "<password>";
@lakshyaraj2006
lakshyaraj2006 / Main.java
Created January 15, 2026 12:02
Java Program to Check Armstrong number.
import java.util.Scanner;
import java.lang.Math;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = sc.nextInt();
int temp = num;
@lakshyaraj2006
lakshyaraj2006 / GuessTheNumber.java
Created December 6, 2025 04:44
Guess the number game. Java OOPs edition.
import java.util.Random;
import java.util.Scanner;
class Game {
int randNum;
int userNum;
int noOfGuesses = 0;
public Game() {
Random rand = new Random();
@lakshyaraj2006
lakshyaraj2006 / sum_of_two_nodes_in_range_equals_k.c
Last active November 4, 2025 12:40
Find the two nodes in a bst whose sum equals k, in a given range [x, y].
#include<stdio.h>
#include<stdlib.h>
struct TreeNode {
int key;
struct TreeNode* left;
struct TreeNode* right;
};
struct TreeNode* createNode(int key) {
@lakshyaraj2006
lakshyaraj2006 / sum_of_two_nodes_equals_k.c
Created November 4, 2025 12:36
Find the two nodes in a bst whose sum equals k.
#include<stdio.h>
#include<stdlib.h>
struct TreeNode {
int key;
struct TreeNode* left;
struct TreeNode* right;
};
struct TreeNode* createNode(int key) {
@lakshyaraj2006
lakshyaraj2006 / stack_using_queue.c
Created November 4, 2025 12:35
Implement Stack using Queue
#include<stdio.h>
#include<stdlib.h>
struct Queue {
int size;
int front;
int rear;
int* arr;
};
@lakshyaraj2006
lakshyaraj2006 / queue_using_stack.c
Created November 4, 2025 12:34
Implement Queue using Stack
#include<stdio.h>
#include<stdlib.h>
struct Stack {
int size;
int top;
int *arr;
};
struct Queue {
@lakshyaraj2006
lakshyaraj2006 / install.bat
Created November 4, 2025 03:08
Download youtube playlist
@echo off
echo Installing a Python package...
pip install yt-dlp
echo Package installation complete.
pause