Skip to content

Instantly share code, notes, and snippets.

View mudassaralichouhan's full-sized avatar
:octocat:
It’s not a bug; it’s an undocumented feature.

Mudassar Ali mudassaralichouhan

:octocat:
It’s not a bug; it’s an undocumented feature.
View GitHub Profile
@mudassaralichouhan
mudassaralichouhan / tips.md
Last active December 31, 2024 00:13
Tips

wc Command (Unix/Linux/Mac) You can use the wc (word count) command in the terminal to count lines in files. To count lines in all .cc and .h files in your project, you can navigate to your project directory and run:

$ find . -name '*.cc' -o -name '*.h' | xargs wc -l

Command to Count .c Files

$ find . -name '*.c' | wc -l

@mudassaralichouhan
mudassaralichouhan / ip-info.md
Last active December 27, 2024 20:58
IP Information

$ curl http://ifconfig.me

  • 1.1.1.1

IP-API.com:

  • API Key: Not required.
  • Rate Limit: 45 requests per minute.
  • Usage: Free for non-commercial use.

$ curl http://ip-api.com/json/1.1.1.1

@mudassaralichouhan
mudassaralichouhan / DSA.md
Last active February 28, 2025 18:36
Projects Ideas

This progression looks great! After gaining a solid understanding of binary search trees (BSTs), diving into these topics will broaden your knowledge and give you a well-rounded understanding of data structures and algorithms. Here’s a quick breakdown of how you can approach each topic:

1. Balanced Trees

  • AVL Trees: These trees use height balancing and perform rotations to maintain a logarithmic height, ensuring efficient search, insert, and delete operations.
  • Red-Black Trees: A more flexible approach compared to AVL, red-black trees maintain balance using color properties and provide a more efficient implementation in practice for many applications (e.g., in the C++ STL map).

2. Tree Traversals

  • Learn the recursive and iterative methods for each traversal. Understanding these will improve your ability to work with different tree-based algorithms and structures.

3. Heaps

We couldn’t find that file to show.
bool isEven(int n) {
return (n & 1) == 0;
}
/*
*
*/
#include "iostream"
#include "cmath"
class NumberSystem
{
public:
/*
* Binary Search Tree (BST) Concepts and Operations
*
* A Binary Search Tree (BST) is a binary tree where:
* 1. The left subtree of a node contains only nodes with keys less than the node's key.
* 2. The right subtree of a node contains only nodes with keys greater than the node's key.
* 3. Both the left and right subtrees must also be binary search trees.
*
* Operations on Binary Search Tree:
*
@mudassaralichouhan
mudassaralichouhan / dequeue.cc
Last active April 26, 2024 10:30
Queue FIFO.
/**
* Dequeue:
* Dequeue is also known as Double Ended Queue.
* As the name suggests double ended,
* it means that an element can be inserted or removed from both ends of the queue, unlike the other queues
* in which it can be done only from one end. Because of this property, it may not obey the First In First Out property.
*
* implement using doubly linked list
*
* Operation Description Time Complexity
@mudassaralichouhan
mudassaralichouhan / stack-using-unique_ptr.cc
Last active April 8, 2024 20:57
Stack principle of Last In First Out (LIFO)
#include "iostream"
#include "memory"
struct StackHolder {
std::string data;
};
class Stack {
private:
int idx = -1;
@mudassaralichouhan
mudassaralichouhan / CDLL.cc
Last active November 13, 2024 17:25
Link List [$ g++ main.cc -o main.o && ./main.o]
/**
* Circular Double Linked List
*
*/
#include "iostream"
using namespace std;
struct Node {