Computer Programming
440 subscribers
6 files
231 links
We mainly post about Tech Interview Prep, Machine Learning, Full Stack, Data Structures, Algorithms & Programming Languages.

Please check the pinned message and invite your friends to this channel. Sharing is Caring đź’•
Download Telegram
Channel created
Find the largest and the smallest element of a Vector

Problem Statement: Given a vector, find the largest and the smallest value of it. Solution : Example: Input: {1,22,42,5,55,-21,43} Output: Minimum = -21 , Maximum = 55 Input: {88,77,22,44,11,-121,92} Output: Minimum : -121, Maximum : 92 This problem can be solved easily using C++’s Standard Template Library. C++'s STL: The C++ STL (Standard Template Library)…

https://thecodingbot.com/find-the-largest-and-the-smallest-element-of-a-vector/
std::max_element() in C++ STL

std::max_element() is a utility function under header in C++ STL. The purpose of the function is to give the maximum element value of a container(vector, array etc) within a given range [start, end). Now, the question arises, when we have the std::max(), what is the point of the std::max_element() ? The answer is, there…

https://thecodingbot.com/stdmax_element-in-c-stl/
Delete the entire row if any column has NaN

Problem Statement: Given a dataframe, delete all the rows if any column has a NaN value. Solution : The first approach uses Dataframe.dropna() method and the solution is pretty elegant and relatively easy. However, the second solution is not so straightforward, also not recommended as it is SLOW. Approach 1: Using Dataframe.dropna() Dataframe.dropna() provides easy…

https://thecodingbot.com/delete-the-entire-row-if-any-column-has-nan/
Merge two text columns into a single column in a Pandas Dataframe

There are times when you are doing feature engineering for a data science project and you need to form a new feature by combining two text columns. For example, you are given a dataset with people’s information residing in a city. The columns in the dataset are – First Name, Last Name, Salary, Social Security…

https://thecodingbot.com/merge-two-text-columns-into-a-single-column-in-a-pandas-dataframe/
Markdown in Jupyter/Ipython notebook cheatsheet

It makes a huge difference if you present your data science work with clean code, amazing graphs and Markdowns(WoW) !!! We often get so indulge in getting things done that we forget about the representation. Markdowns in Jupyter notebooks beautify them and also improves the readability of the code. Remember to add graphs and plots…

https://thecodingbot.com/markdown-in-jupyter-ipython-notebook-cheatsheet/
Channel photo updated
A Quick Guide on IPython(Jupyter) Magic Commands

In addition to the normal python syntax, Jupyter(Ipython) has some more enhancements. These are known in Jupyter(Ipython) as the magic commands, and starts with a prefix character %. These commands provide various utility operations, makes the common tasks easy. There are two types of magic commands: Line Magic : Denoted by %(single percent sign). These…

https://thecodingbot.com/a-quick-guide-for-ipythonjupyter-magic-cells/
Rearrange a linked list such that all even index nodes come after all odd index nodes

Problem Statement: Given a singly linked list, group all odd nodes together followed by all the even nodes. Please note here we are talking about the node number and not the value in the nodes. The program should run in O(1) space complexity and O(nodes) time complexity. Solution: It’s a classic interview problem and pretty…

https://thecodingbot.com/rearrange-a-linked-list-such-that-all-even-index-nodes-come-after-all-odd-index-nodes/