Friday, August 27, 2021

Program to expand given string with spaces and swaps (Assessment Test)

Expand a given string with "spaces" and "swaps" 


Step 1: Expand with "spaces" from the center towards the start/end of the string in each step.

       i) string with no middle character adds a middle single space

              e.g. ""BATA" " becomes "BA TA" and becomes “B A T A”

       ii) string with middle character adds left and right space. A space is introduced before and after a 'character' or a 'substring'.

              e.g. ""BATIA" " becomes "BA T IA" and becomes "B A T I A"

Step 2: Once space is added in each step then it is followed by character swap (swap between character after left space and character before right space). Swap happens and continues between all the opposite characters till the center (space or middle character) of the string is reached.

        e.g.   

       "BA TA" becomes "BA TA"     (swap for middle space will be same)
       "B A T A" becomes "B T A A" (swap between A and T, followed by continuous swap till the middle empty space)

       e.g. 

       "BA T IA" becomes "BA T IA" (swap middle character T will be in the same position)
       "B A T I A" becomes “B I T A A” (swap between A and I, followed by continuous swap till the middle character ‘T’)

Step 3: Print the output

Step 4: Iterate from Step 1


All the intermediate outputs should be printed as below.


Example 1:

Input:  

       BATA

Output: 

       BA TA     # addition of space in middle, followed by swap in middle space
       B T A A   # addition of space (before A and after T) followed by swap of 'T' and 'A' followed by a swap for middle space.


Example 2:

Input: 

       BATIA

Output: 

       BA T IA     
       B I T A A 

Example 3:

Input: 

       CAPITOL

Outputs:

       CAP I TOL       # addition of space(before and after I) swaps 'I' which has no change since it is at the center
       CA T I P OL     # addition of space(before T and after P) swaps 'P' and 'T'. Followed by a swap of 'I.
       C O P I T A L   # addition of space(before A and after O) swaps 'A' and 'O'. Followed by a swap of 'T' and 'P'.  Followed by a swap of 'I'. (swap till the middle is reached)

Example 4:

Input: 

       CARDBOARD 

Output:

       CARD B OARD
       CAR O B D ARD
       CA A D B O R RD
       C R R O B D A A D

Example 5:

Input: 

       BATAMA

Output:

       BAT AMA
       BA A T MA
       B M T A A A

 

Program 

import math

import numpy as np

#input_str = ['CARDBOARD']
input_str = ['BATIA']
new_array = []

for letter in input_str[0]:
    new_array.append(letter)
print(new_array)

if len(input_str) % 2 != 0:
   print("Odd input string, need not to add space in middle")
quot = len(input_str) / 2
indices = quot + 1

#print("Mid character is ", quot, input_str[indices]);
middle_index = math.floor(len(input_str[0]) / 2)
print(middle_index)

print("After adding space", new_array)
# CARDBOARD = CARD B OARD after exchange
# CAR O  B  D ARD
# CA A O  B  D R RD
# C R A O  B  D R A D

right_index = middle_index + 1
left_index = middle_index - 1

# Swap the characters from middle
for index in range(middle_index - 1):
    print("chars from new array", new_array[right_index], new_array[left_index])
    tmp_letter = new_array[right_index]
    new_array[right_index] = new_array[left_index]
    new_array[left_index] = tmp_letter
    
    print("Swapping character ", new_array)
    right_index += 1
    left_index -= 1 
print("Final output after swapping", new_array)  

middle_index = math.floor(len(input_str[0]) / 2)
right_index = middle_index + 1
left_index = middle_index - 1

# Add spaces before and after the chars from middle
for index in range(middle_index):
    new_array.insert(right_index, ' ')
    new_array.insert(left_index + 1, ' ')
    print("After adding space ", new_array)
  
    new_middle_index = math.floor(len(new_array) / 2)
    right_index += 3
    left_index -= 1

Output

['B', 'A', 'T', 'I', 'A']
Odd input string, need not to add space in middle
2
After adding space ['B', 'A', 'T', 'I', 'A']
chars from new array I A
Swapping character  ['B', 'I', 'T', 'A', 'A']
Final output after swapping ['B', 'I', 'T', 'A', 'A']
After adding space  ['B', 'I', ' ', 'T', ' ', 'A', 'A']
After adding space  ['B', ' ', 'I', ' ', 'T', ' ', 'A', ' ', 'A']

