🎓 Ansh Soni | Computer Science student at GCET
💻 Aspiring software engineer | Passionate about coding, AI and ML
🚀 Future innovator in tech | tea addict ☕
I'm looking to
#connect
with people who are interested in.
Web Development
FrontEnd
Backend
DevOps
Javascript
React
UI/UX
Open Source
c++
java
DSA
lets grow together..
follow to instant follow back..
#buildinpublic
#connection
#letsconnect
LeetCode 1008) Construct Binary Search Tree from Preorder Traversal
There may be another optimization in this code?
Identify and comment
Constraints:
1 <= preorder.length <= 100
1 <= preorder[i] <= 1000
All the values of preorder are unique.
#LearningJourney
#CodingJourney
Tokenization of a string by a delimiter in c++
string str = "ansh , soni , is , good";
here delimiter is ' , '
using tokenization concept we convert this string through delimiter like this.
tokens = {"ansh" , "soni" , "is" , "good"};
header file <sstream>
#follo4folloback
🤝
*RUN LENGTH ENCODING(RLE)*
Basic idea behind run length encoding which is used to save space when storing digital images .
0->White(W)
1->Black(B)
observe 1st row
0 1 1 0 0 0 0 1 0 0 0 0 1 1 0
This is coded as
1W,2B,4W,1B,4W,2B,1W
So we can save storage by coded like this
Today I learned about ''Deque''
How to Implement it -
How to insertAt_Front()
How to insertAt_Back()
how to DeleteAt_Front()
How to DeleteAt_Back()
Function to check -> isEmpty() | isFull()
Function to Get -> getfront() | getrear()
#leetcode
#LearnInPublic
#CodingJourney
Q. Minimum Sum of Four Digit Number After Splitting Digits
Approach;
- Take out all the digits of the given num and store in vector. (digits)
- Sort digits vector in ascending order.
-return ( (first*10 + last) + (second*10 + second last) );
Today i learned about map (STL) in CPP
create a map - map<key_type , value_type> map_name ;
learned some functions.
insert()- add element
erase()- remove an element
clear()- removes all element
size()- number of elements in map
empty()- return true if map is empty
Today I learned another data structure called "Binary Tree"
How to build Binary Tree✅
learned Different types of Traversals
- Level Order Traversal (Breadth First Search or BFS) ✅
- InOrder Travesal✅
- preOrder Traversal✅
- postOrder Traversal✅
#CodingJourney