Saturday, July 15, 2023

Quick Vs Merge Vs Heap Sort

 

 Time complexity

Quick sort  Worst Case = O(n2) Average case and best case: O(n log n)

 

Merge sort Worst case = Average Case = Best Case = O(n log n)

 

Heap Sort Worst case = Average Case = Best Case = O(n log n) 

 

 

Space complexity

Quick sort  Worst Case = O(n) Average case and best case: O( log n)

This happens when the pivot element’s correct position in the partitioned array is in the middle every time. The size of subarrays will be half the size of the original array. In this case, the recursive tree’s size will be O(log n). 

 

Merge sort Worst case = O(n) Average Case = Best Case = O( log n)

Since we use an auxiliary array of size at most n to store the merged subarray, the space complexity is O(n).

Heap sort   O(1)  Doesnt require extra space


 

 

Saturday, July 8, 2023

Jdk8 Features used

Quick Overview of Java 8 Features Some of the important Java 8 features are;

  • forEach() method in Iterable interface
  • default and static methods in Interfaces
  • Functional Interfaces and Lambda Expressions
  • Java Stream API for Bulk Data Operations on Collections
  • Java Time API
  • Collection API improvements
  • Concurrency API improvements
  • Java IO improvements

@FunactionalInterface indicates that an interface has only 1 abstract method . It is not mandatory to use this annotation , but just to avoid accidental addition of other methods .

default and static methods in Interfaces are allowed in JDK8

forEach() method in Iterable interface - wrote a program to create new set

Java Stream API for Bulk Data Operations on Collections - write a program for implementing it

Sunday, December 20, 2020

Kerberos Protocol

Kerberos protocol provides authentication to any service. It could be DB service or Web Service. If an application wants to connec to DB (say) service , then it provides username /password to connect to DB. But if in same application iKerberos is implemented , then instead of directly connecting to DB service , the application gets it connected through kerberos . 

  • First App gets connected to Kerberos's Authentication Server by sending its client ID . 
  • AS verifies the application and sends a TGT token in its response . 
  • App after getting TGT sends a request to connect to TGT server to connect DB service. 
  • TGT server after validating DB service from its service list responds back with Access token to the application. 
  • App then uses this Acess token each time when it needs to connect to DB. 
  • This Access Token contains the encrypted info about TTL. After the time expires Kerberos refreshes Access Token . -- This point is not clear to me. I will describe it later.

Saturday, April 13, 2019

NDM Vs FTP

Recently i have come to know about NDM protocol . NDM was designed for File transfer between Mainframe systems. Later  on it was used for  other computers . It best suitable for  large files.
It offer various features like data compression and checkpoint restart .
given below are the few differences between NDM and FTP .




  • NDM offers for logging, audit, and control features.
  • FTP does not have elaborate processes for logging and auditing. 
  • NDM is an asset when dealing with large data packets through its fully automated feature.
  • FTP requires thorough follow-up of the processes for file transfers and downloads. 
  • Data security is guaranteed with NDM which offers encryption.
  • FTP has the encryption option desired for improved data security.
  • NDM compresses data and therefore uses a low bandwidth.
  • FTP does not compress data and uses a higher bandwidth.
  • The checkpoint restart feature is offered in NDM.
  • FTP does not allow for checkpoint restart. 
  • NDM offers pre- and post-processing features.
  • FTP only has post-processing features.


  • Read more:  Differences Between NDM and FTP | Difference Between http://www.differencebetween.net/technology/differences-between-ndm-and-ftp/#ixzz5kzyrtowE


    NDM later was taken by IBM . It is  now known as CONNECT:DIRECT 

    ONNECT:Direct (NDM)is a product of Sterling Commerce www.stercomm.com. It is a product designed to automate and manage the exchange of files between two computers. Some of the major differences between the two:


    • CONNECT:Direct provides logging, statistics. and audit control features.
    • CONNECT:Direct has a built-in scheduling system for automating file transfers.
    • CONNECT:Direct manages the file transfer process once it has been submitted.
    • CONNECT:Direct can use both TCP/IP and SNA networking protocols as well as direct channels between computers.
    • CONNECT:Direct has batch, CICS, ISPF, and web-based interfaces.
    • CONNECT:Direct has its own scripting (i.e. process) language.
    • CONNECT:Direct has pre- and post-processing features.
    • CONNECT:Direct can be monitored with SNMP and/or other automation tools.
    • CONNECT:Direct allows you to track what is happening while a transfer is happening, as well as tracking the final status of the file exchange process.
    • CONNECT:Direct works with all data types (QSAM, VSAM, PDS, binary).
    • CONNECT:Direct can interface with your JES Spool output.
    • CONNECT:Direct can interface with your email server.
    • CONNECT:Direct can scan directories for the presence of a file, and then initiate a transfer process upon receipt of the file within that directory.
    • One vendor means that there are no compatibility issues.
    • Check-point restarts of large transfers.


    Read more: http://ibmmainframes.com/about9768.html#ixzz5l08CX0PD