Program to rearrange words in a sentence (Assessment Test)

 

Rearrange words

Requirement

1) Arrange the words in alphabetical order based on only the "first" character (not the second character and further characters). 

2) If two words are starting with the same character then the same order of the words should be maintained from the original sentence. 

Constraints for this problem

    Use char[] or Character[] array for the input and output. (e.g., avoid in-built java.lang.String or similar class to represent 'string', instead use char[] to solve the problem). 

    e.g.,  Java      :    char input[] = "The domestic dog is a domesticated form of wolf".toCharArray()
             Python      :    input = list('The domestic dog is a domesticated form of wolf')
             Javascript  :   input = Array.from('hello')

Example 1:

Input    :  this is an impossible task

Output :  an is impossible this task

Explanation:

       'a' is the lowest, followed by 'i' and 't' character.
       an - first word because of 'a'
       'is impossible' - 'is' comes before 'impossible' since 'is' appears in the orginial sentence before 'impossible'
       'this task' - 'this' comes before 'task' since 'this' appears in the orginial sentence before 'task'.

Program to rearrange words in a sentence

input_str = "this is an impossible task"

#output = "an is impossible this task"

def sort_strings(list):
    flag = 0
    for index in range(len(arbitrary_list) - 1):  
        if arbitrary_list[index][0] > arbitrary_list[index + 1][0]:
            tmp_word = arbitrary_list[index]
            arbitrary_list[index] = arbitrary_list[index + 1]
            arbitrary_list[index + 1] = tmp_word
            flag = 1
    return flag

arbitrary_list = []

new_word = ""

for letter in input_str:   #the domestic
    if letter.isspace():   # 't', 'h', 'e', ' ', 'd' ..... etc
       print("Space word ... Add new_word to list and comma sep")
       arbitrary_list.append(new_word)  #the
       new_word = ""
    else:
       new_word = new_word + letter   # new_word = 't' + 'h' + 'e'

if new_word:
   arbitrary_list.append(new_word)    

return_value = sort_strings(arbitrary_list)

while sort_strings(arbitrary_list):
   print("Continue sorting ... ")
else:
   print("Sorted list is", arbitrary_list)

Output

Sorted list is ['an', 'is', 'impossible', 'this', 'task']

Tuesday, August 24, 2021

Technical Support for Assessment Tests

 

Tech Support for Assessment Tests


IT companies conduct assessment exams (e.g CoCubes) or similar online tests to filter out the students

It would be difficult for most of the students to clear the "technical part" of the exam

We do provide "Technical Support" to students to clear CoCubes or similar online tests 

 

Friday, May 14, 2021

Java Syllabus

 

Java Course Contents


 Overview of Java

Variables

Data Types

Basics of Input / Output operations

Conditional constructs (if,  assert)

Looping constructs  (for, while and do / while )


String vs String Buffer, Strng Tokenizer

OOPS Concepts (Polymorphism and Inheritance)

Inner and static classes

Functions

Exceptions and User defined exceptions

Packages and User defined packages

Swing and AWT

Listeners (ActionListener, MouseListener, KeyListener and ItemListener)

Database programming (Connection, ResultSet and Cursors)

Input and Output streams (eg FileInputStream, FileOutputStream, FileReader, FileWriter etc)

Network programming (Client-Server communication)

Thread programming

Wrapper classes

Collection framework



       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159


Thursday, May 6, 2021

Why Us ?

Our Motto

            We believe in the quote 'Knowledge is Wealth' and providing "good education" to students would change their lives which in turn will improve society's condition 


<a href="https://www.teacheron.com/tutor-profile/6Yd?r=6Yd" target="_blank" style="display: inline-block;"><img src="https://www.teacheron.com/resources/assets/img/badges/proudToBeTeacher.png" style="width: 160px !important; height: 68px !important"></a>


What we offer ?

  • 1-hour session (Daily, Monday-Wednesday-Friday or Tuesday-Thursday-Saturday or weekends)
  • Minimal fees for economically-backward or poor students as they should not be ignored


What we don't offer ?

  • Crash Course


       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159

Advanced Devops Concepts

Advanced DevOps Concepts


Training will be conducted on the following 


1) Docker

2) Kubernetes

3) Terraform


