Found 34472 Articles for Programming

Python program to extract dictionary items for custom values

Devesh Chauhan
Updated on 12-Jul-2023 13:10:27

70 Views

Custom values are specific values that are defined and selected under certain criteria. In a large and complex dataset, specification is very important for constructing an optimized program and therefore extraction of relevant data becomes very important. We can pass a reference list according to which the values can be extracted. This reference list has its own implications as it stores concise information. In this article we will be discussing a similar concept of extracting dictionary items (both keys and values) for a custom data passed through a list. Understanding the Problem We will create a dictionary consisting ... Read More

Python program to extract a single value from JSON response

Devesh Chauhan
Updated on 12-Jul-2023 13:09:04

2K+ Views

Value extraction is a very popular programming concept and it is used in a wide variety of operations. However extracting values from a JSON response is a different concept all together. It helps us to build logic and target specific values in a complex dataset. This article will explain the various methods that can be used to extract a single value from a JSON response. Before we start with value extraction, let’s focus on understanding the meaning of a JSON response. What is a JSON Response? A JSON (JavaScript Object Notation) response is a widely accepted data format through ... Read More

Python program to equal character frequencies

Devesh Chauhan
Updated on 12-Jul-2023 13:04:57

47 Views

Python consists of numerous built-in functions that are designed to perform a wide range of operations including string manipulation, array analysis, algebraic reasoning etc. Strings in python is a data type in which characters are arranged in a sequence. These characters are indexed to acquire specific position in a sequence, we can initiate basic string operations with the help of these index values. This article will elaborate on a similar string-based operation where we will modify an input string to equalize the character frequency. Understanding the Problem Our task is to modify a string in a manner that each ... Read More

Python program to draw a bar chart using turtle

Devesh Chauhan
Updated on 12-Jul-2023 12:58:08

675 Views

Graphical representation of the data provides an enhanced understanding of the complex sub structures of the data and it helps us to easily interpret the hidden patterns and trends. Imagine how convenient it would be if we could just draw a similar relationship programmatically? Python offers a prolific module that is precisely designed to perform such operation and it is known as “turtle”. The “turtle” module is a built-in python library that allows us to draw graphics on a “turtle graphics screen”. In this article, we will create a bar chart using this turtle module. Understanding the Turtle ... Read More

Binary Search vs Contains Performance in Java List

Neetika Khandelwal
Updated on 12-Jul-2023 13:01:06

306 Views

When it comes to searching for elements in a collection, Java provides different options depending on the data structure you're using. Two popular methods for searching in a list are binary search and the contains() method. In this blog post, we'll compare the performance of binary search and contains in a Java list, highlighting their differences, strengths, and best use cases. Binary Search Binary search is an efficient way for locating a specific member in a sorted list. The search space is divided in half on a regular basis until the target element is found or the search space is ... Read More

Python program to divide dictionary and its keys into K equal dictionaries

Devesh Chauhan
Updated on 12-Jul-2023 12:55:00

256 Views

A dictionary is a unique form of array that is used to implement data structures in python. There are several characteristics associated with a dictionary that makes it a very powerful tool in Python. It stores data in the form of key-value pair where each key is a unique identifier and is used to access the corresponding value associated with it. We can perform several operations on this dictionary and manipulate the data stored in it. This article will explain one such operation where we will divide a dictionary and its key into K equal dictionaries. Understanding the ... Read More

12 Tips to Optimize Java Code Performance

Neetika Khandelwal
Updated on 12-Jul-2023 12:48:07

3K+ Views

Java is a well−known programming language that is used to create a variety of applications. The user experience could be harmed by performance issues that can be caused by poorly optimized Java code. In this blog post, you will come across 12 techniques for improving the performance of Java programming. Techniques to Optimize Java Code Use Efficient Data Structures The choice of a suitable data structure has a significant impact on the effectiveness and speed of Java programming. For instance, choosing a LinkedList over an ArrayList can be advantageous if you frequently add or delete entries from a list because ... Read More

Break Any Outer Nested Loop by Referencing its Name in Java

Neetika Khandelwal
Updated on 12-Jul-2023 12:44:02

582 Views

Programming is all about coming up with the best and most efficient ways to solve the real−world problems. There are situations when you want to exit multiple loops simultaneously. This can be accomplished in Java by simply referencing the name of the loop you want to exit. In this tutorial, we'll look at how to break any outer nested loop in Java by referencing its name. Referencing Loop Names in Java You can break out of the Java nested loop by labelling the outer loop. This can be accomplished by using a label before the outer loop followed by a ... Read More

Number of isosceles triangles in a binary tree

Riya Kumari
Updated on 12-Jul-2023 12:42:37

89 Views

A binary tree is a data structure in which each node can have two children (at most). These children are known as left and right child respectively. Suppose we are given a parent array representation using which you have to a create a binary tree. The binary tree may have several isosceles triangles. We have to find the total number of possible isosceles triangles in that binary tree. In this article, we will explore several techniques in C++ to solve this problem. Understanding the Problem You are given a parent array. You have to represent it in the form ... Read More

Number of full binary trees such that each node is product of its children

Riya Kumari
Updated on 12-Jul-2023 12:41:11

69 Views

A full binary tree is a special type of binary tree in which all the parent nodes either have two or no children. In data structures, these kinds of trees are considered as balanced and organized representation. Full binary trees may have a unique feature where each of the parent node is a product of its children. In this article, we will discuss about different methods for counting the number of full binary trees such that each node is product of its children using C++. Input Output Scenarios For example, in the array {1, 5, 3, 4}, we have ... Read More

Advertisements