Merge Two Binary Trees in C++

Arnab Chakraborty
Updated on 27-Apr-2020 08:59:01

777 Views

Suppose we have two binary trees and consider that when we put one of them to cover the other, some nodes of the two trees are overlapped while the others are overlapping. We have to merge them into a new binary tree. The merge rule is like that if two nodes are overlapping, then sum node values up as the new value of the merged node. Otherwise, the non-empty node will be used as the node of the new tree.So if the trees are −Then the output will be −To solve this, we will follow these steps −The method is ... Read More

Shortest Unsorted Continuous Subarray in Python

Arnab Chakraborty
Updated on 27-Apr-2020 08:55:20

355 Views

Suppose we have an integer array, we need to find one continuous subarray such that, if we only sort that subarray in ascending order, then the whole array will be sorted too. We need to find the shortest such subarray and output its length. So if the array is [2, 6, 4, 8, 10, 9, 15], then the output will be 5. The array will be [6, 4, 8, 10, 9]To solve this, we will follow these steps −res := sort the nums as an arrayans := 0set r as a linked listfor i in range 0 to the length ... Read More

Palindrome Linked List in Python

Arnab Chakraborty
Updated on 27-Apr-2020 08:50:56

2K+ Views

Suppose we have a linked list. We have to check whether the list elements are forming a palindrome or not. So if the list element is like [1, 2, 3, 2, 1], then this is a palindrome.To solve this, we will follow these steps −fast := head, slow := head, rev := None and flag := 1if the head is empty, then return truewhile fast and next of fast is availableif next of the next of fast is available, then set flag := 0 and break the loopfast := next of the next of fasttemp := slow, slow := next ... Read More

What is Bluetooth?

Moumita
Updated on 27-Apr-2020 07:18:51

8K+ Views

Bluetooth is a network technology that connects mobile devices wirelessly over a short-range to form a personal area network (PAN). They use short-wavelength, ultra-high frequency (UHF) radio waves within the range 2.400 to 2.485 GHz, instead of RS-232 data cables of wired PANs.Features of BluetoothBluetooth technology was released in 1999 as Bluetooth 1.0, by Special Interest Group (SIG) who continues to manage it.It was initially standardized as IEEE 802.15.1.Mobile computing devices and accessories are connected wirelessly by Bluetooth using short-range, low-power, inexpensive radios.UHF radio waves within the range of 2.400 to 2.485 GHz are using for data communications.A PAN or ... Read More

802.16 MAC Sublayer Protocol

Moumita
Updated on 27-Apr-2020 07:17:49

3K+ Views

The IEEE 802.16 is a set of standards defining the specifications for wireless broadband technology. It has been commercialized as Worldwide Interoperability for Microwave Access (WiMAX) that is responsible for the delivery of last-mile wireless broadband access. It lays down the standards for both physical layer as well as medium access control (MAC) layer for WiMAX.The IEEE 802.16 MAC sublayer is a part of the data link layer. The data link layer of WiMAX is divided into three sublayers as follows −Security sublayer − This is the bottommost layer and is concerned with the security and privacy of the wireless ... Read More

802.16 MAC Sublayer Frame Structure

Moumita
Updated on 27-Apr-2020 07:15:44

4K+ Views

The IEEE 802.16 set of standards lays down the specifications for wireless broadband technology. It has been commercialized as Worldwide Interoperability for Microwave Access (WiMAX) that is responsible for the delivery of last-mile wireless broadband access.The IEEE 802.16 MAC sublayer is the most important sublayer and concerned with channel management. It has been designed for connection-oriented channel management for point-to-multipoint (PMP) broadband services.The frame format of a generic MAC frame is shown below −The fields are −EC − A single-bit field indicating whether the payload is encrypted.Type − A 6-bit field identifying frame type.CI − A single-bit field denoting the ... Read More

What is Piconet?

Moumita
Updated on 27-Apr-2020 07:13:52

7K+ Views

A piconet is a small Bluetooth network that connects mobile devices wirelessly over a short range of 10m radius, using ultra-high frequency (UHF) radio waves, to form a personal area network (PAN).A piconet can be formed by at most 8 stations, one of which is the master node and the rest slave nodes. Thus, it can accommodate a maximum of 7 slaves. The master node is the primary station that manages the small network. The slave stations are secondary stations that are synchronized with the primary station.Communication can take place between a master node and a slave node in either ... Read More

What is Scatternet

Moumita
Updated on 27-Apr-2020 07:12:03

6K+ Views

A scatternet is a type of Bluetooth network that is formed by the interconnection between two or more individual Bluetooth networks, called piconets. The devices in the scattered should be Bluetooth enabled so that they can communicate wirelessly over a short range of within 10m radius using ultra-high frequency (UHF) radio waves.In a scatternet, there must be at least two piconets. The nodes in a scatternet may be of three types −Master Node − It is the primary station in each piconet that controls the communication within that piconet.Slave Node − A slave is a secondary station in a piconet ... Read More

Declare Reference Types in JShell in Java 9

raja
Updated on 24-Apr-2020 19:46:37

222 Views

JShell is an interactive tool in Java 9 that allows user inputs, evaluates it, and prints output to the user.Unlike a value type, a reference type doesn't store its value directly. Instead, it will store the address where a value is stored. It means that a reference type contains a pointer to another memory location that holds the data. The reference types are String, arrays, class, and delegates.In the below code snippet, when we create a new instance of Animal, it can be created on the heap memory. The new Animal() creates an object on the Heap. Animal@73846619, the object is ... Read More

Use of the Jdeprscan Tool in Java 9

raja
Updated on 24-Apr-2020 17:33:05

321 Views

The jdeprscan tool can be used for static analysis of classes, archives, and folders for the presence of API elements marked as deprecated. This tool only detects items marked as deprecated in Java SE, and it doesn't detect marked items in other libraries. All classes on which the examined class or set of classes depends must be available when compiling or running a class. In the absence of a dependent class, this tool provides a list of unavailable classes preceded by the error: cannot find a class.Below is the syntax for the jdeprscan tool.Syntaxjdeprscan [options] {dir | jar | class}The "jdeprscan" command can be supported by "jmods\jdk.jdeps.jmod" ... Read More

Advertisements