Posts

compiler unchecked warnings -java

Image
Friends! if you like this post ,please comment below and share it to your friends :) Under The Hood Of The Compiler   Compiler Messages What is an "unchecked" warning? A warning by which the compiler indicates that it cannot ensure type safety. The term "unchecked" warning is misleading.  It does not mean that the warning is unchecked in any way.  The term "unchecked" refers to the fact that the compiler and the runtime system do not have enough type information to perform all type checks that would be necessary to ensure type safety. In this sense, certain operations are "unchecked". The most common source of "unchecked" warnings is the use of raw types.  "unchecked" warnings are issued when an object is accessed through a raw type variable, because the raw type does not provide enough type information to perform all necessary type checks. Example (of unchecked warning in conjunction with raw types):   Tre

merge sort easy and best program and algorithm in c++

WHY VECTOR? The better approach over an array is the vector . This may sound bizarre to the newbies, learning c++.  Let me ask you a question before we walk through the code.  Let us take                           int *arr=new int[n]; this creates n integer space holders in heap, pretty intuitive right. Assume that we have filled up the integer space holders with some integer values and we pass this array arr to a function.  Let the function be  auto fun(int a[]) //what is a here, well your quick answer is it's an integer array  X---you are wrong buddy. It is an integer pointer.It's  size  depends on the architecture. auto fun(int a[]) {int n=sizeof(a)/sizeof(a[0]);/*this gives you different answer in different computers based on the its architecture, whether it's a 16 or 32 or 64 bit*/ } Because we are actually calculating the size of integer pointer. sizeof(int *)/sizeof(int); To understand this better see this  post   To avoid all these in-deliberate