Print the Number triangle in C++
Problem Statement Given the number of rows(range), write a program to print the Number Triangle in C++. For Example: Input: 5 Output: Number triangle in C++ Solution Questions like this can be very easily solved, they just require our little attention. The most important step in solving these problems is to identify how the pattern…
https://thecodingbot.com/print-the-number-triangle-in-c/
Problem Statement Given the number of rows(range), write a program to print the Number Triangle in C++. For Example: Input: 5 Output: Number triangle in C++ Solution Questions like this can be very easily solved, they just require our little attention. The most important step in solving these problems is to identify how the pattern…
https://thecodingbot.com/print-the-number-triangle-in-c/
The Coding Bot
Print the Number triangle in C++ - The Coding Bot
In this tutorial, we'll see how we can print the number triangle in c++. We will also discuss the time and space complexity of the algorithm.
A very detailed tutorial on autocompletion with Django and jQuery
Have you ever wondered how you type few in the search bar and it starts giving you suggestions? This feature has always been in my todo list and I finally implemented it a few days in my own website. This tutorial uses Jquery and Django for most of the part. So, yes, it’s a prerequisite. At least you should have a working knowledge.…
https://thecodingbot.com/a-very-detailed-tutorial-on-autocompletion-with-django-and-jquery/
Have you ever wondered how you type few in the search bar and it starts giving you suggestions? This feature has always been in my todo list and I finally implemented it a few days in my own website. This tutorial uses Jquery and Django for most of the part. So, yes, it’s a prerequisite. At least you should have a working knowledge.…
https://thecodingbot.com/a-very-detailed-tutorial-on-autocompletion-with-django-and-jquery/
The Coding Bot
A very detailed tutorial on autocompletion with Django and jQuery - The Coding Bot
In this tutorial, we will see how to implement autocomplete feature in django framework, we will also see how we can add onclick redirect functionality.
Printing right-angled star triangle in C++
Problem Statement Given the number of rows, form a right-angled triangle made up of stars(asterisks) “*”. For Example: Input: 5 Output: Right-angled star triangle Solution You might have seen this problem when you were learning nested loops in Programming. When I started programming, I had a chapter on iterations and in that chapter, this problem…
https://thecodingbot.com/printing-right-angled-star-triangle-in-c/
Problem Statement Given the number of rows, form a right-angled triangle made up of stars(asterisks) “*”. For Example: Input: 5 Output: Right-angled star triangle Solution You might have seen this problem when you were learning nested loops in Programming. When I started programming, I had a chapter on iterations and in that chapter, this problem…
https://thecodingbot.com/printing-right-angled-star-triangle-in-c/
The Coding Bot
Printing right-angled star triangle in C++ - The Coding Bot
In this tutorial, we'll learn how to print right-angled star pattern in c++. We'll also discuss about the time and space complexity of the algorithm
Printing the mirror right-angled star triangle in C++
Problem Statement Given the number of rows, form a mirror right-angled triangle made up of stars(asterisks) “*”. For Example: Input: 5 Output: Mirror right-angled star triangle Solution This problem is pretty straightforward if you know how a nested loop works. Let’s understand this problem with an example. Consider the input number of rows = 5:…
https://thecodingbot.com/printing-the-mirror-right-angled-star-triangle-in-c/
Problem Statement Given the number of rows, form a mirror right-angled triangle made up of stars(asterisks) “*”. For Example: Input: 5 Output: Mirror right-angled star triangle Solution This problem is pretty straightforward if you know how a nested loop works. Let’s understand this problem with an example. Consider the input number of rows = 5:…
https://thecodingbot.com/printing-the-mirror-right-angled-star-triangle-in-c/
The Coding Bot
Printing the mirror right-angled star triangle in C++ - The Coding Bot
In this tutorial, we'll see how we can print a mirror right-angled triangle in C++. We will also see the time and space complexity of the algorithm..
Printing complete star triangle in C++
Problem Statement Given the number of rows, form a complete triangle made up of stars(asterisks) “*”. For Example Input: 5 Output: Complete star triangle pattern in C++ Solution This is an easy problem which can be solved simply using nested loops. Let’s try to understand this problem with an example. Consider the input number of rows…
https://thecodingbot.com/printing-complete-star-triangle-in-c/
Problem Statement Given the number of rows, form a complete triangle made up of stars(asterisks) “*”. For Example Input: 5 Output: Complete star triangle pattern in C++ Solution This is an easy problem which can be solved simply using nested loops. Let’s try to understand this problem with an example. Consider the input number of rows…
https://thecodingbot.com/printing-complete-star-triangle-in-c/
The Coding Bot
Printing complete star triangle in C++ - The Coding Bot
In this tutorial, we'll learn how to print complete star triangle pattern in C++. We'll also discuss the time and space complexity of the algorithm.
Print inverted half star triangle pattern in C++
Problem Statement Given the number of rows, form an inverted half triangle pattern made up of stars(asterisks) “*”. For Example Input: 5 Output: Inverted half star triangle pattern in C++ Solution This is an easy problem which can be solved simply using nested loops. Let’s try to understand this problem with an example. Consider the input number…
https://thecodingbot.com/print-inverted-half-star-triangle-pattern-in-c/
Problem Statement Given the number of rows, form an inverted half triangle pattern made up of stars(asterisks) “*”. For Example Input: 5 Output: Inverted half star triangle pattern in C++ Solution This is an easy problem which can be solved simply using nested loops. Let’s try to understand this problem with an example. Consider the input number…
https://thecodingbot.com/print-inverted-half-star-triangle-pattern-in-c/
The Coding Bot
Print inverted half star triangle pattern in C++ - The Coding Bot
In this tutorial, we will learn how to make a inverted half triangle star pattern in C++. We'll also discuss the time and space complexity of the algorithm.
Print a hollow star triangle in C++
Problem Statement Given the number of rows, form a hollow triangle pattern made up of stars(asterisks) “*”. For Example Input: 5 Output: Hollow star pattern in C++ Solution This problem is a little tricky in comparison to its sister problems(printing complete triangle). However, with just a little modification, this problem can also be easily solved. The…
https://thecodingbot.com/print-a-hollow-star-triangle-in-c/
Problem Statement Given the number of rows, form a hollow triangle pattern made up of stars(asterisks) “*”. For Example Input: 5 Output: Hollow star pattern in C++ Solution This problem is a little tricky in comparison to its sister problems(printing complete triangle). However, with just a little modification, this problem can also be easily solved. The…
https://thecodingbot.com/print-a-hollow-star-triangle-in-c/
The Coding Bot
Print a hollow star triangle in C++ - The Coding Bot
Table of Contents Problem StatementSolutionSteps in detailImplementation of the above approachTime and Space complexity analysis Problem Statement Given the number of rows, form a hollow triangle pattern made up of stars(asterisks) “*”. For Example Input:…
IPython/Jupyter notebook keyboard shortcuts
Overview Jupyter notebooks(previously known as Ipython Notebook) is an opensource interactive web application that allows us to write and run python codes and also create visualization, equations and markdowns. It is one of the most popular tools used in data analysis and data science industry. Definition from the documentation, The notebooks documents are documents produced by the Jupyter…
https://thecodingbot.com/ipython-jupyter-notebook-keyboard-shortcuts/
Overview Jupyter notebooks(previously known as Ipython Notebook) is an opensource interactive web application that allows us to write and run python codes and also create visualization, equations and markdowns. It is one of the most popular tools used in data analysis and data science industry. Definition from the documentation, The notebooks documents are documents produced by the Jupyter…
https://thecodingbot.com/ipython-jupyter-notebook-keyboard-shortcuts/
The Coding Bot
IPython/Jupyter notebook keyboard shortcuts - The Coding Bot
Jupyter notebook is a powerful tool for data analysis.It is good to know the keyboard shortcuts as it can save our time and efforts.In this article...
Markdown in Jupyter/Ipython notebook cheatsheet
Overview 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…
https://thecodingbot.com/markdown-in-jupyter-ipython-notebook-cheatsheet/
Overview 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…
https://thecodingbot.com/markdown-in-jupyter-ipython-notebook-cheatsheet/
Reading CSV file in Numpy
Overview Pandas provide a nice way to read the content of a CSV file into a dataframe using its pandas.read_csv() function, however, there is a need sometimes to read the content of a CSV file into numpy arrays. In this tutorial, we will try to cover every method which can be used to read the…
https://thecodingbot.com/reading-csv-file-in-numpy/
Overview Pandas provide a nice way to read the content of a CSV file into a dataframe using its pandas.read_csv() function, however, there is a need sometimes to read the content of a CSV file into numpy arrays. In this tutorial, we will try to cover every method which can be used to read the…
https://thecodingbot.com/reading-csv-file-in-numpy/
The Coding Bot
Reading CSV file in Numpy - The Coding Bot
Table of Contents Overviewnumpy.recfromcsv()Examplenumpy.genfromtxt()Examplenumpy.loadtxt()Example Overview Pandas provide a nice way to read the content of a CSV file into a dataframe using its pandas.read_csv() function, however, there is a need sometimes…
Convert a Python list to a Pandas Dataframe
Overview Problem Statement: Given a Python list, convert it into a Pandas Dataframe Before anything, the first thing we need to decide is, how many rows and columns we want to have in our dataframe. A list of 12 elements can be converted into a dataframe of: 3 columns with 4 rows, 6 columns with…
https://thecodingbot.com/convert-a-python-list-to-a-pandas-dataframe/
Overview Problem Statement: Given a Python list, convert it into a Pandas Dataframe Before anything, the first thing we need to decide is, how many rows and columns we want to have in our dataframe. A list of 12 elements can be converted into a dataframe of: 3 columns with 4 rows, 6 columns with…
https://thecodingbot.com/convert-a-python-list-to-a-pandas-dataframe/
The Coding Bot
Convert a Python list to a Pandas Dataframe - The Coding Bot
Given a Python list, convert it into a Pandas Dataframe. Solution: We can convert the python list into a dataframe using numpy and pandas
Remove duplicate rows from a Pandas Dataframe
Problem Statement Given a Pandas dataframe, remove the duplicate rows. Solution There are certain functions available to remove duplicates or identify duplicated in the dataframe in Pandas. One such function is df.duplicated() and the other function is df.drop_duplicates(). df.duplicated() not exactly removes duplicates from the dataframe but it identifies them. It returns a boolean series,…
https://thecodingbot.com/remove-duplicate-rows-from-a-pandas-dataframe/
Problem Statement Given a Pandas dataframe, remove the duplicate rows. Solution There are certain functions available to remove duplicates or identify duplicated in the dataframe in Pandas. One such function is df.duplicated() and the other function is df.drop_duplicates(). df.duplicated() not exactly removes duplicates from the dataframe but it identifies them. It returns a boolean series,…
https://thecodingbot.com/remove-duplicate-rows-from-a-pandas-dataframe/
The Coding Bot
Remove duplicate rows from a Pandas Dataframe - The Coding Bot
Remove the duplicate rows from a Pandas Dataframe using df.drop_duplicates() and df.duplicated() with filtering using boolean indexing.
Python’s list count() method with examples
Overview In this tutorial, we will see Python’s sequence type list’s count() method in great detail. We will see its syntax, the parameters it takes, the value it returns, and some examples demonstrating its usage. We will also dig into the runtime cost of the operation. list.count(x) list.count(x) returns the number of times x appears in the…
https://thecodingbot.com/pythons-list-count-method-with-examples/
Overview In this tutorial, we will see Python’s sequence type list’s count() method in great detail. We will see its syntax, the parameters it takes, the value it returns, and some examples demonstrating its usage. We will also dig into the runtime cost of the operation. list.count(x) list.count(x) returns the number of times x appears in the…
https://thecodingbot.com/pythons-list-count-method-with-examples/
The Coding Bot
Python’s list count() method with examples - The Coding Bot
In this tutorial, we'll see Python list's count() function. We'll see some examples and shall also discuss the time complexity of the function.
Different ways to delete an element from the Python list
Lists are probably python’s most versatile and used data structures. You will find it them in a significant number of python programs. They are also a mutable object. Mutable Object – The Python objects whose value can be changed after initialization without changing its identity are known as Mutable Python Object. In this tutorial, you will…
https://thecodingbot.com/delete-an-element-from-the-python-list/
Lists are probably python’s most versatile and used data structures. You will find it them in a significant number of python programs. They are also a mutable object. Mutable Object – The Python objects whose value can be changed after initialization without changing its identity are known as Mutable Python Object. In this tutorial, you will…
https://thecodingbot.com/delete-an-element-from-the-python-list/
The Coding Bot
Different ways to delete an element from the Python list - The Coding Bot
In this article, I will show you the different ways we can delete an element from the Python list. Later, we will also see how to remove all the occurence of an element from the list.
Python’s list remove() method with examples
Overview What are the built-in functions in Python? Built-in methods are the utility methods provided by the Python interpreter for our use, and they come along when you install Python in your environment. It help us to skip implementing many common operations like converting an integer to binary form(using bin()), getting Unicode code point(using ord()), getting the…
https://thecodingbot.com/pythons-list-remove-method-with-examples/
Overview What are the built-in functions in Python? Built-in methods are the utility methods provided by the Python interpreter for our use, and they come along when you install Python in your environment. It help us to skip implementing many common operations like converting an integer to binary form(using bin()), getting Unicode code point(using ord()), getting the…
https://thecodingbot.com/pythons-list-remove-method-with-examples/
The Coding Bot
Python’s list remove() method with examples - The Coding Bot
In this tutorial, we will learn about Python list's remove() method with examples. We will also discuss the time and space complexity of the method.
Python’s list remove() time and space complexity analysis
Overview We have already discussed the list’s remove() method in great detail here. This tutorial shall only focus on the time and space complexity analysis of the method. Before discussing the time and space complexities, let’s quickly recall what this method is all about. list.remove() list.remove(x) deletes the first occurrence of element x from the list. If the…
https://thecodingbot.com/pythons-list-remove-time-and-space-complexity-analysis/
Overview We have already discussed the list’s remove() method in great detail here. This tutorial shall only focus on the time and space complexity analysis of the method. Before discussing the time and space complexities, let’s quickly recall what this method is all about. list.remove() list.remove(x) deletes the first occurrence of element x from the list. If the…
https://thecodingbot.com/pythons-list-remove-time-and-space-complexity-analysis/
The Coding Bot
Python's list remove() time and space complexity analysis - The Coding Bot
Overview We have already discussed the list’s remove() method in great detail here. This tutorial shall only focus on the time and space complexity analysis of the method. Before discussing the time and space complexities, let’s quickly recall what this method…
Swap every ith element of the array with the (i+2)th element
Problem Statement Given an array of positive integers of size N, the task is to swap every ith element with the (i+2)th element of the array Solution The idea is simple, iterate the array and repeat the swapping of ith element with (i+2)th element for every index in the range. For iteration, we can use…
https://thecodingbot.com/swap-every-ith-element-of-the-array-with-the-i2th-element/
Problem Statement Given an array of positive integers of size N, the task is to swap every ith element with the (i+2)th element of the array Solution The idea is simple, iterate the array and repeat the swapping of ith element with (i+2)th element for every index in the range. For iteration, we can use…
https://thecodingbot.com/swap-every-ith-element-of-the-array-with-the-i2th-element/
The Coding Bot
Swap every ith element of the array with the (i+2)th element - The Coding Bot
In this tutorial, we'll learn how we swap ith element with (i+2)th element for every element in the array. We'll also discuss the time and space complexity of the algorithm.
Python’s list clear() method with examples
Overview What are the built-in functions in Python? Built-in methods are the utility methods provided by the Python interpreter for our use, and they come along when you install Python in your environment. It helps us to skip the implementation of many common operations like conversion of an integer to binary form(using bin()), getting Unicode code…
https://thecodingbot.com/pythons-list-clear-method-with-examples/
Overview What are the built-in functions in Python? Built-in methods are the utility methods provided by the Python interpreter for our use, and they come along when you install Python in your environment. It helps us to skip the implementation of many common operations like conversion of an integer to binary form(using bin()), getting Unicode code…
https://thecodingbot.com/pythons-list-clear-method-with-examples/
The Coding Bot
Python’s list clear() method with examples - The Coding Bot
In this tutorial, we'll learn about pyhton's built-in clear() method with examples. We'll also discuss the time and space complexity of the method.
Swap adjacent elements of an array
Problem Statement Given an array of integers of size N, the task is to swap adjacent elements. Solution This problem is very similar to Swap every ith element of the array with the (i+2)th element, and the solutions are also going to be pretty similar. The idea is simple, iterate the array and repeat the swapping…
https://thecodingbot.com/swap-adjacent-elements-of-an-array/
Problem Statement Given an array of integers of size N, the task is to swap adjacent elements. Solution This problem is very similar to Swap every ith element of the array with the (i+2)th element, and the solutions are also going to be pretty similar. The idea is simple, iterate the array and repeat the swapping…
https://thecodingbot.com/swap-adjacent-elements-of-an-array/
The Coding Bot
Swap adjacent elements of an array - The Coding Bot
In this tutorial, we'll see how to swap the adjacent element of an array in c++. We'll also discuss the time and space complexity of the algorithm.
Given a binary tree, find the node with maximum(or minimum) value
Problem Statement Given a binary tree, find the node with maximum(or minimum) value. Solution There exist a general approach to solve these kinds of problems where we have to find some property(maximum, minimum or height of the binary tree). It is clear that for us to find the node with the maximum or minimum value,…
https://thecodingbot.com/given-a-binary-tree-find-the-node-with-maximumor-minimum-value/
Problem Statement Given a binary tree, find the node with maximum(or minimum) value. Solution There exist a general approach to solve these kinds of problems where we have to find some property(maximum, minimum or height of the binary tree). It is clear that for us to find the node with the maximum or minimum value,…
https://thecodingbot.com/given-a-binary-tree-find-the-node-with-maximumor-minimum-value/
The Coding Bot
Given a binary tree, find the node with maximum(or minimum) value - The Coding Bot
In this tutorial, we'll see how we can find maximum/minimum node value in the binary tree. We'll also discuss the time and space complexity of the algorithms.
Given a binary tree, find it’s Maximum Depth(or height)
Problem Statement Given a binary tree, find it’s maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: A leaf is a node with no children. Example : 13 /…
https://thecodingbot.com/given-a-binary-tree-find-its-maximum-depthor-height/
Problem Statement Given a binary tree, find it’s maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: A leaf is a node with no children. Example : 13 /…
https://thecodingbot.com/given-a-binary-tree-find-its-maximum-depthor-height/
The Coding Bot
Given a binary tree, find it's Maximum Depth(or height) - The Coding Bot
In this tutorial, we will see how we can find the depth(or height) of a binary tree. We'll also discuss the time and space complexity of the algorithms...