Syllabus can be obtained from messaging me at the following SMS / WhatsApp / EmailID 


       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159

Saturday, January 23, 2021

Coaching for School Students

Computer Education for School Students



Computer Coaching is provided for School Students for all Standards and Syllabus


Looking out for a specific topic or customized syllabus kindly let us know in comments section. 


We will do our best to meet your requirement

       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159

Wednesday, January 6, 2021

Visual Basic for Applications (VBA), VB6

 Visual Basic 6


  • Introduction to Visual Basic 6
  • Variables and option explicit
  • Decision making (if condition)
  • Looping consturcts (while, do ... while etc)
  • Creating a form and adding controls to it
  • Control properties and its usage
  • Controls collection
  • Using libraries
  • Database operation (CRUD) using DAO
  • Database operation (CRUD) using ADODB
  • File operations (read / write)
  • Arrays
  • OOP in VB
  • Using flexgrid control to display from SQL Tables

       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159


Linux / Shell scripting

Linux and Shell scripting syllabus


  • Linux Operating system 
  • Linux basic commands
  • Linux file system
  • Shell basic commands
  • home directory and profile
  • Redirection
  • Shell scripting basics
  • if, for, while looping constructs
  • grep
  • sed
  • awk
  • Advanced shell scripting
  • Functions
  • Reading and writing to file
  • sort
  • process related commands
  • memory related commands
  • hard disk related commands 

       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159


Custom Syllabus

Customized Syllabus 


If none of the course (or) course contents mentioned in this blog suits your requirement, kindly let us know your requirement


       Email         :  sathishc58@gmail.com

     Mobile       :  9790881159

       WhatsApp :  9790881159

Project Support

Project Support for BE / MCA / BSc Graduates



We do support BE, MCA and other IT related projects and we already supported projects for students from UK and Norway


       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159

Tuesday, January 5, 2021

Data Structures

DataStructures Syllabus

  • Overview of Data structures
  • Pointers
  • Arrays
  • Singly Linked Lists
  • Doubly Linked List
  • Stack
  • Infix, Prefix and Postfix (operators evaluation)
  • Queue
  • Dequeue
  • Linear Search
  • Sorting (Merge sort and Insertion sort)
  • Binary Tree

       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159

C / C++ Training

C / C++ Syllabus

  •  Overview of C and C++
  • Variables
  • Data Types
  • Basics of Input / Output operations
  • Arrays, Structures and Unions
  • Conditional constructs (if,  assert)
  • Looping constructs  (for, while and do / while )
  • Functions
  • High-level file operations
  • Low-level file operations
  • Basics of pointers
  • Dynamic memory allocation (using malloc / new operator)
  • OOPS Concepts (Polymorphism and Inheritance)
  • Constructor and Destructor

       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159

Monday, January 4, 2021

Python

Python Course Contents


 Overview of Python

Variables

Data Types

Basics of Input / Output operations

Lists, Sets and Dictionaries

String operations with regex

Conditional constructs (if,  assert)

Looping constructs  (for, while and do / while )

Functions

File operations

Exceptions

OOPS Concepts (Polymorphism and Inheritance)

DB concepts in Python

Networking concepts (client-server architecture)


       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159


Sunday, January 3, 2021

Build and Release / Devops

Source Code Management (SCM), Build and Release Process

Amazon Web Services (AWS)

 AWS Syllabus

  • Why Cloud computing ?
  • Cloud Computing Basics  (Private Public and Hybrid clouds)
  • Different types of Services  (IaaS, PaaS, SaaS)
  • AWS  Identify Access Management (IAM),, Roles  and Security Groups
  • EC2 Instances and auto-scaling
  • S3 Buckets
  • Load Balancers - ALB, NLB and ELB
  • Elastic Block Stores (EBS) and Elastic File System (EFS)
  • Snapshots
  • CloudFront
  • Route 53 (DNS Service)
  • AWS Virtual Private Cloud (VPC and Subnetting)
  • Relational Database Services (RDS)
  • Dynamo DB and Coginito Identity management
  • Monitoring Services (Cloud Watch and Cloud Trial)
  • Simple E-mail Services (SES), Simple notification Services (SNS) and SQS

       Email        :  sathishc58@gmail.com

       Mobile      :  9790881159

       WhatsApp:  9790881159