Artificial Intelligence Programs For Programming in Python

Traveling Salesman Problem ( TSP )] Artificial Intelligence Programs For Master Leval Programming in Python from iter tools import permutations def distance(point1, point2): >>> distance([3,4],[0,0]) 5.0 >>> distance([3,6],[10,6]) 7.0 return ((point1[0] - point2[0])**2 + (point1[1] - point2[1])**2) ** 0.5 def total_distance(points): all the points are in the given order. >>> total_distance([[1,2],[4,6]]) 5.0 >>> total_distance([[3,6],[7,6],[12,6]]) 9.0 return sum([distance(point, points[index + 1]) for index, point in enumerate(points[:-1])]) def travelling_salesman(points, start=None): Time complexity is O(N!), so never use on long lists. >>> travelling_salesman([[0,0],[10,0],[6,0]]) ([0, 0], [6, 0], [10, 0]) >>> travelling_salesman([[0,0],[6,0],[2,3],[3,7],[0.5,9],[3,5],[9,1]]) ([0, 0], [6, 0], [9, 1], [2, 3], [3, 5], [3, 7], [0.5, 9]) """ if the start is None: start = points[0] return min([perm for perm ...

Android interview questions for beginners

Android Interview Questions
Android interview questions from beginners







1.What is Android?

Ans : Android is a complete set of software for mobile devices such as tablet computers, notebooks, smartphones, electronic book readers, set-top boxes etc.
       It contains a linux-based Operating Systemmiddleware and key mobile applications.
               It can be thought of as a mobile operating system. But it is not limited to mobile only. It is currently used in various devices such as mobiles, tablets, televisions etc.

2.Who Devloped Android ? in Which Year ?


Ans: Android  was founded in Palo Alto, California in October 2003 by Andy RubinRich MinerNick Sears, and Chris White.

3.what is heart of android application?

Ans: AndroidMenifest.xml File is Heart of Android Application

4.Which SDK version You Use?

Ans: 2.2 api8

5.latest version of android?

Ans : 8.1 oreo api27

 6.latest version of android studio?

 Ans: 3.2  CANARY 8 in 2018

7.What is Res Folder in Android?
Ans :There are many more items which you use to build a good Android application. Apart from coding for the application, you take care of various other resources like static content that your code uses, such as bitmaps, colors, layout definitions, user interface strings, animation instructions, and more. These resources are always maintained separately in various sub-directories under res/ directory of the project.

This tutorial will explain you how you can organize your application resources, specify alternative resources and access them in your applications.

8.what is R.java File? We are modify or not?

Ans : Android R.java is an auto-generated file by aapt (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory.
If you create any component in the activity_main.xml file, id for the corresponding component is automatically created in this file. This id can be used in the activity source file to perform any action on the component.

Note: If you delete R.jar file, android creates it automatically.


9.What is SDK Emulator?

Ans: An Android emulator is an Android Virtual Device (AVD) that represents a specific Android device. You can use an Android emulator as a target platform to run and test your Android applications on your PC. Using Android emulators is optional.

10.What is Logcat?

Ans : Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio or Eclipse.

11.What is DDMS?

Ans: The Dalvik Debug Monitor Server (DDMS) is a more advanced debugging tool from the SDK that has also been integrated into Android Studio. This tool is able to monitor both a real device and the emulator. , on-device screen capture, on-device thread and heap monitoring, and radio state information.

12.How to Clean Project?

Ans: Project>Clean projects

Comments

Popular posts from this blog

MongoDB Exercises Practice Solution Exercise First

Simple Basic Commands For MongoDB

Artificial Intelligence Programs For Programming in Python